Skip to content

Data quality tab drawn from the inventory - #633

Merged
neuromechanist merged 28 commits into
feature/issue-625-epic-quality-axesfrom
feature/issue-625-phase0b2-quality-tab
Nov 28, 2026
Merged

neuromechanist merged 28 commits into
feature/issue-625-epic-quality-axesfrom
feature/issue-625-phase0b2-quality-tab

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Phase 0b.2 of the quality-axes epic: the dataset page's Data quality tab, drawn from the quality inventory. Stacked on #632 (base is its branch; retarget to feature/issue-625-epic-quality-axes once #632 squash-merges).

The question the tab answers: "Is this dataset described, annotated and recorded well enough to reuse, and what is missing?"

What changes

  • The Data quality tab is always rendered (the "nothing shows nothing" rule is gone). Precondition lines (data present, BIDS validator) under the heading; the state legend in an (i) beside the heading; one Signal card per recipe, full width; Metadata and Annotation side by side (one column on phones).
  • Every element the inventory declares for the dataset's modalities is listed in its state. A panel with no measured element keeps its full layout, grayed, with one banner; an element carries its own mark only where it differs from the banner. Not supported (dotted outline, hatched ground, ⊘) looks unlike not processed (dashed, ○).
  • The Signal card draws today's extensions.dataQuality summary: D1 Coverage donut (failed and skipped codes behind a disclosure), D2 three rings (thick arc median, thin arc observed range, a ring only for a % metric on the 0 to 100 scale, else the row form), D3 line noise, D4 every metric as a sparkline row with median tick, end pips and a hatched missing pip, each row opening into the full histogram figure. Coverage (n of N) beside every aggregate; headline values rounded to the inventory's precision and scale; tables keep stored text. One "Numbers" disclosure; pipeline names only in the "How this was computed" footer. Undeclared recorded metrics (channelsInterpolated) only in the Numbers table, under their exported name.
  • The dataset-version stale note (derived, never stored) in the card header; "Not supported for MEG yet." line on a mixed EEG and MEG dataset; the tab says it describes the latest version when ?v= selects another.
  • Files: src/lib/quality/render/ (state marks, (i) tip, donut, ring, sparkline, signal card, checklist panel, tab), src/lib/quality/info-tip-client.ts (the only client code: Escape closes a tip), src/styles/data-quality.css (everything under .dq, tokens only), src/components/quality/DataQualityTab.astro; DatasetTabs.astro takes quality: QualityPage (required); the dataset page builds evaluateQuality(...) once. DatasetQualitySummary.astro is deleted; dataset-summary.ts keeps readQualitySummary, SUMMARY_SENTENCES, metricLabel, and exports metricFigure, metricTable and copyWords (summaryTree, recipeSection, notProcessed removed; nothing imports them).
  • Website ADR 0035 gets an ## Update — 2026-11-28 pointer: nemar-cli ADR 0146 supersedes in part the W6 addendum's "Where it lives"; decisions 1 to 7 stand; the README index line says so. No text deleted. AGENTS.md map updated.
  • Legacy family (F1): already deleted on staging by Quality views epic: changelog and stale docs #609; absence re-proved (no file, and git grep for the old names over src test e2e scripts prints nothing).

Deviations from the card

  • Breakpoints are container queries on the tab, not window media queries. The tab sits in the page's main column (800 px at a 1280 px window, measured on the dev server), so v3's 980/620/420 px window breakpoints become 700/520/360 px of tab width; at the main column's width row 1 is rebalanced Coverage 3, Typical recording 6, Line noise 3 (v3's 4/5/3 holds from 1000 px of tab), and D4 is one column of rows (two from 1000 px). The checklists are one column inside each panel (two from 1100 px).
  • A placeholder histogram is a flat track (the UI rule), not the mockup's gray silhouette.
  • A non-measured D4 row or ring shows its glyph and state word in place of the value, with its full sentence on a line under it, so a sentence never squeezes a value column.
  • The spread fixture's Good channels has an observed minimum of -2.5 (its underflow): that slot is drawn in the row form, never a ring (tested).

Pre-merge checklist (.rules/ui-data-display.md)

  • The question is written above, and every element serves it.
  • Dataset level only; channel, component and event elements belong to the viewer and are not drawn.
  • Extends the existing DatasetTabs surface in its grammar; no parallel viewer, picker or toolbar.
  • No schema identifier or pipeline name in body text, titles or labels (tested over every tree; exported names only in <code>, tips and the footer).
  • Every metric name has a focusable (i) with definition, unit, direction and exported variable name.
  • Names, units and definitions come from the inventory; sentences from the contract's copy; a source test refuses any string literal of four or more words in DatasetTabs, the tab component and the renderers.
  • Pipeline versions appear once, in the "How this was computed" footer.
  • Human units; headline values rounded to display precision and scale; tabular numerals; value and unit joined by a no-break space.
  • Titles balanced; no widowed unit; sibling ring label blocks of equal height (checked in the browser at 1280 px).
  • Tiles on a faint ground without outlines (the grayed states add the state's outline only); one emphasis per tile; accent only on the median marks.
  • Balanced layout; first row one row of tiles, at most 300 px tall at 1280 px (checked in the browser).
  • Breakdowns (failed and skipped codes) behind a disclosure, reachable by keyboard and touch, and in the Numbers tables.
  • Every chart has an inline key (rings), an aria-label from stored values, and its data in a table.
  • Rings for bounded percentages only (a non-% unit or an off-scale value gets the row form).
  • No rainbow map.
  • Empty state keeps the layout, grayed, one banner; no hidden element, no zero fill, no repeated state text.
  • Every state uses its glyph, word and look; not supported differs from not processed in class and look.
  • Coverage beside every aggregate.
  • Visualizations fill their column (SVG scales within its tile).
  • Selectable lists, linked views, source toggles: none in this view (not applicable).
  • The (i) opens on hover and focus, stays while hovered, closes with Escape (checked in the browser).
  • Hit targets: the (i) button is 24 by 24 px.
  • No live values.
  • Contrast: state glyphs use --color-success, --color-warning and the new --q-danger (dark-lifted, at least 3:1, tested).
  • No stored figure image; hand-built SVG drawn on the server; no chart library.
  • Tokens only; both theme branches through tokens.css.
  • Checked at 1280 px and 390 px, light and dark, no horizontal page scroll (Playwright, 12 cases).
  • No animation added; prefers-reduced-motion respected.

Screenshots

Taken locally with the repo's Playwright spec (E2E_SHOTS=<dir> bun run test:e2e e2e/data-quality-tab.spec.ts) for shown (also the partial case: 3 of 6 processed), not processed and MEG, at 390 and 1280 px in light and dark, plus the real dev-server dataset page for a live EEG dataset at 1280 light and 390 dark. Not attached here; the reviewer has them, and the spec reproduces them.

Tests and gates

  • bun run typecheck (0 errors), bun run lint
  • Targeted Vitest: quality-contract-drift, quality-inventory, quality-copy, quality-axes, quality-render (24), quality-state-tokens, quality-summary, quality-summary-pages, dataset-tabs, dataset-tabs.astro, data-quality-tab.astro (9), quality-views-vocabulary-drift, quality-panel.astro: 354 passed, 4 skipped (the sibling-checkout drift cases)
  • Drift tests strict against the nemar-cli epic head (NEMAR_CLI_QUALITY_CONTRACT, NEMAR_CLI_QUALITY_VIEWS): 27 passed; copy-quality-views-vocabulary.mjs --check green
  • bunx astro build && bun scripts/check-quality-views-size.mjs --require-build: passes (the tab adds no lazy chunk); the inventory is absent from dist/_astro
  • bun run test:e2e e2e/data-quality-tab.spec.ts: 13 passed
  • bun run test:e2e e2e/dataset-tabs-deep-link.spec.ts: 2 passed
  • Not run: full bun run test (epic to staging only); CI's strict drift tests are red until Epic: quality axes and quality views nemar-cli#2524 reaches dev (one-merge rule)

Part of #625 (close by hand after merge, naming the PR and commit)
Part of nemarOrg/nemar-cli#2524

Review round 1 (head e5a050c, #632's fixes merged in): names stay on one line with their (i) (short names, nowrap; in the main column the tiles pair as v3's narrow layout, Typical recording full width); each state sentence said once per panel, rows keep glyph and word; minus sign U+2212 for negatives; the off-scale ring slot shows its median as a number in the ring's place; All metrics histograms fill their column with one shared value column; donut center is HTML text at the site's sizes; tips open on :focus and a dismissed tip stays closed inside its wrap; the sentence check reads template literals; e2e checks one-line names, the computed look of not supported against not processed, and the tip; text-wrap: pretty on sentences. Gates: targeted Vitest 365 pass / 4 skip, typecheck, lint, build and size check, inventory absent from dist, e2e 15 pass; screenshots regenerated.

Review round 1, copy keys (head 569b138, #632 merged in): the tab prints the bytes sentence and the any-datatype not-supported sentence. Targeted Vitest 366 pass / 4 skip; strict drift against nemar-cli 7736cb96 27 pass; typecheck, lint, build and size check, inventory absent from dist; e2e 15 pass; screenshots regenerated.

Review round 2 (head 37ed363): in the narrow container queries the All metrics value column is max-content, so each histogram keeps the rest of the row (at least 120 px at a 390 px window, asserted in e2e); the missing count's pip is a fixed-size HTML mark beside the value, never inside the stretched SVG; the aria-label and note phrases are declared once in src/lib/quality/site-copy.ts (website-local: nemar-cli's copy has no matching key; a test refuses a key it already has); the unused lines value is dropped from the e2e; a new e2e checks the hover-only tip rearms when the pointer leaves its wrap. Gates: targeted Vitest 369 pass / 4 skip, typecheck, lint, build and size check, inventory absent from dist, e2e 16 pass at 390 and 1280 px in light and dark; screenshots regenerated.


Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Base automatically changed from feature/issue-625-phase0b-quality-tab to feature/issue-625-epic-quality-axes November 28, 2026 23:39
…xes' into feature/issue-625-phase0b2-quality-tab
@neuromechanist
neuromechanist merged commit e8223a6 into feature/issue-625-epic-quality-axes Nov 28, 2026
3 of 4 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-625-phase0b2-quality-tab branch November 28, 2026 23:44
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