feat(docs): enhance maturity badges with icons and tests (#1318) - #2852
feat(docs): enhance maturity badges with icons and tests (#1318)#2852pratik wayase (PratikWayase) wants to merge 6 commits into
Conversation
Bill Berry (WilliamBerryiii)
left a comment
There was a problem hiding this comment.
Thank you for this contribution, pratik wayase (@PratikWayase). Extracting the maturity badge into a reusable component improves consistency, and the focused tests cover the recognized variants well; I also confirmed that npm run validate:docs and npm run lint:md-links pass against this head.
I am requesting changes for one accessibility blocker and two functional concerns detailed inline. Please also either complete the collection-detail-page criteria from #1318 or adjust the issue scope and Fixes linkage, then record the passing validation and clear the blocked merge state before merge. Comment on any of the suggestions if you would like to discuss the implementation path.
|
Hii Bill Berry (@WilliamBerryiii), I've resolved all three blocks, replaced the title attribute with an accessible CSS-only tooltip, fixed the dead click zone viz pointer events, and added a strict unknown fallback state with dev guardrails instead of silently defaulting to experimental. This PR focuses solely on UI/UX, accessibility, and CSS layout improvements for maturity badges The dynamic YAML collection page generation will be scoped into a separate PR to keep history clean. All 95 tests and validation checks are passing against the head. |
Description
Enhances the existing maturity badge system with icon support, accessible tooltips, and robust YAML ingestion guardrails. The previously inline badge logic in
PackageCardshas been extracted into a reusableMaturityBadgecomponent to ensure UI consistency across the site.Key changes include:
✅,🔶,🧪) are rendered alongside updated, professional glossary text (e.g., "Production-ready / GA") for better scannability.titleattribute with a CSS-only tooltip driven by:focus-withinand:hover. The badge is now a focusable element associated with the tooltip viaaria-describedby, ensuring keyboard and touch users can access definitions.pointer-events: noneto the badge wrapper so clicks pass through to the card's stretched link overlay. The badge also accepts anhrefprop to act as a valid navigation link matching the card's destination.'Unknown'fallback state (❓ icon) for unrecognized YAML values instead of silently defaulting to Experimental. Includes a dev-onlyconsole.warnguardrail to catch manifest typos early.docs/docusaurus/src/components/MaturityBadge/index.tsxwith asizeprop (sm/md) for upcoming collection detail pages.Related Issue(s)
Relates to #1318
Relates to #1317 (Dynamically generate Docusaurus collection pages from YAML manifests)
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
hve-builderand addressed all actionable findings.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md).github/hooks/*/*.json)evals/)Testing
docs/docusaurus/src/components/MaturityBadge/__tests__/index.test.tsx.normalizeMaturity()function to verify lowercase YAML values map correctly to Title-case.'Unknown'fallback state renders correctly for invalid/empty inputs and logs a dev warning.it.eachto verify all maturity levels render correct icons, CSS classes, and accessible tooltip content.jest-axeaccessibility testing to ensure no a11y violations.npm run validate:docslocally to confirm all 95 tests and validation checks pass.Checklist
BEFORE
AFTER
Required Checks
Required Local Checks
The following local-safe validation commands must pass before merging:
npm run validate:localnpm run validate:docsnpm run spell-checknpm run lint:md-linksSecurity Considerations
Additional Notes
This PR prepares the UI foundation for Issue #1317. Once the dynamically generated collection detail pages are created, they can simply import
<MaturityBadge maturity={frontMatter.maturity} size="md" />to display consistent, accessible badges on those pages as well.