fix(frontend): a11y, docs, and test coverage across 4 components - #1137
Open
nanlebenthel-web wants to merge 1 commit into
Open
fix(frontend): a11y, docs, and test coverage across 4 components#1137nanlebenthel-web wants to merge 1 commit into
nanlebenthel-web wants to merge 1 commit into
Conversation
- fix(Navbar): wire the mobile menu through useModalDialog for focus trap and Escape-to-close; hamburger button aria-expanded reflects the menu open state - fix(MobileMockup): expose the CSS phone illustration as a single accessible unit via role="img" + aria-label, hide decorative inner nodes from assistive tech (fixed pixel dimensions already prevent layout shift; component has no raster/next/image asset) - test(Features): add render coverage asserting all feature titles and card count - docs(ui): add Card behavior notes to UI_COMPONENTS.md, cross-checked against Card.tsx's actual prop signature Closes LabsCrypt#1028 Closes LabsCrypt#1029 Closes LabsCrypt#1030 Closes LabsCrypt#1031
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.
#1028 — Navbar.tsx mobile menu focus trap / Escape-to-close
The mobile menu was rendered as a plain conditional
divwith no keyboard containment, so Tab could escape into hidden background content while the drawer was open. The menu is now extracted into aMobileMenucomponent whose root is wired through the existing shareduseModalDialoghook, giving it a focus trap, Escape-to-close, and focus restoration on close, consistent with other modals in the app. The hamburger button'saria-expandedalready reflected the menu state and continues to do so.Test plan
frontend/src/components/Navbar.test.tsxpasses#1029 — Features.tsx test coverage
Added
frontend/src/components/Features.test.tsxwith a render test asserting each expected feature title is present and a count assertion on the number of rendered<h3>cards, so a future refactor that drops a card will fail a test instead of failing silently.Test plan
npx vitest run src/components/Features.test.tsxpasses (2 tests)#1030 — MobileMockup.tsx alt text / responsive image
MobileMockup.tsxrenders a fully CSS/SVG phone illustration — there is no raster<img>asset in the component, so there's nothing to move tonext/image. Its fixed pixel dimensions (w-[280px] h-[580px] md:w-[320px] md:h-[640px]) already prevent layout shift. To address the accessibility gap, the outer container now exposes the illustration as a single accessible unit viarole="img"and a descriptivearia-label, and the decorative inner nodes are hidden from assistive tech witharia-hidden="true".Test plan
npx tsc --noEmitshows no new errors in this file#1031 — Card.tsx documented prop API
UI_COMPONENTS.mdalready had a Props table forCard(children,className,glow,hover) matchingCard.tsx's signature. Added a "Behavior Notes" section clarifying whatglowandhoveractually do visually and thatchildrenis required, so contributors don't have to read the component source to understand the effect of each prop.Test plan
Card.tsx'sCardPropsinterfaceCloses #1028
Closes #1029
Closes #1030
Closes #1031