fix(web): restore composer controls as space becomes available#9539

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

The one-pixel margin added in #9482 can keep every previously overflowed control hidden when only the last control still needs more room. For example, with two blocks hidden, a 357px host can restore the traits block even though restoring both blocks has not earned the extra pixel of slack.

Try the intermediate layouts before retaining the previous hidden count. This preserves the anti-oscillation margin while restoring each control that fits.

Verification:

  • 31 composer layout tests pass, including partial restoration, exact-threshold retention, and restoration after earning one pixel of slack.
  • Web typecheck and targeted lint pass.
  • Integrated browser verification and before/after evidence have not been performed.

This changes the resting composer in web and desktop, including mobile-width web layouts. Native mobile, providers, and wire contracts are unchanged.

Implemented with Codex through T3 Code.


Note

Low Risk Localized layout hysteresis logic for the resting composer footer with added regression tests; no auth, data, or API changes.

Overview Fixes resting composer footer controls staying fully overflowed when only the last block still needs the 1px anti-oscillation slack.

resolveRestingComposerControlsLayout no longer snaps back to the previous hiddenCount in one step when shrinking the overflow menu. It now walks hiddenCount upward until the layout fits within hostWidth - RESTING_CONTROLS_SLACK_PX or matches the prior hidden count, so controls that fit (e.g. one of two blocks at 357px) come back inline while the rest stay in overflow until there is slack.

New hysteresis tests cover partial restoration, exact-threshold retention, and stability across re-layout passes.

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

Note

Fix resolveRestingComposerControlsLayout to restore composer controls one block at a time

  • Replaces the single-step hysteresis fallback with a loop that advances the hidden count one block at a time until the candidate layout fits with the configured slack.
  • Previously, when controls were hidden and the fully restored candidate lacked slack, the resolver reverted to the previous hidden count. Now it retains the greatest number of restored blocks that fit.
  • Adds tests for partial multi-block restoration, stability at the same width, and the one-pixel slack boundary at the minimum threshold.
  • Risk: resolveRestingComposerControlsLayout in composerFooterLayout.ts changes restoration behavior; layouts that relied on all-or-nothing restoration may now show partially restored controls.

Macroscope summarized 4268800.

Added 1 commit

  • fix(web): restore composer controls as space becomes available4268800
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.6 KiB13.7 KiB+161 B (+1.2%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB+1 B (+0.0%)7.3 KiB✅
CodexLive turn WebSocket wire6.6 KiB6.7 KiB+160 B (+2.4%)7.8 KiB✅
CodexLive turn WebSocket decoded57.1 KiB58.5 KiB+1.4 KiB (+2.5%)66.4 KiB✅
CodexLive turn messages10100 (0.0%)21✅
ClaudeTotal thread wire13.5 KiB13.8 KiB+246 B (+1.8%)15.1 KiB✅
ClaudeThread snapshot wire7.0 KiB7.0 KiB−1 B (−0.0%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.5 KiB6.7 KiB+247 B (+3.7%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.8 KiB59.3 KiB+1.5 KiB (+2.6%)66.4 KiB✅
ClaudeLive turn messages810+2 (+25.0%)21✅

Baseline: 07c4ab5 · PR result: 4268800 · 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 4268800

Macroscope's review found this PR approvable — This is a focused composer layout fix that changes only inline-versus-overflow control restoration while retaining the anti-oscillation margin. The resolver change is small, isolated, and covered by targeted threshold and stability tests.

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