Skip to content

fix(status-bar): fold agents into +N before status labels go icon-only - #23689

Merged
AmethystLiang merged 1 commit into
mainfrom
fix/status-bar-collapse-usage-first
Sep 28, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
fix/status-bar-collapse-usage-first

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​42 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​46 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26

ELI5

When the Orca window gets narrow, the status bar should fold extra agents into a small "+N" badge before it starts hiding the status labels on the right. It did the opposite: the labels (like "Update ready" or memory use) turned into bare icons first, while every agent stayed on screen and no badge appeared. Now the badge comes first.

What Changed

Before (v1.4.216, #23587): as the window narrowed, the bar stepped down in this order: full, then compact, then one percentage per agent, then right-side segments go icon-only and agents may collapse (both at once). Because both happened in one step, there was a width range (about 840 → 640px with a typical right side) where the status labels disappeared but every agent still fit, so no "+N" badge showed.

After: a new step sits between "one percentage per agent" and "icon-only segments". There, calm agents (under 80% used) fold into "+N" while the right side keeps its labels. Only when even the urgent agents plus "+N" don't fit do the segments go icon-only. At that point agents expand back into the room the icons free up.

Mechanism:

  • status-bar-usage-collapse.ts: measureUsageRow also reports pinnedWidth, the row's width with every calm chip folded into "+N".
  • status-bar-density.ts: each level now records { natural, fit }. natural is the width with every chip shown, and is still what detects content changes. A collapsing level is judged by fit (natural width with the usage row at pinnedWidth), so it counts as fitting whenever folding calm agents is enough. Non-collapsing levels use natural width as before.

Why

Status labels on the right (update ready, chats to resume, memory) are live signals with no other home in the bar. Agent usage that folds into "+N" stays one click away in the Usage popover, and the badge says how many are hidden and turns yellow or red if one of them is getting close to its limit. So usage should give way first. The alternative, keeping all agents and hiding status labels, loses information you can't recover without hovering each icon.

Linked Issue

N/A (follow-up to #23587, reported by a maintainer after v1.4.216)

Visual Proof

Before (#23587): at 800px the right side is already icon-only while all 5 agents are shown, with no badge:

before

After (busier right side; widths 880, 840, 720, 640, 600, 440): "+2", "+3", "+4" appear while the labels stay. At 600px the segments go icon-only and agents come back:

after

Width Agents Right side
880 all 5 labels
840 3 + +2 labels
720 2 + +3 labels
640 Cursor (92%) + +4 labels
600 3 + +2 icons
440 Cursor + +4 icons

Testing

  • I manually tested these changes locally: macOS dev build in the background, width sweep from 1200 to 320px in 40px steps with a busy right side (keep awake, update ready, pet, resources, ports, floating workspace) and 5 agents.
  • Automated tests added/updated: status-bar-density.test.ts now asserts that usage collapses before segments go icon-only, that a collapsing level fits by its collapsed width, and that a change in collapsed width alone doesn't clear the cached widths. All 58 status-bar test files (410 tests) pass. pnpm tc:web and the changed-code quality gate pass.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Renderer only; nothing platform-specific. No SSH/remote, mobile or wire impact.
  • Performance: same measure pass as before, plus one extra sum over chip widths.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

On narrow windows the right-side status labels (update ready, memory,
keep awake) went icon-only while every agent stayed in full, so the +N
badge never appeared until much narrower. Add a density level that
collapses calm agents into +N while the right side keeps its labels;
it fits by the width with urgent agents pinned, and only when even that
doesn't fit do the segments go icon-only.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

The status bar now measures both natural usage width and width with calm usage chips collapsed. Density selection uses each level’s fit width and adds a level that collapses usage chips before segments become icon-only. Width-recording tests cover changes to natural and fit widths.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 70407

Status labels may remain icon-only after agent usage becomes calm, even when the labels would fit. This is a bounded visual regression that can be fixed before merge or accepted for follow-up.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: folding agents into a "+N" badge before status labels become icon-only.
Description check ✅ Passed The description is complete and directly matches the implementation. It includes the user impact, mechanism, rationale, linked prior issue context, before-and-after visual proof, testing details, scop…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 05d5862d-2e53-4062-8127-3730e2924077

📥 Commits

Reviewing files that changed from the base of the PR and between 55aea85 and 70407f4.

📒 Files selected for processing (3)
  • src/renderer/src/components/status-bar/status-bar-density.test.ts
  • src/renderer/src/components/status-bar/status-bar-density.ts
  • src/renderer/src/components/status-bar/status-bar-usage-collapse.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • New density step — STATUS_BAR_DENSITY_LEVELS gains a 4th entry (collapseUsage with labels still shown) between "one percentage per agent" and the existing icon-only step, so usage folds into "+N" before right-side labels drop.
  • Collapsed width measurement — measureUsageRow reports pinnedWidth, the row width with every calm chip folded into "+N"; the always-rendered hidden "+N" chip makes this measurable before anything collapses.
  • Fit-vs-natural split — density levels now track { natural, fit }; fit drives the picker (so a level counts as fitting whenever folding calm agents suffices), while natural still detects content changes for cache invalidation. Non-collapsing levels set fit === natural, preserving prior behavior.
  • Tests — ordering assertion that collapse precedes icon-only, a picker case proving a collapsing level is judged by its collapsed width, and a cache case proving a moved collapsed width alone doesn't invalidate sibling levels.

The width math and the picker change hold up: pinnedWidth correctly removes calm chips plus their gaps and adds back the "+N" chip and one gap, fit remains monotonic across the ladder, and the picker returns the roomiest fitting level, so level 3 is only reached when level 2 genuinely overflows. pinnedWidth has no direct DOM-level test (the existing suite never exercises measureUsageRow), but the derived picker behavior it feeds is covered. No blocking concerns.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant