Repository navigation
Keep usage overflow chip width stable as hidden count changes - #26873
Conversation
The "+N" overflow chip in the status bar changed width whenever its count changed, so the density probe that decides how many usage chips fit kept re-measuring. Reserve the width of the provider-count label with an invisible sizer span, so the chip keeps the same size across counts. - Pass the total provider count into UsageOverflowChip and render it in an invisible, grid-stacked sizer span. - Overlay the visible "+N" label on the same grid cell so the chip width tracks the total, not the hidden subset. - Add an e2e test that loads ten usage providers, shrinks the viewport to collapse them, and checks the chip width stays stable and no "Maximum update depth" or React #185 errors occur.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughUsageOverflowChip now receives the total provider count and uses it to reserve badge width. Its visible count remains based on the number of hidden providers. A new end-to-end test checks status-bar density at viewport widths from 180 to 1800 pixels. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established. Run the new end-to-end test during normal validation. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)✅ Passed checks (3 passed)Full details: Description checkExplanation The description explains the problem, solution, mechanism, and scope. However, it is largely incomplete against the required template: it lacks an ELI5 section, provides no linked issue, leaves visual proof and testing as TODO, leaves AI disclosure unresolved, and does not complete the review, notes, and checklist sections. Resolution Add the required ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Notes, and Checklist information. Provide the actual issue link, attach before-and-after UI evidence or explain why it is not needed, document completed tests and platforms, and replace all TODO markers with confirmed details.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
Problem
The status bar has a small badge that says how many usage meters are hidden, like "+3". When the window is narrow, the bar keeps measuring itself to decide what fits. The badge changed width each time its number changed (for example "+9" to "+10"). That width change made the bar re-measure, which could restart the fitting process and cause repeated layout updates.
Solution
The badge now reserves room for the largest count it can show. It draws an invisible copy of the total provider count on the same grid cell as the visible number, so its width stays the same as the hidden count changes. The visible number is unchanged. This is a partial fix: it covers the badge width change, and the e2e test added here covers the narrow-to-wide resize path. I have not confirmed it removes every source of the resize loop.
Mechanism
UsageOverflowChiptakes a newproviderCountprop.StatusBarSurfacepasses the roster length.inline-flextoinline-grid. The hidden placeholder and the visible text share cell1/1, so the grid sizes to the placeholder.tests/e2e/status-bar-density-overflow.spec.ts, loads 10 providers, resizes from wide to narrow to wide, checks the badge width stays fixed, and fails on React "Maximum update depth" or error fix: improve scrollbar and file explorer scroll behavior #185.Why This Approach
A fixed pixel width would look wrong at larger counts and would not follow the text size. Reserving the widest text with an invisible copy keeps the existing style and needs no measurement.
Testing
Visual Proof
TODO: attach before/after screenshots or a video of the status bar at narrow and wide widths.
Linked Issue
None linked. TODO.
AI Disclosure
TODO
Review
Agent skill upstream boundary
Notes
Checked against security, cross-platform, remote SSH, mobile, backwards compatibility, and performance: TODO. No remote wire or persisted data changes are in this diff.
Checklist
pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass: TODO