Skip to content

Viewer: explain why a recording has no interactive view - #116

Merged
neuromechanist merged 1 commit into
mainfrom
feat/viewer-failure-reason
Jun 13, 2026
Merged

neuromechanist merged 1 commit into
mainfrom
feat/viewer-failure-reason

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Why

When a recording has no Zarr serving store, the viewer shows a generic "No interactive viewer is available for this recording yet." This surfaces the producer-supplied reason instead — e.g. "This file is a trial-averaged or epoched derivative, not a continuous recording, so the time-series viewer is not available."

Phase 3 of a 3-part change. The producer (nemarDatasets/.github #48) writes a failures array into index.json, sourced from biosigIO 1.1.7's typed errors:

"failures": [
  {"path": "derivatives/.../sub-01_..._Legal_Correct-ave.fif",
   "zarr": "derivatives/.../...-ave.zarr",
   "code": "not_continuous",
   "reason": "This file is a trial-averaged or epoched derivative, not a continuous recording, so the time-series viewer is not available."}
]

Only data failures (derivative / corrupt / unsupported) are listed; transient/infra failures are not — so a recording absent from both stores and failures is simply still generating and keeps the existing "may still be generating" copy.

What

  • zarr-index.ts: parse the optional failures array (back-compatible — older indexes → []); zarrFailureReasonByPath() maps both the BIDS path and the .zarr path → reason.
  • dataset/[id].astro: each signal row gets data-zarr-failure-reason (+ matching title); the no-store click branch shows the reason with a download link.
  • eeg-viewer/viewer.ts: ViewerOptions.failureReason + renderUnavailable() prefers it (defensive, for a listed store that fails to open at runtime).

Reason text is single-sourced from the producer (biosigIO REASONS); the website just displays it.

Tests

3 new (failures parsing + legacy-absent tolerance; zarrFailureReasonByPath path/.zarr keys + reasonless skip). 582 tests pass, astro check 0 errors, biome clean.

Depends on the producer side (.github #48, merged) and biosigIO 1.1.7 (released).

When a recording cannot be shown, surface the producer-supplied reason
instead of a generic 'not available'. The Zarr index now carries a
failures array ({path, code, reason}) for recordings that could not be
converted for a reason that is a property of the data (a trial-averaged/
epoched derivative, a corrupt/truncated file, an unsupported format);
transient/infra failures are not listed, so an absent recording is simply
still generating.

- zarr-index: parse the optional failures array (back-compatible with
  older indexes); zarrFailureReasonByPath maps path + .zarr path -> reason.
- dataset/[id]: annotate each signal row with data-zarr-failure-reason and
  show it (and as the row title) when the recording has no store.
- eeg-viewer: ViewerOptions.failureReason + renderUnavailable shows it.

582 tests pass (3 new), typecheck + biome clean.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: eb9828c
Status: ✅  Deploy successful!
Preview URL: https://b7853a16.nemar-website.pages.dev
Branch Preview URL: https://feat-viewer-failure-reason.nemar-website.pages.dev

View logs

@neuromechanist
neuromechanist merged commit 8c4c95c into main Jun 13, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feat/viewer-failure-reason branch June 13, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant