Repository navigation
fix(site/src/modules/resources): let agent metadata values grow with text spacing - #32055
Merged
Merged
Conversation
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.
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.
StaticWidthmeasures each value once and then pinned that measurement as a fixedwidthin 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 setsminWidthinstead. Values still never shrink, so there is no jitter between updates, but they can grow when spacing changes.Closes DEQ-434
Verification, decisions, and dropped findings
Repro. I used
./scripts/develop.shwith thedockerstarter 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 example23.3/147 GiB (16%): scrollWidth 157, width 122). On this branch, nothing is clipped. Default spacing renders the same widths on both.Coverage.
StaticWidthreturns early under Storybook (process.env.STORYBOOK), and jsdom has no layout. That leaves an inline-style assertion with a stubbedgetBoundingClientRectas 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 rendersStaticWidthunderTooltipTrigger 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
AgentMetadataViewstory shows a pre-existingcolor-contrastviolation from the stale or disabled value color. This diff doesn't change it.Dropped deep-review findings.
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-metadatainstead of...-2, becauseoff-2would 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.