Repository navigation
fix(site/src/pages/TemplateBuilder): name View details links after their template or module - #32320
Conversation
…eir template or module Repeated "View details" registry links in the template builder had identical accessible names but different destinations (WCAG 2.4.4). Add visually hidden context so each name reads "View details for <name>"; the visible text stays first in the name (2.5.3). Closes DEQ-210, DEQ-142
jeremyruppel
left a comment
There was a problem hiding this comment.
[reviewer-agent] (@jeremyruppel) round 1: changes needed.
The fix itself is correct. I checked in Storybook that every link is named View details for <name> (opens in new tab) on step 1, step 2, and the configure headers, and the hidden span doesn't change layout. Required CI passes, and the change is within scope and size limits. One should-fix: the DEQ-142 surface (ModuleCard) has no regression test.
Nits: the new test's name says "each" but it checks one card. ModuleCard's optional detailsUrl lets stories and tests render an <a> with no href; that predates this PR.
Follow-up filed: DEQ-634 ("View details" links also select or toggle their card; predates this PR).
🤖 Generated by Coder Agents on behalf of @jeremyruppel.
|
|
||
| <Link href={detailsUrl} target="_blank" className="text-xs font-normal"> | ||
| View details | ||
| View details <span className="sr-only">for {name}</span> |
There was a problem hiding this comment.
[should-fix] DEQ-142 is about this component, but nothing tests its link name: only TemplateCard got a test, and ModuleCard.test.tsx renders without detailsUrl, so this <a> has no href and no link role. Pass detailsUrl in renderCard and assert toHaveAccessibleName(/^View details for Docker Containers/).
| expect(onSelectDocker).toHaveBeenCalledTimes(1); | ||
| }); | ||
|
|
||
| it("names each details link after its template", () => { |
There was a problem hiding this comment.
[nit] The test name says "each" but it only checks the Kubernetes card. Either assert both cards or rename it, for example includes the template name in the details link name.
…n module and template cards Require ModuleCard detailsUrl so the card always renders a real link.
jeremyruppel
left a comment
There was a problem hiding this comment.
[reviewer-agent] (@jeremyruppel) round 2: approved at 5c7fc52. Every template builder "View details" link is now named after its template or module (WCAG 2.4.4), and the visible text still comes first in the name. Round 1's findings are fixed: the module card has a link-name test, the template card test checks both cards, and ModuleCard requires detailsUrl. Follow-up: DEQ-634 (activating View details also selects or toggles its card; predates this PR).
🤖 Generated by Coder Agents on behalf of @jeremyruppel.
The template builder repeats a "View details" registry link on every base template card (step 1), module card (step 2), and configured item, so screen reader users could not tell which template or module each link opens (WCAG 2.4.4, Link Purpose (In Context)).
Each link now has visually hidden context after its visible text, so its accessible name reads "View details for AWS EC2 (Linux) (opens in new tab)". The visible text is unchanged and stays first in the name, so voice-control users can still say "View details" (2.5.3).
Closes DEQ-210, DEQ-142
/templates/new/builder, step 1 base template cards (TemplateCard)/templates/new/builder?step=module-select, module cards (ModuleCard)TemplateBuilderAvatarData)Accessible names read from Chromium's accessibility tree on the running dev server:
View details (opens in new tab)(repeated)View details for Docker Containers (opens in new tab),View details for AWS EC2 (Linux) (opens in new tab), ...View details (opens in new tab)(repeated)View details for Claude Code (opens in new tab),View details for Codex CLI (opens in new tab), ...Decision log
sr-onlyspan overaria-label:aria-labelwould override the link content and duplicate the "(opens in new tab)" text thatLinkalready appends. The hidden span extends the name in place and keeps label-in-name.sr-onlyspan overaria-describedby(used in fix(site/src/modules/notifications): describe inbox action links with notification content #32317): these cards have no single element whose text alone identifies the item without extra noise, and the Deque suggested labels ("View details for Git Clone") are names, not descriptions. Putting the item in the name also fixes link lists such as the NVDA Elements List.inline-flexlink.hrefinstead of the accessible name) was fixed. Its optional nit (extract a shared link component for the three call sites) was skipped to keep the fix small.ModuleCardlink-name test (DEQ-142 had no coverage), made theTemplateCardtest check both cards, and madeModuleCard'sdetailsUrlrequired, asTemplateCard's already is, so stories render a real link. Activating "View details" also selects or toggles the card; that predates this PR and is tracked in DEQ-634.TemplateCardandModuleCardlink-name tests fail without the fix),pnpm check,pnpm lint, and a Playwright check of accessible names on both steps against./scripts/develop.sh.🤖 Generated by Coder Agents on behalf of @chrifro.