Skip to content

feat: add keyboard shortcuts help panel and context-sensitive hints#41

Merged
cnjack merged 1 commit intomainfrom
feat/help-message
Apr 24, 2026
Merged

feat: add keyboard shortcuts help panel and context-sensitive hints#41
cnjack merged 1 commit intomainfrom
feat/help-message

Conversation

@cnjack
Copy link
Copy Markdown
Owner

@cnjack cnjack commented Apr 24, 2026

Summary by CodeRabbit

  • New Features
    • Added help panel with keyboard shortcuts cheat sheet, accessible via /help command or f1 key.
    • Keyboard shortcut hints now display at the bottom of the input area, adapting to current context.
    • Version number now displays in the interface.
    • Help panel supports scrolling and adapts to narrow terminals.

Co-authored-by: Copilot <copilot@github.com>
@cnjack cnjack merged commit a2e666e into main Apr 24, 2026
1 check was pending
@cnjack cnjack deleted the feat/help-message branch April 24, 2026 17:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a78d253-11f8-4218-b191-7b9a840f81a4

📥 Commits

Reviewing files that changed from the base of the PR and between 8d46ac4 and 4823293.

📒 Files selected for processing (5)
  • internal/command/interactive.go
  • internal/tui/input_views.go
  • internal/tui/pickers.go
  • internal/tui/team_view.go
  • internal/tui/tui.go

📝 Walkthrough

Walkthrough

This PR adds a help panel overlay to the TUI displaying keyboard shortcuts, controlled via f1 key or /help command. It includes version display in the input hint bar and refactors content width calculations for consistent layout when the sidebar is visible.

Changes

Cohort / File(s) Summary
Help Panel Display
internal/tui/pickers.go
Introduces helpPanelView() method that renders a keyboard shortcuts cheat sheet in a two-column layout (with single-column fallback), styled with borders, scroll bounds checking, and scroll indicators in the footer.
Help Panel Control & State Management
internal/tui/tui.go
Implements help panel overlay state (showingHelp, helpScroll), adds keyboard handling in Update() for toggling (f1, /help) and scrolling, refactors with contentWidth() helper for consistent layout, adds WithVersion() option, and prioritizes help panel rendering in View().
Input Area & Commands
internal/tui/input_views.go
Adds /help to slash-command suggestions, implements shortcutHints() method that renders hint bar with core shortcuts, conditional context-aware hints based on team/conversation state, and right-aligned version string.
Configuration & Version Integration
internal/command/interactive.go
Passes tui.WithVersion(Version) option to TUI configuration during initialization.
Minor Formatting
internal/tui/team_view.go
Removes extra empty line before keybinding hints in coordinator panel for tighter layout.

Sequence Diagram

sequenceDiagram
    actor User
    participant Update as Update Handler
    participant Model as Model State
    participant View as View Renderer
    participant HelpPanel as Help Panel View

    User->>Update: Press f1 or type /help
    Update->>Model: Check key & toggle showingHelp
    Model->>Model: Set showingHelp = true<br/>Reset helpScroll = 0
    User->>Update: Press arrow keys (while help open)
    Update->>Model: Update helpScroll based on key
    Model->>Model: Clamp scroll to valid bounds
    View->>Model: Check if showingHelp
    alt Help Panel Active
        View->>HelpPanel: Render helpPanelView()
        HelpPanel->>HelpPanel: Build shortcuts in columns<br/>Calculate available height<br/>Slice lines for current scroll
        HelpPanel->>View: Return formatted panel
        View->>User: Display centered help panel overlay
    else Help Panel Inactive
        View->>User: Render normal TUI
    end
    User->>Update: Press Escape or f1 again
    Update->>Model: Set showingHelp = false
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A help panel hops into view,
With shortcuts and hints, oh what's new!
Press f1, see the scene,
Keyboard magic on your screen,
Version gleams at journey's due. ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/help-message

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.

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