fix(web): measure collapsed model labels at their visible width#9540

merged1
composer-followups/partial-restore
composer-followups/hidden-label-width
openedSep 4, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 3d ago

At narrow composer widths, the model label deliberately collapses to zero width with flex-none. Measurement still adds the label's scrollWidth, reserving space for text that will not be shown and moving other controls into overflow too early.

Do not recover the text width of a deliberately collapsed label. Keep recovering the natural width of flexible labels, even when they have been squeezed to zero, and retain the picker's maximum-width cap.

Verification:

  • Four new measurement tests pass. With a collapsed label, a 52px picker and 140px mode block fit a 200px host with the 4px gap, instead of overflowing.
  • All 35 measurement and composer layout tests pass together.
  • Web typecheck and targeted lint pass.
  • Integrated browser verification and before/after evidence have not been performed.

Stacked on #9539. This changes shared web/desktop rendering, not native mobile or provider behavior.

Implemented with Codex through T3 Code.

Note

Fix providerModelPickerNaturalWidth to measure collapsed model labels at visible width

  • providerModelPickerNaturalWidth now treats a label as intentionally collapsed only when both its client width and computed flex growth are zero. Zero-width labels with flexible growth now recover their scroll-width overflow for natural-width calculations.
  • Previously every zero-width model label was treated as collapsed, so flexible labels squeezed to zero contributed no width even though their text was still present.
  • Adds a test suite covering collapsed labels, flexible truncated labels, flexible zero-width labels, and the existing 180-pixel picker maximum-width cap.
  • Risk: labels that are zero-width with non-zero flex growth now contribute recovered text width to picker sizing, which may change layout in narrow composer widths where labels were previously ignored.

Macroscope summarized 8309a40.


Note

Low Risk Localized DOM measurement logic for composer footer layout; behavior change only affects when controls move to overflow at narrow widths.

Overview Fixes resting composer control measurement so narrow layouts no longer reserve space for model label text that is intentionally hidden.

providerModelPickerNaturalWidth now treats a label with zero width and flex-grow: 0 as deliberately collapsed and does not add scrollWidth − clientWidth to the picker’s natural width. Flexible labels (flex-grow not 0) still get truncated text recovered when squeezed, including when clientWidth is 0, and the picker max-width cap is unchanged.

Adds four unit tests for collapsed vs flexible labels, overflow layout at a 200px host, and the max-width ceiling.

Reviewed by Cursor Bugbot for commit 8309a40d3aa36566409fcbfba2909a88fc11fe42. Bugbot is set up for automated code reviews on this repo. Configure here.

Added 1 commit

  • fix(web): measure collapsed model labels at their visible width8309a40
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire—13.6 KiB—15.1 KiB✅
CodexThread snapshot wire—7.0 KiB—7.3 KiB✅
CodexLive turn WebSocket wire—6.6 KiB—7.8 KiB✅
CodexLive turn WebSocket decoded—57.1 KiB—66.4 KiB✅
CodexLive turn messages—10—21✅
ClaudeTotal thread wire—13.8 KiB—15.1 KiB✅
ClaudeThread snapshot wire—7.0 KiB—7.3 KiB✅
ClaudeLive turn WebSocket wire—6.7 KiB—7.8 KiB✅
ClaudeLive turn WebSocket decoded—59.3 KiB—66.4 KiB✅
ClaudeLive turn messages—10—21✅

Baseline: unavailable · PR result: 8309a40 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Approved at 8309a40

Macroscope's review found this PR approvable — This is a narrowly scoped web layout bug fix that adjusts composer width measurement and adds focused regression tests. Its runtime impact is limited to responsive control placement, with no product-default, infrastructure, security, billing, or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.