Repository navigation
Keep TUI tab bars visible at minimum pane heights - #8765
Conversation
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughPane layout sizing now preserves nested tab bars during split resizing, reserves tab-bar rows in tiny panes, and hides terminal content when no content height remains. Tests cover nested ratio clamping, dragging, and tiny-pane rendering. ChangesTab-bar-aware pane sizing
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmux-tui/crates/cmux-tui/src/app.rs`:
- Around line 3134-3200: The resize path repeatedly traverses the layout tree
and recomputes split minimum heights for every drag sample. Build and retain a
SplitId-to-(u16, u16) minimum-height index whenever the screen layout changes,
then update clamp_split_ratio_for_tab_bars and its callers to use the cached
lookup in O(1) during resizing while preserving the existing ratio clamping
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f5827666-037e-4c05-88e3-a52574ede19e
📒 Files selected for processing (1)
cmux-tui/crates/cmux-tui/src/app.rs
Greptile SummaryThis PR fixes tab bars disappearing when panes are resized to very small heights in the cmux TUI. It adds ratio-aware minimum height clamping for vertical splits and a fallback rendering path for 1–2 row panes.
Confidence Score: 5/5Safe to merge. The change is narrowly scoped to resize clamping and fallback rendering for small panes; it cannot corrupt session or layout state. The binary search in minimum_split_height is mathematically sound — the lower bound first_minimum + second_minimum is provably ≤ the true minimum, fits(u16::MAX) is validated before the loop, and the monotone fits predicate guarantees convergence. clamp_ratio_to_minimum_heights correctly returns None for infeasible ranges and the two-tier fallback (full → bar_only) is well-reasoned. The pane_parts_for_rect new branch only fires for height 1–2, where the omnibar path already short-circuits. The four new regression tests cover nested drag extremes, ancestor ratio constraints, bar-only fallback, and tiny-pane rendering. No correctness issues found. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User drags / keyboard resize] --> B[resize_split / set_split_ratio]
B --> C[clamp_split_ratio_for_tab_bars]
C --> D{vertical split?}
D -- No --> E[return 0.05-0.95 clamp]
D -- Yes --> F[vertical_split_minimum_heights]
F --> G[minimum_tabbed_height per child subtree]
G --> H{Down split?}
H -- Yes --> I[minimum_split_height binary search]
H -- No / Leaf --> J[fixed constants: full=3, bar_only=1]
I --> K[clamp_ratio_to_minimum_heights full minimums]
J --> K
K --> L{feasible?}
L -- Yes --> M[return clamped ratio]
L -- No --> N[clamp_ratio_to_minimum_heights bar_only minimums]
N --> O{feasible?}
O -- Yes --> M
O -- No --> E
M --> P[session.set_split_ratio]
P --> Q[pane_parts_for_rect]
Q --> R{height > 2?}
R -- Yes --> S[full box: bar + content + scrollbar]
R -- No, height > 0 and width > 2 --> T[tiny pane: bar row 0, content height=0]
R -- No --> U[no bar: full rect as content]
Reviews (3): Last reviewed commit: "fix(tui): preserve bars under infeasible..." | Re-trigger Greptile |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Summary
Verification
cargo test -p cmux-tui -- --test-threads=1(435 unit tests and 8 CLI integration tests)cargo clippy -p cmux-tui --all-targets -- -D warningscargo fmt --all -- --checkThe first commit contains the regressions without the fix; the second commit implements the behavior.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Keep TUI tab bars visible when panes hit minimum heights. Vertical resizing now clamps ratios with subtree-aware minimums, and falls back to bar-only when full minima aren’t possible.
cmux-tui; regression tests cover constrained panes, nested drags, and fallback behavior.Written for commit 2113517. Summary will update on new commits.
Summary by CodeRabbit