2.6 KiB
2.6 KiB
Progress Patterns
- Status:
completed - Owner:
Codex - Date:
2026-03-25
Goal
Extend Progress beyond the default linear fill so the component can also render segmented
dashboard-style progress bars like the operational cost reduction example, without splitting the
API into separate one-off components.
Scope
- In scope:
- add a structural
patterndimension toProgress - support a segmented dashboard meter mode
- keep the existing linear pattern untouched as the default
- update tests, exports, and Storybook docs
- add a structural
- Out of scope:
- radial gauge visuals
- introducing a separate
Gaugecomponent - modifying unrelated dashboard story drafts
Constraints
- Keep
variantreserved for semantic color intent. - Preserve the existing ARIA progressbar behavior.
- Expose stable slots and
data-*hooks for the segmented structure. - Stay within the current Cadence UI tonal and motion language.
Affected Surfaces
packages/ui/src/components/progress.tsxpackages/ui/src/components/progress.variants.tspackages/ui/src/components/progress.test.tsxpackages/ui/src/skins.csspackages/ui/src/index.tsapps/docs/src/components/progress.stories.tsx
Plan
- Add a
patternAPI forlinearandsegmentedprogress structures. - Implement segmented rendering with stable slots and deterministic filled-state logic.
- Refresh docs so the segmented meter is shown in a realistic dashboard context.
- Run targeted validation for the package and docs surfaces.
Validation
pnpm --filter @ai-ui/ui typecheckpnpm --filter @ai-ui/ui test -- --run packages/ui/src/components/progress.test.tsxpnpm harness:validate:docs
Status Log
2026-03-25 17:58Confirmed the existing Progress API is linear-only and inspected the local revenue dashboard draft for the target segmented visual language.2026-03-25 18:10Added apatterndimension with segmented rendering, repeated segment slots, and progress-specific skin tokens for dashboard meters.2026-03-25 18:14Updated Storybook docs and package exports to document and expose the segmented mode.2026-03-25 18:18Verifiedpnpm --filter @ai-ui/ui typecheck,pnpm --filter @ai-ui/ui exec vitest run packages/ui/src/components/progress.test.tsx --config ../../vitest.config.ts, and targetedeslinton the changed files.2026-03-25 18:19pnpm harness:validate:docsis currently blocked by an unrelated local Storybook draft:apps/docs/src/components/metric-card.stories.tsximportsMetricCardfrom@ai-ui/ui, but that export is not present in the built package yet.