Repository navigation
Group cmux TUI context menu actions - #8225
Conversation
📝 WalkthroughWalkthroughContext menus now use grouped action lists with separator rows. Construction, rendering, mouse activation, keyboard navigation, documentation, unit tests, and smoke tests were updated for the new menu layout. ChangesGrouped context menu flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant ContextMenu
participant Overlay
User->>App: Open pane context menu
App->>App: Build grouped pane actions
App->>ContextMenu: Create grouped menu rows
ContextMenu-->>Overlay: Provide MenuItem rows
Overlay-->>User: Render actions and separators
User->>App: Select or activate a row
App->>ContextMenu: Resolve actionable item
ContextMenu-->>App: MenuAction or no action
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 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 |
Greptile SummaryThis PR groups the cmux TUI right-click context menu into labelled sections (current-tab, creation, browser, pane-layout, and IDs) separated by non-interactive
Confidence Score: 5/5Safe to merge — purely additive UI grouping in the Rust TUI crate with no shared state, no new unsafe code, and no cross-language interfaces touched. Every separator-skipping path (keyboard, mouse press, mouse drag-release, Enter key) correctly guards against activating a separator. fit_to_rows is idempotent under repeated frame calls and correctly preserves the selected action across resize. The smoke test coordinates were updated consistently with the new layout and the inline unit tests cover the key navigation edge cases including out-of-bounds sentinel values. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Keep grouped TUI menus visible" | Re-trigger Greptile |
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 1702-1718: Update select_previous and select_next to obtain their
sliced ranges through self.items.get(...) before iterating, so empty menus or
out-of-range selected indices produce no match instead of panicking. Preserve
the existing selection movement behavior for valid ranges.
🪄 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
Run ID: fb68c140-48a0-43ef-bfaf-8fd27422811e
📒 Files selected for processing (4)
cmux-tui/crates/cmux-tui/src/app.rscmux-tui/crates/cmux-tui/src/ui/overlay.rscmux-tui/docs/mouse.mdcmux-tui/scripts/smoke-tui.py
Summary
Testing
Scope
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Grouped context-menu actions in
cmux-tuiinto sections with visible, non-clickable separators. When space is tight, the menu drops only extra separators so all actions remain visible.New Features
├─┤; Up/Down and hit-testing skip them; Enter and clicks only activate actions.Refactors
MenuItem;ContextMenunow holdsVec<MenuItem>and builds from grouped actions.pane_context_menu_groups(...), selection helpers that skip separators, andfit_to_rows(...)to manage separator collapse and bounds-safe selection.Written for commit 40abcbf. Summary will update on new commits.
Summary by CodeRabbit