You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Drop QA from SSR; tabs: Demographics (live) + Data quality (coming soon) #81
Cold SSR on a dataset with a qa/ tree takes 5-28 seconds. Confirmed: `buildQaAggregates` walks `data.nemar.org//qa/` recursively and fetches every per-file `_dataqual.json` at request time. For a 200-300 subject HBN dataset that's hundreds-to-thousands of subrequests on the SSR critical path; on005509 even hits the Worker subrequest budget and falls to 503. Datasets without a `qa/` tree return null after one 404 (~85ms) and load instantly — the asymmetry the user observed.
`Cache-Control: s-maxage=300` already absorbs repeat hits (warm: ~100ms), but the cold path is the user-visible problem.
Approach
Remove `getQaAggregates` from the SSR `Promise.all` in `src/pages/dataset/[id].astro`. Page paints from 2 backend fetches (landing + metadata). Cold SSR drops from 28s to ~500ms regardless of QA tree size.
Replace `` in the page body with a `` component carrying two tabs:
Demographics (default, eager hydration after first paint). Client-side fetch of `data.nemar.org///participants.tsv`, parse, render `` (already exists — does stacked-by-sex age histogram) plus a small M/F pie/donut.
Keep `buildQaAggregates` / `QualityPanel` / `AgeGenderChart` in the tree. Unused on the rendered page but ready to revive when Epic: Website compute surfaces (#493) #511 ships.
Acceptance
Cold SSR for on005509 and on005514 under 1.5s (cold) and under 200ms (warm).
No `api.nemar.org/datasets` or `data.nemar.org//qa/` fetches on the dataset detail page's SSR critical path.
Demographics tab shows a small M/F pie + age histogram stacked by sex for any dataset whose participants.tsv has `sex` and `age` columns.
Datasets without a participants.tsv (or without those columns) get a tasteful empty state in the Demographics tab.
Data quality tab shows a clear "coming soon" message referencing nemar-cli#511.
Tabs are keyboard-navigable (left/right arrow, home/end), follow the WAI-ARIA tabs pattern.
Activity