Repository navigation
docs(storybook): group Charts mark stories under Marks and add an Annotations page - #12587
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested: one claim in the description does not hold at this head.
- The description says the new
Charts/Annotationspage "says how to build them", but that guidance is a meta JSDoc that Storybook shows only on a Docs page, andAnnotations.stories.tsxhas notags: ['autodocs'](unlike the Chart, ChartAxis and ChartGrid stories), so the built index has no Annotations Docs entry and readers never see it; add the tag (and update the description's index evidence to 3126 entries and 27 added ids) or drop that sentence.
The reorganization itself checks out: the 26 ids move exactly as listed, the moved stories render pixel-identically, and the story routing still assigns every moved story to Chart. Two older notes in packages/charts/docs/ still name "Mixed Marks"; updating them is optional.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Annotation stories are collected on one Annotations page: verified (six stories under
Charts/Annotationsin the head index). - That page says how to build annotations: false (
Annotations.stories.tsx:24-27has noautodocstag; neither the head index nor CI's built index has an Annotations Docs entry, and the text appears on no manager or preview surface). - Mark pages move under
Charts/Marks/<Mark>: verified (index). - Combo sits on the Chart page as "Combo (bars + line)" beside Playground: verified (index, sidebar).
- Bar and Line lead with Default: verified (
Bar.stories.tsx:21,Line.stories.tsx:20). - 26 story URLs change with no redirect, and the charts package is unreleased: verified (index diff;
packages/charts/package.jsonis private and canary-only). - No Chart component record is current: verified (all six Chart records are draft).
- Annotations get no legend entry and no tooltip row: verified (
types.ts:190-199,legend.ts:24-27,tooltip.ts:46-48). referenceLine({x})takes a number and draws only on a numeric x axis: verified (marks/referenceLine.tsx:19,:214;layout.ts:129-135).- Story content and data are unchanged apart from export names and one shared axes constant: verified (source comparison; eight base/head frame pairs pixel-identical).
- Combo hides its controls and Playground keeps them: verified for Combo (panel shows Actions and Interactions only); Playground's controls not probed.
- Combo imports the shared monthly data under an alias and Playground is unchanged: verified (
Chart.stories.tsxdiff). - Axes & Grids, Playground, Legend Default and Tooltip Modal Layering keep their ids: verified (index).
- Both indexes have 3125 entries, exactly 26 ids are removed and 26 added, and nothing else changes: verified (both indexes compared entry by entry; CI's built head index also has 3125).
- 28 of 28 capture pairs are identical: partly verified (eight desktop light pairs identical; phone and dark not rerun).
- Every moved story routes to Chart for the accessibility and RTL audits, with identical owner counts: verified (repository routing over both indexes).
- Curated RTL checks, Charts RTL coverage totals and the play-guard result: not rerun (those stories' ids, sources and index entries are unchanged).
- Sidebar order is Annotations, Marks, Chrome, Chart, Color, with no custom sort: verified (index order,
preview.tsx, sidebar). - Only synthetic test fixtures name the old ids, and two older chart notes mention Mixed Marks: verified (repository search).
- The story-tree check passes: verified (5/5 on the head index, and in CI's Storybook build at this head).
- Prettier and ESLint pass: verified (Lint workflow at this head).
- Typecheck, changeset, knowledge and pre-review checks pass: not rerun.
- Documentation-only scope with no internal context: verified (only Storybook files change; no internal references in the added text).
Files:
apps/storybook/.storybook/story-tree.test.ts: clear.apps/storybook/README.md: clear.apps/storybook/stories/charts/Annotations.stories.tsx: finding (description renders nowhere).apps/storybook/stories/charts/Area.stories.tsx: clear.apps/storybook/stories/charts/Band.stories.tsx(deleted): clear.apps/storybook/stories/charts/Bar.stories.tsx: clear.apps/storybook/stories/charts/Candlestick.stories.tsx: clear.apps/storybook/stories/charts/Chart.stories.tsx: clear.apps/storybook/stories/charts/Composite.stories.tsx(deleted): clear.apps/storybook/stories/charts/Dot.stories.tsx: clear.apps/storybook/stories/charts/ErrorBar.stories.tsx(deleted): clear.apps/storybook/stories/charts/Line.stories.tsx: clear.apps/storybook/stories/charts/ReferenceLine.stories.tsx(deleted): clear.apps/storybook/stories/charts/WebGL.stories.tsx: clear.
9a40ef9 to
5234e77
Compare
There was a problem hiding this comment.
Approved pending CI: the Charts Storybook reorganization checks out, and the earlier finding is fixed, since the Charts/Annotations meta now has tags: ['autodocs'] and its Docs page shows how to build annotations.
CI did not run on this head: the run found no room under the CI ceiling and cancelled the required checks, so re-run CI before merging.
Two older notes in packages/charts/docs/ still name "Mixed Marks"; updating them is optional.
Claims and files checked
Review mode: full; reason: history
Claims:
- Annotation stories are collected on one Annotations page: verified (six stories under
Charts/Annotationsin the head index). - That page's Docs page says how to build annotations: verified (
Annotations.stories.tsx:27addstags: ['autodocs']; the head index has the Annotations Docs entry, and the page renders both description paragraphs and all six stories). - Mark pages move to
Charts/Marks/<Mark>: verified (head index). - Combo sits on the Chart page as "Combo (bars + line)" next to Playground: verified (head index and sidebar).
- Bar and Line lead with Default instead of Simple: verified (
Bar.stories.tsx:21,Line.stories.tsx:20). - 26 story URLs change with no redirect, and the charts package is unreleased: verified (index comparison;
packages/charts/package.jsonis private and canary-only). - No Chart component record is current, so none governs these stories: verified (all six Chart records are draft).
MarksjoinsChromeas a deliberate sub-grouping in the README and the story-tree check: verified (README.md:36-40,story-tree.test.ts:121).- Annotations get no legend entry and no tooltip row: verified (
types.ts:190-194,legend.ts:25,tooltip.ts:46). referenceLine({x})takes a numericxand draws only on a numeric x axis: verified (marks/referenceLine.tsx:19,:214).- Story content and data are unchanged apart from export names and one shared axes constant: verified (source comparison; eight base and head frame pairs are pixel-identical).
- Combo disables its inherited controls and Playground keeps its controls: verified (Combo's panel shows only Actions and Interactions; Playground's args are unchanged in the diff).
- Combo imports the shared monthly data under an alias and Playground is unchanged: verified (
Chart.stories.tsx:5; the diff only adds the import and the new story). - Annotations uses autodocs like Chart, ChartAxis and ChartGrid: verified (
Annotations.stories.tsx:27,Chart.stories.tsx:36,ChartAxis.stories.tsx:23,ChartGrid.stories.tsx:26). - Axes & Grids, Playground, Legend Default and Tooltip Modal Layering keep their ids: verified (head index).
- The index grows from 3125 to 3126 entries: exactly 26 ids removed and 27 added (the 26 plus the Annotations Docs page), with no other entry changed: verified (both indexes compared entry by entry).
- 28 of 28 capture pairs are identical: partly verified (eight desktop light pairs identical; phone and dark states not re-captured, and their render code is unchanged).
- Every moved story still routes to Chart for the accessibility and RTL audits, with identical owner counts: verified (the repository's own routing over both indexes).
- Curated RTL checks, Charts RTL coverage totals and the play-guard result: not rerun (those stories' ids, sources and index entries are unchanged).
- The Annotations Docs page renders the description and all six stories: verified (Docs page probe).
- Sidebar order is Annotations, Marks, Chrome, Chart, Color, with no custom sort: verified (index order, sidebar probe,
preview.tsx). - Only synthetic test fixtures name the old ids, and two older chart notes mention Mixed Marks: verified (repository search).
- The story-tree check passes against the index: verified (5 of 5 on the head index).
- Prettier and ESLint pass on the changed files: verified (both rerun on the changed files; the Lint workflow also passed at this head).
- The Lab and Storybook typecheck passes: partly verified (the changed stories and the story-tree test typecheck clean with the charts package resolved from source; the full Storybook typecheck needs built packages and CI's typecheck did not run at this head).
- The Storybook build passes: partly verified (the dev server indexed and rendered every probed story; CI's Storybook build did not run at this head).
- Changeset, knowledge, record-lookup and pre-review checks pass: not rerun (the diff adds no changeset or record, which is consistent).
- Documentation-only scope with no internal context: verified (only Storybook files change; no internal references in the added lines, title, body, branch or commit message).
Files:
apps/storybook/.storybook/story-tree.test.ts: clear.apps/storybook/README.md: clear.apps/storybook/stories/charts/Annotations.stories.tsx: clear.apps/storybook/stories/charts/Area.stories.tsx: clear.apps/storybook/stories/charts/Band.stories.tsx(deleted): clear.apps/storybook/stories/charts/Bar.stories.tsx: clear.apps/storybook/stories/charts/Candlestick.stories.tsx: clear.apps/storybook/stories/charts/Chart.stories.tsx: clear.apps/storybook/stories/charts/Composite.stories.tsx(deleted): clear.apps/storybook/stories/charts/Dot.stories.tsx: clear.apps/storybook/stories/charts/ErrorBar.stories.tsx(deleted): clear.apps/storybook/stories/charts/Line.stories.tsx: clear.apps/storybook/stories/charts/ReferenceLine.stories.tsx(deleted): clear.apps/storybook/stories/charts/WebGL.stories.tsx: clear.
…otations page
Charts stories mix the marks a chart is built from with annotation helpers
and one combo chart, each on its own top-level page. A reader who wants a
target line or a confidence band has to check four pages.
- Mark pages move to Charts/Marks/{Area,Bar,Candlestick,Dot,Line,WebGL}.
Bar and Line "Simple" becomes "Default".
- The bars + line combo moves to Charts/Marks/Combo as "Bars + line", with
its Controls panel disabled.
- A new Charts/Annotations page holds the reference line, reference range,
vertical reference line, confidence band, error bars and layering stories
that were on the Reference Line, Band, Error Bar and Composite pages. Its
Docs page says how to build them. Layering's draw order changes so
annotations sit above the bars.
- The story-tree check allows the Marks group, and the Storybook README
lists the deliberate sub-groupings.
Story content and data are otherwise unchanged. 26 story ids move;
Chart/Playground, Chrome/Legend/Default and Chrome/Tooltip/Modal Layering
keep their ids.
5234e77 to
4ffd92c
Compare
There was a problem hiding this comment.
Approved pending CI: some CI checks have not finished on this head yet, so this is not ready to merge until they pass.
The Charts Storybook regrouping checks out: the moved story ids match the description, the moved stories render the same apart from Layering's intended draw order, and the RTL audit still routes every moved story to Chart. The earlier finding stays fixed, since the Charts/Annotations meta keeps tags: ['autodocs'] and its Docs page carries the annotation guidance.
Claims and files checked
Review mode: full; reason: history
- Claim: Annotation stories now share one Annotations page whose Docs page explains how to build them: verified (
Annotations.stories.tsx:16-27, a Docs entry in the built index) - Claim: The six mark pages move under
Charts/Marks: verified (each file'stitle, built index) - Claim: The bars + line combo sits at
Charts/Marks/Comboas "Bars + line" with its Controls panel disabled and its render unchanged: verified (Combo.stories.tsx:8,:22,:23; identical frame) - Claim: Layering now paints annotations above the bars, in the stated order: verified (
Annotations.stories.tsx:163-175, series render in array order inChart.tsx:437-442, SVG paint-order probe) - Claim: Bar and Line lead with Default instead of Simple: verified (
Bar.stories.tsx:21,Line.stories.tsx:20) - Claim: Exactly 26 story ids move and one Docs entry is added, with no other entry changed by this change: verified (built index diff)
- Claim: Annotations get no legend entry and no tooltip row: verified (utility mark types in
types.ts:190-194, skipped inlegend.ts:25andtooltip.ts:46) - Claim: A vertical reference line draws only on a numeric x axis: verified (
referenceLine.tsx:214) - Claim: Story content and data are otherwise unchanged: verified (story bodies diffed; 8 of 8 captured moved stories render pixel-identically)
- Claim: The Playground, Axes & Grids, Legend Default and Tooltip Modal Layering stories keep their ids: verified (both indexes)
- Claim: The RTL audit still routes every moved story to Chart with unchanged owner counts: verified (the audit's own routing over both indexes)
- Claim: No Chart component record is current: verified (all six Chart records are draft)
- Claim: The sidebar order follows index order, with no custom sort: verified (index order, no
storySortin the preview config) - Claim: Old ids appear only in synthetic test fixtures and two older chart notes: verified (repository search)
- Claim: Story-tree check, formatting, lint, typecheck and the Storybook build pass: verified (story-tree 5 of 5, prettier and eslint clean, type check clean, CI build-storybook and typecheck passed)
- Claim: The author's phone-size capture set: not reproduced here; this review's own desktop light and dark captures agree
- File:
apps/storybook/.storybook/story-tree.test.ts: clear - File:
apps/storybook/README.md: clear - File:
apps/storybook/stories/charts/Annotations.stories.tsx: clear - File:
apps/storybook/stories/charts/Area.stories.tsx: clear - File:
apps/storybook/stories/charts/Band.stories.tsx: clear - File:
apps/storybook/stories/charts/Bar.stories.tsx: clear - File:
apps/storybook/stories/charts/Candlestick.stories.tsx: clear - File:
apps/storybook/stories/charts/Combo.stories.tsx: clear - File:
apps/storybook/stories/charts/Composite.stories.tsx: clear - File:
apps/storybook/stories/charts/Dot.stories.tsx: clear - File:
apps/storybook/stories/charts/ErrorBar.stories.tsx: clear - File:
apps/storybook/stories/charts/Line.stories.tsx: clear - File:
apps/storybook/stories/charts/ReferenceLine.stories.tsx: clear - File:
apps/storybook/stories/charts/WebGL.stories.tsx: clear
Reader impact
Engineers who use the Charts Storybook to learn and test charts get a clearer structure:
Charts/Annotationspage, and its Docs page says how to build them.Charts/Marks/{Area,Bar,Candlestick,Dot,Line,WebGL}. This keeps them apart from the Chart page and from chart components added later.Charts/Marks/Combo, as "Bars + line".26 story URLs change, with no redirect. Old links to those stories break. The charts package is unreleased.
Source of truth
current, so no record governs these stories. The README/story-tree rule and the code below decide them.apps/storybook/README.mdand.storybook/story-tree.test.ts.MarksjoinsChromeas a deliberate sub-grouping.packages/charts/src:UTILITY_MARK_TYPES(referenceLine,errorBar,band) intypes.ts. The legend skips these types (legend.ts), and so do the tooltip rows (tooltip.ts).referenceLine({x})takes a numericxand draws only on a numeric x axis":marks/referenceLine.tsxdraws a vertical line only when the x scale is not a band scale.Correction
Charts/Area,Bar,Candlestick,Dot,Line,WebGLCharts/Marks/<Mark>, stories unchangedaxesconstant (Band and Error Bar had the same JSX inline).seriesorder is now bars, reference range, confidence band, reference line, line, error bars. Before, it was reference range, reference line, confidence band, bars, error bars, line, so the opaque bars covered the annotations. Colors, data and labels are unchanged. Its description lists the new order.Combo.stories.tsx(Charts/Marks/Combo, exportBarsAndLine), and its render is unchanged. Like Mixed Marks before, it takes no args, soparameters: {controls: {disable: true}}keeps the panel from showing inert controls.Charts/Annotationsgetstags: ['autodocs'], like Chart, ChartAxis and ChartGrid, so its description renders on a Docs page.Chrome/Axes & Grids,Chart/Playground,Chrome/Legend/DefaultandChrome/Tooltip/Modal Layeringkeep their ids.Evidence
All checks ran in headless Chrome against production Storybook builds of
main(6e1aaca) and of this commit. Both were built withnode .github/scripts/build-packages-and-storybook.mjs.Built
index.json. Main has 3125 entries, and this commit has 3126. Exactly these 26 ids are removed, and 27 are added: the 26 below pluscharts-annotations--docs, the Annotations Docs page. 0 other entries changed (full JSON per entry):Moved stories render the same, except Layering's intended draw order. Combo, Layering and the five annotation stories were captured on both builds: desktop 1280×900 at DPR 1 and phone 390×844 at DPR 3, each in light and dark. Before each capture, the script asserts the chart SVG, the color scheme,
ltr, a loaded Figtree, the DPR, the viewport width and the expected title and label text. It also waits for two identical consecutive frames.Accessibility and RTL owners. The RTL audit's own routing (
buildStoryComponentRoutesinapps/storybook/rtl-audit/rtl-audit-coverage.mjs) was run over every Charts story in both indexes.charts/Chartbefore and after.Charts/Marks/Combonames no public component, so it falls back to Chart, like the other mark pages.Stories other checks open by id. On both builds:
charts-chart--playground: pass (LTR 48 < 590, RTL 1052 > 510).charts-chrome-legend--default: pass (LTR 48 < 186, RTL 1052 > 914).story-play-guard.jsoncharts-chrome-tooltip--modal-layering: passes. The guard's outcome lines are identical on both builds. In this local headless environment, 4 unrelated targets (PowerSearch ×2, Layer ×2) fail the same way on main and on this commit.Controls in the Storybook manager. Combo, at
Charts/Marks/Combo, shows no Controls tab; its panel tabs are Actions and Interactions. Playground is unchanged and keeps its 5 controls.Annotations Docs page. In the Storybook manager,
charts-annotations--docsrenders the page description and all six stories. The description says to build annotations withreferenceLine(),band()anderrorBar(), that they get no legend entry and no tooltip row, and thatreferenceLine({x})takes a numericx.Sidebar. Under Charts the order is now Annotations, Marks, Chrome, Chart, Color, which is Storybook's index order (
preview.tsxhas nostorySort). Marks lists Area, Bar, Candlestick, Combo, Dot, Line, WebGL. Chart was not first before this change either (Area, Chrome, Band, Bar and Candlestick came first).References.
git grepfor the deleted file names, the old ids and the old titles finds only synthetic fixtures in.github/scripts/rtl-audit-coverage.test.mjsand.github/scripts/visual-gate/lib/plan.test.mjs. Those fixtures don't read the built index. Two older notes inpackages/charts/docs/name "Mixed Marks" in prose. Nothing in the docsite, workflows,rtl-audit/targets.json,story-play-guard.jsor any specverified_by.Scope
Components: Charts Storybook stories (Marks and Annotations pages); no component source
Testing
story-tree.test.tsagainst the built index: 5/5 pass.prettier --checkandeslint --max-warnings=0on the changed files: pass.pnpm -F @astryxdesign/lab -F @astryxdesign/storybook typecheck: pass.pnpm check:changesets: pass. No changeset, because this is story-only.pnpm check:knowledge: pass. No record changes.pnpm specs:for --diff origin/main: no record links to the changed paths.pnpm review:pre --head HEAD: 0 findings. The change merges cleanly intomain.