Skip to content

fix(site/src/modules/resources): let agent metadata values grow with text spacing - #32055

Merged
chrifro merged 2 commits into
mainfrom
a11y/text-spacing-cut-off-agent-metadata
Nov 13, 2026
Merged

chrifro merged 2 commits into
mainfrom
a11y/text-spacing-cut-off-agent-metadata

Conversation

@chrifro

@chrifro chrifro commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Under WCAG 1.4.12 text spacing overrides, workspace agent metadata values such as "23.3/147 GiB (16%)" and "0.098/13 cores (1%)" were cut off with an ellipsis on the workspace page.

StaticWidth measures each value once and then pinned that measurement as a fixed width in pixels. When a user stylesheet later widened the text, the box kept its old width, and the value stayed clipped until it changed. It now sets minWidth instead. Values still never shrink, so there is no jitter between updates, but they can grow when spacing changes.

Closes DEQ-434

Ticket Surface Screenshots
DEQ-434 Workspace page, agent metadata row before/after
Verification, decisions, and dropped findings

Repro. I used ./scripts/develop.sh with the docker starter template, whose metadata matches the ticket (CPU Usage, Memory Usage (Host), Load Average (Host)). I injected the WCAG spacing stylesheet after the first render and listed clipped elements. On main, five values were clipped (for example 23.3/147 GiB (16%): scrollWidth 157, width 122). On this branch, nothing is clipped. Default spacing renders the same widths on both.

Coverage. StaticWidth returns early under Storybook (process.env.STORYBOOK), and jsdom has no layout. That leaves an inline-style assertion with a stubbed getBoundingClientRect as the only possible test, and FE1 and FE10 discourage that. I verified in a real browser against the dev server instead.

Not changed. Values keep truncate max-w-64. Text longer than 256px is already cut off at default spacing, so that cap doesn't come from the spacing override. The stale-value branch renders StaticWidth under TooltipTrigger asChild, which replaces the ref, so the effect never pins that element. That's pre-existing and doesn't clip.

Accessibility audit (axe 4.11). The AgentMetadataView story shows a pre-existing color-contrast violation from the stale or disabled value color. This diff doesn't change it.

Dropped deep-review findings.

  • TN5 (nit), rename StaticWidth: dropped. The component still holds a value's width steady across updates, and a rename would add churn to a 5-line fix.

Branch name. I used a11y/text-spacing-cut-off-agent-metadata instead of ...-2, because off-2 would auto-link to an issue on Linear's OFF team.

Doc check. No docs describe metadata value widths, so no docs changes are needed.

🤖 Generated by Coder Agents on behalf of @chrifro.

@linear-code

linear-code Bot commented Nov 11, 2026

Copy link
Copy Markdown

DEQ-434

@chrifro
chrifro temporarily deployed to main November 11, 2026 14:57 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to main November 11, 2026 14:57 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to main November 11, 2026 15:00 — with GitHub Actions Inactive
@chrifro
chrifro marked this pull request as ready for review November 11, 2026 15:07
@chrifro
chrifro temporarily deployed to main November 11, 2026 15:07 — with GitHub Actions Inactive

@aqandrew aqandrew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice 👌🏽

@chrifro
chrifro merged commit d4f49f5 into main Nov 13, 2026
26 of 27 checks passed
@chrifro
chrifro deleted the a11y/text-spacing-cut-off-agent-metadata branch November 13, 2026 08:53
@chrifro
chrifro temporarily deployed to main November 13, 2026 08:54 — with GitHub Actions Inactive
@chrifro
chrifro temporarily deployed to docs-preview November 13, 2026 08:54 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026

This branch was previously deployed

2 inactive deployments
main — 5f54c0aa Deployed Nov 13, 2026 by chrifro via cla #256005
docs-preview — 5f54c0aa Deployed Nov 13, 2026 by chrifro via cleanup #21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants