feat: Storybook Phase 1 — DataViz primitive and Card stories#5584
Merged
Conversation
Enable autodocs globally in .storybook/preview.jsx (tags: ['autodocs']). Add 10 co-located story files with live Controls (color pickers, number spinners, range sliders) and Docs tab descriptions: DataViz primitives: - ResponsiveDonutWithInnerPercent: Default, AllOneCategory, TinySlice, A11y - HorizontalStackedBar: Default, TinySegment, SingleSegment, AllZero, KeyboardNav - LineGraph: Default, InProgress, ZeroLeft, ZeroRight - ReverseLineGraph: Default, ZeroReceived, OverReceived - LineBar: Default, ZeroValue, ZeroValueNotFirstRow, MaxValue Card composites: - DonutGraphWithLegendCard: Default, AllOneCategory, TinySlice - LineGraphWithLegendCard: Default, EqualSplit, ZeroBudget - BudgetCard: Default, OverBudget, ZeroBudget - BigBudgetCard: Default, OverBudget, ZeroBudget - ReceivedFundingCard: Default, OverReceived, ZeroFunding Add implementation plan and gotchas at docs/stories/OPS-5525/. Closes #5525
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Phase 1 Storybook coverage for DataViz primitives and related Card wrapper components, plus supporting docs/config so UX can review these presentational components in isolation.
Changes:
- Added co-located Storybook story files for DataViz primitives (donut, stacked bar, line graphs, line bar) with interactive Controls and edge-case scenarios.
- Added co-located Storybook story files for Card wrappers (budget/received funding + legend cards) to exercise common visual states (zero, over-budget/over-received, etc.).
- Updated Storybook preview configuration and added an implementation-plan/gotchas doc for the phase.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/UI/DataViz/ResponsiveDonutWithInnerPercent/ResponsiveDonutWithInnerPercent.stories.jsx | Donut primitive stories incl. accessibility-labeling scenario and shared wrapper for stateful hover percent. |
| frontend/src/components/UI/DataViz/LineGraph/ReverseLineGraph.stories.jsx | Reverse line graph stories for default/zero/over-received states using computed percents. |
| frontend/src/components/UI/DataViz/LineGraph/LineGraph.stories.jsx | LineGraph stories including striped and zero-left/right variants with controls. |
| frontend/src/components/UI/DataViz/LineBar/LineBar.stories.jsx | LineBar stories covering TBD/$0 and max-ratio behavior. |
| frontend/src/components/UI/DataViz/HorizontalStackedBar/HorizontalStackedBar.stories.jsx | Stacked bar stories including tiny segment, all-zero, and keyboard navigation coverage. |
| frontend/src/components/UI/Cards/LineGraphWithLegendCard/LineGraphWithLegendCard.stories.jsx | Legend card stories with realistic funding splits and zero-budget behavior. |
| frontend/src/components/UI/Cards/DonutGraphWithLegendCard/DonutGraphWithLegendCard.stories.jsx | Donut+legend card stories mirroring donut edge cases with computed percents. |
| frontend/src/components/UI/Cards/BudgetCard/ReceivedFundingCard.stories.jsx | Received funding card stories for default/over-received/zero-funding states. |
| frontend/src/components/UI/Cards/BudgetCard/BudgetCard.stories.jsx | Budget card stories for default/over-budget/zero-budget states. |
| frontend/src/components/UI/Cards/BudgetCard/BigBudgetCard.stories.jsx | Big budget card stories plus Storybook-only decorator override for full-width rendering. |
| frontend/.storybook/preview.jsx | Enables autodocs tagging globally and keeps global Redux/Router decorators. |
| docs/stories/OPS-5525/storybook-phase-1.md | Phase 1 implementation notes, conventions recap, and gotchas discovered while adding stories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove role/aria-label from DonutWrapper container div so the MutationObserver accessibility smoke-test isn't masked by the wrapper - Correct LineGraph overBudget description: it disables striping only; bar colors are controlled by data[].color, not by the prop itself
rajohnson90
approved these changes
Apr 28, 2026
weimiao67
approved these changes
Apr 28, 2026
Contributor
|
🎉 This PR is included in version 1.374.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
josbell
pushed a commit
that referenced
this pull request
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Added Storybook stories for all 10 DataViz primitive and Card wrapper components
listed in issue #5525. Every story uses live Controls (color pickers, number
spinners, range sliders) so the UX team can interact with components in isolation.
Also enabled
autodocsglobally so every component gets a generated Docs tab.Issue
Closes #5525
Parent: #1224 | Depends on: #5524 (Phase 0 — complete)
How to test
Navigate to each component in the sidebar and verify:
Stories added (37 total across 10 components):
A11y impact
addon-a11ypanelAccessibilityLabelingstory onResponsiveDonutWithInnerPercentspecificallyvalidates the MutationObserver-applied
aria-labelon the nivo SVGScreenshots
Run
bun run storybooklocally — see How to test above.Definition of Done Checklist
*.stories.jsxexcluded from coverage gate)Links
docs/stories/OPS-5525/storybook-phase-1.mdfrontend/.storybook/README.md