Skip to content

feat: add dual-focus navigation with interactive action execution#27

Open
utkarsh232005 wants to merge 2 commits into
KDM-cli:mainfrom
utkarsh232005:feat/interactive-dashboard-actions
Open

feat: add dual-focus navigation with interactive action execution#27
utkarsh232005 wants to merge 2 commits into
KDM-cli:mainfrom
utkarsh232005:feat/interactive-dashboard-actions

Conversation

@utkarsh232005
Copy link
Copy Markdown
Member

@utkarsh232005 utkarsh232005 commented Jun 1, 2026

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

  1. state.rs:
    • Added FocusPane enum (Sidebar, Main).
    • Added focus and selected_action index to UiState.
    • Added helper methods for navigating actions and retrieving available actions for the current screen.
  2. dashboard.rs:
    • Added render_action_list widget helper that displays actions with focus-aware borders, keyboard hints, and visual active indicators.
    • Updated render_settings and render_deployments to split screens and include the new interactive action list.
    • Updated handle_key to support dual-focus navigation:
      • Tab / BackTab and Left / Right arrow keys switch focus between Sidebar and Main panel.
      • Up / Down arrows navigate the action list when the main panel is focused.
      • Enter key executes the selected action when the main panel is focused.
  3. palette.rs:
    • Added actions_for_screen helper to filter actions by screen.

Verification

  • Built with cargo build.
  • Ran unit tests with cargo test (all 130 tests pass).

- 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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@utkarsh232005, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 44902873-25ae-47c1-8e54-9427adda98ee

📥 Commits

Reviewing files that changed from the base of the PR and between 8e71a8e and 041e7bb.

📒 Files selected for processing (4)
  • src/ui/dashboard.rs
  • src/ui/mod.rs
  • src/ui/state.rs
  • src/ui/welcome.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 60.72423% with 141 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ui/dashboard.rs 28.75% 109 Missing ⚠️
src/ui/welcome.rs 91.00% 17 Missing ⚠️
src/ui/state.rs 11.76% 15 Missing ⚠️

📢 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
Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

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

See analysis details in CodeScene

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.

Comment thread src/ui/dashboard.rs
Comment on lines +120 to +131
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);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

❌ New issue: Code Duplication
The module contains 4 functions with similar structure: handle_down_key,handle_up_key,render_compose,render_helm

Suppress

Comment thread src/ui/welcome.rs
Comment on lines +337 to +351
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,
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

❌ New issue: Excess Number of Function Arguments
render_panel has 5 arguments, max arguments = 4

Suppress

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