feat(components): add optional custom label to StatusDot#211
Merged
mikewheeleer merged 3 commits intoJun 29, 2026
Merged
Conversation
StatusDot hard-coded its three labels (Operational, Degraded, Down) with no way to override the text, so surfaces like the admin page could not show a state such as "Paused" with the same dot affordance. - Add an optional `label?: ReactNode` prop that overrides the per-variant default text; an omitted, null, or empty-string value falls back to the default so a visible label is always present for screen readers - Preserve the `variant` union (ok | warn | down), the aria-hidden colour dot, and the DOM structure for existing callers that omit `label` - Add a JSDoc block documenting the variants and the label override - Add src/components/__tests__/StatusDot.test.tsx covering default labels per variant, string and ReactNode overrides, empty-string/undefined fallback, and the aria-hidden dot (100% coverage of StatusDot.tsx) - Document the new prop in docs/components.md
…nts-statusdot-custom-label # Conflicts: # src/components/__tests__/StatusDot.test.tsx
Resolving the merge with main surfaced two pre-existing breakages on the base branch that were blocking CI on this PR: - src/app/docs/page.tsx referenced resolveApiBase() and <CurlBlock> without importing them, failing 'next build' typecheck. Add the missing imports. - Two Header tests expected primary links to be marked aria-current twice (desktop + mobile), but the mobile nav panel only renders while open, so exactly one link is current at rest. Correct the assertions to match the component (and the tests' own 'exactly one' descriptions).
Contributor
Author
|
@mikewheeleer |
Contributor
|
solid — in it goes 🚀 |
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.
feat(components): add optional custom label to StatusDot
Closes #152
What changed
src/components/StatusDot.tsx:label?: ReactNodeprop that overrides the per-variant default text.null, or empty-stringlabelfalls backto the variant default, so a visible text label is always present for screen
readers (status is never conveyed by colour alone — WCAG 1.4.1).
variantunion (ok | warn | down), thearia-hiddencolour dot, and the rendered DOM structure are unchanged forexisting callers (admin/stats) that omit
label.rationale.