Repository navigation
fix(status-bar): re-measure collapsing levels when only the collapsed width moves - #23773
Merged
Merged
Conversation
Contributor
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
|
1 task done
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

ELI5
When the bar is tight, calm usage chips fold into a "+N" chip. The bar remembers how wide each layout was so it can pick the roomiest one that fits. If a provider stopped being urgent, that remembered width could go stale, and the bar stayed icon-only even though the labels would fit again.
What Changed
Before: after a usage provider went from urgent back to calm, the status bar could stay in its tightest, icon-only layout even with room for labels.
After: it steps back up to the labelled layout as soon as that fits.
Mechanism:
recordStatusBarDensityWidthcaches two widths per density level — the full ("natural") width and the "fit" width with calm chips folded into "+N". The cache was cleared only when the natural width changed. Urgency changes which chips stay pinned, which moves the fit width without touching the natural width. Now, when only the fit width moves, the other collapsing levels' cached widths are dropped so they get re-measured. Non-collapsing levels keep their cache, since their fit always equals their natural width.Why
Follow-up to review feedback on #23689 (CodeRabbit). Dropping only the collapsing levels avoids re-probing every level on each urgency flip, while still guaranteeing the picker never compares against a stale fit width.
Linked Issue
Follow-up to #23689
Visual Proof
N/A — edge-case fix in width-cache invalidation; covered by a unit test.
Testing
status-bar-density.test.tsnow covers a fit-only change on a collapsing level.pnpm tc:weband oxlint are clean.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Renderer-only, pure function change. No platform, SSH, or wire impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)