Repository navigation
fix(site): meet 24px target size in the shared Link component - #30844
Merged
Merged
Conversation
Add py-1 with a matching -my-1 to the base Link variant so its clickable box is at least 24px tall (WCAG 2.5.8) without moving surrounding layout. Callers that reset all padding now reset only the left padding so the vertical pair stays intact.
TooltipMessage's descendant margin replaced the top half of Link's -my-1, and Button asChild merged its sizing with Link's hit-area padding. Compensate in both callers.
Flex and grid parents stretched the inline-flex Link across the container, so the hover underline and focus ring spanned the full width of cards like the template builder's "View details".
chrifro
marked this pull request as ready for review
October 16, 2026 11:47
aqandrew
approved these changes
Oct 29, 2026
Collaborator
Collaborator
Author
|
Done. Generated by Coder Agents on behalf of @chrifro. |
# Conflicts: # site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/LicensesSettingsPageView.tsx
aqandrew
approved these changes
Oct 30, 2026
aqandrew
left a comment
Collaborator
There was a problem hiding this comment.
Just 2 small nits re: comments, but otherwise lgtm!
# Conflicts: # site/src/pages/OrganizationSettingsPage/OrganizationProvisionersPage/OrganizationProvisionersPageView.tsx
# Conflicts: # site/src/components/Link/Link.tsx # site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.tsx
This branch was previously deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

The shared
Linkcomponent now reaches the WCAG 2.5.8 minimum target size of 24px without moving any surrounding layout.Deque flagged every "View details" link in the template builder at 18px tall. These are the registry links on the base-template cards (step 1) and the module cards (step 2). The cards pass
className="text-xs", and tailwind-merge then removes the variant'sleading-6, so the link falls back to text-xs's 16px line height plus the 18px icon. The defaultsmvariant is also under the minimum, at 20px.Fix
Linkvariant getspy-1 -my-1. The padding grows the element's own box by 4px above and below, and the matching negative margin keeps its margin box, and so the layout, unchanged. axe measures the element's box (getBoundingClientRect), not pseudo-elements, which is why this uses padding instead of a::beforeoverlay.bottom-pxtobottom-1.25(5px), so it stays in the same place under the text.p-0(orm-0/mt-*) to drop the basepl-0.5. tailwind-merge would removepy-1but keep-my-1, which shrinks the layout by 8px, so these callers now usepl-0. Three callers needed margin math:TemplateExampleCardmt-1becomesmt-0,AgentStatusmt-2becomesmt-1, andDeploymentBanner(p-3) addsmy-0.Linkfrom outside itsclassName.TooltipMessage's[&_a]:mt-2replaced the top half of-my-1and becomes[&_a]:mt-1. Vertical margins only apply to the inline-flexLink, not to plain inline anchors. The Provisioners empty state renders<Button asChild><Link>, so itsLinksetspy-0 my-0and leaves sizing to the button.SmallFocusedstory puts the enlarged box in a Pixel screenshot.w-fit. The builder cards render the link inside aflex flex-colparent, which stretched it across the card (202.5px), so the hover underline and focus ring ran the full card width. Now the link is only as wide as its text and icon (91px). In inline and block layout,inline-flexalready sized itself to its content, sow-fitonly changes links inside flex and grid parents.HelpPopoverLinkandHelpPopoverActionget the samew-fit.HelpPopoverLinksGroupis aflex flex-colparent, so the workspace outdated tooltip's "Update" button stretched across the popover (278px). It is now 71px. This also narrows the same links in the agent and sub-agent outdated tooltips, the SSH button popover, and the build options popover. Text position is unchanged.Intended visible changes: the keyboard focus ring wraps the taller box, 8px taller than before. Links inside flex and grid parents no longer stretch, so their hover underline and focus ring end with the text. Nothing else changes visually.
Expected Pixel diffs: I screenshotted all 602 stories that render
Linkon main and on this branch. Only three kinds of diffs remain:ModelFormcost-estimate stories and the newSmallFocusedstory.LifecyclePageViewandOverviewPageViewstories are 4px taller. A link at the very bottom of the page extends the document scroll height by its padding, so the screenshot gains 4px of blank space. Content pixels are identical.Proof
Template builder base-template card,
/templates/new/builder. Before ismain, after is this branch. The link goes from 202.5 × 18px (stretched across the card) to 91 × 26px (sized to its content). The default state is byte-identical.For
w-fit, I compared all 695 stories that renderLinkwith and without the change. No link text moved, and only the builder's "View details" links narrowed. Every other pixel diff either did not reproduce on a re-run or is under 15px of anti-aliasing noise. The login page's centered "Forgot password?" link stays in the same position.Workspace outdated tooltip, from the
WorkspaceOutdatedTooltipstory. Before ismain, after is this branch. The "Update" action (HelpPopoverAction) goes from 278 × 24px (stretched across the popover) to 71 × 24px, and the version link (Link) goes from 20px to 28px tall. The dashed outline marks each clickable box.Other
Linkuse casesThe fix lives in the shared component, so every
Linkgets the larger target. The dashed outline marks each link's clickable box. Without the outline, these stories render identically before and after.I ran axe
target-sizeand measured every link across all Storybook stories, comparing this branch with its merge base:Link(843 instances in 601 stories)Links under 24px tallAuditLogDescriptionstories)axe only flagged the builder links because it exempts small targets that are inline in a sentence or have enough space around them. The other 221 small links met the spacing exception but are now 24px tall regardless.
w-fitonly changed the width of the builder's "View details" links.Not in scope: 98 axe
target-sizeviolations remain on elements that don't useLink: icon buttons (size-5), the combobox clear button (DEQ-13), and a few hand-styled react-router links in Agents chat tools. These need separate fixes.axe-core 4.11
target-sizeon a local dev server:Layout check: for 85 shared
Linkinstances on 10 pages (/templates,/starter-templates,/deployment/licenses,/deployment/overview,/workspaces,/templates/new/builder,/audit,/users,/templates/new,/templates/new?exampleId=docker), each link's content top, margin-box height, and parent height are identical before and after. Builder card heights are unchanged.Fixes DEQ-124, DEQ-306, DEQ-509, DEQ-462, DEQ-267, DEQ-591, DEQ-252, DEQ-419, DEQ-386, DEQ-390, DEQ-411, DEQ-471, DEQ-331, DEQ-21, DEQ-381, DEQ-14, DEQ-111, DEQ-66, DEQ-274, DEQ-178, DEQ-48, DEQ-248, DEQ-146, DEQ-446, DEQ-374
Decision log
TemplateCard.tsxandModuleCard.tsx. Both already use the sharedLink. The user chose a global component fix over per-card fixes.::beforeoverlay is clickable and satisfies WCAG, but axe'starget-sizecheck reads the element's own bounding rect. The Deque re-scan would still flag it. Padding plus an equal negative margin enlarges the measured box and leaves layout unchanged.py-1and not size-specific padding. Many callers override the font size (text-xs,text-base,text-[length:inherit]), and tailwind-merge drops the variant'sleading-*when they do. That makes the content height unpredictable (16 to 24px). A flat 4px each side makes every case at least 24px.classNamepassed to#/components/Link/Linkwith a TypeScript AST scan, which also covers multi-line JSX andcn()calls. I then searched for Slot parents (asChild) wrappingLinkand for parent descendant selectors that target anchors. Finally, a before/after screenshot comparison of all 602 Storybook stories that renderLinkcaught the tooltip and Button cases that the static scans missed.text-xsoverrides on the builder cards and elsewhere is not needed for compliance after this change. I left it out to keep the diff focused.TemplateUploadp-0caller, an arbitrarybottom-[5px], and a geometry assertion in a play function, which was replaced by theSmallFocusedstory.Generated by Coder Agents on behalf of @chrifro.