feat: add dual-focus navigation with interactive action execution#27
feat: add dual-focus navigation with interactive action execution#27utkarsh232005 wants to merge 2 commits into
Conversation
- Add FocusPane enum (Sidebar/Main) and selected_action index to UiState - Tab/BackTab toggles focus between sidebar and main panel - Left/Right arrows switch focus for discoverability - Up/Down navigates action list when main panel is focused - Enter executes selected action when main panel is focused - All 8 screens now render selectable action lists via render_action_list() - Visual focus indicators: accent borders, dot marker on focused pane title - Selected actions highlighted with triangle marker and bold accent style - Disabled actions shown with muted style and '(unavailable)' suffix - Action selection resets when switching screens via sidebar Fixes: Dashboard and screen actions were previously static text with no way to select or execute them from the UI. Users had to use Ctrl+P command palette or keyboard shortcuts as the only way to run actions.
|
Warning Review limit reached
More reviews will be available in 24 minutes and 21 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Move welcome and scanning phase screens to new welcome.rs module - Introduce render_capability_screen to remove duplication across 5 layouts - Simplify run_loop key handler by extracting logic and sub-helpers - Simplify render_action_list by splitting into 3 specific layout helpers
There was a problem hiding this comment.
Gates Failed
Prevent hotspot decline
(1 hotspot with Code Duplication)
New code is healthy
(1 new file with code health below 10.00)
Our agent can fix these. Install it.
Gates Passed
1 Quality Gates Passed
Reason for failure
| Prevent hotspot decline | Violations | Code Health Impact | |
|---|---|---|---|
| dashboard.rs | 1 rule in this hotspot | 8.68 → 8.41 | Suppress |
| New code is healthy | Violations | Code Health Impact | |
|---|---|---|---|
| welcome.rs | 1 rule | 9.69 | Suppress |
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
| fn handle_down_key(state: &mut AppState) { | ||
| state.ui.clear_execution_output(); | ||
| match state.ui.focus { | ||
| FocusPane::Sidebar => navigation::move_next(state), | ||
| FocusPane::Main => { | ||
| let total = state | ||
| .ui | ||
| .screen_actions(&state.actions, state.current_screen) | ||
| .len(); | ||
| state.ui.move_action_next(total); | ||
| } | ||
| } |
There was a problem hiding this comment.
❌ New issue: Code Duplication
The module contains 4 functions with similar structure: handle_down_key,handle_up_key,render_compose,render_helm
| fn render_panel( | ||
| frame: &mut Frame, | ||
| area: Rect, | ||
| title: &str, | ||
| content: String, | ||
| palette: theme::Palette, | ||
| ) { | ||
| frame.render_widget( | ||
| Paragraph::new(content) | ||
| .wrap(Wrap { trim: false }) | ||
| .block(Block::default().title(title).borders(Borders::ALL)) | ||
| .style(Style::default().fg(palette.text).bg(palette.background)), | ||
| area, | ||
| ); | ||
| } |
There was a problem hiding this comment.
❌ New issue: Excess Number of Function Arguments
render_panel has 5 arguments, max arguments = 4
Summary
Fixes the issue where actions on the Dashboard (and all other screens) were rendered as static text with no way to select or execute them.
Changes
FocusPaneenum (Sidebar, Main).focusandselected_actionindex toUiState.render_action_listwidget helper that displays actions with focus-aware borders, keyboard hints, and visual active indicators.render_settingsandrender_deploymentsto split screens and include the new interactive action list.handle_keyto support dual-focus navigation:Tab/BackTabandLeft/Rightarrow keys switch focus between Sidebar and Main panel.Up/Downarrows navigate the action list when the main panel is focused.Enterkey executes the selected action when the main panel is focused.actions_for_screenhelper to filter actions by screen.Verification
cargo build.cargo test(all 130 tests pass).