Add contextual help dialog (Ctrl+H)#2305
Merged
dgageot merged 14 commits intodocker:mainfrom Apr 1, 2026
Merged
Conversation
- Created new help dialog that displays all currently active key bindings - Help is contextual: shows different bindings based on focused panel - Bindings are automatically categorized into General, Control Key Shortcuts, and Other - Added Ctrl+? keybinding to open the help dialog - Dialog is scrollable for when there are many bindings - Inherits from readOnlyScrollDialog for consistent behavior Assisted-By: docker-agent
Assisted-By: docker-agent
- Shows 'Ctrl+? help' in the status bar so users know the help dialog exists - Makes the help feature more discoverable Assisted-By: docker-agent
- F1 is universally supported across all terminals - Ctrl+? still works as fallback for terminals with keyboard enhancements - Tested successfully in tmux - Updated documentation to reflect F1 as primary binding Assisted-By: docker-agent
- Documented all 9 test scenarios - Included visual examples showing context-aware behavior - Confirmed editor-specific vs content-specific bindings - No issues found - feature is production ready Assisted-By: docker-agent
- Ctrl+h is more mnemonic (h = help) and easier to type - F1 and Ctrl+? still work as alternatives - Updated status bar to show 'Ctrl+h help' - Tested successfully in tmux with all three key combinations - Updated documentation to reflect Ctrl+h as primary Assisted-By: docker-agent
- Updated test docker#1 to reflect Ctrl+h testing - Added test #1b for fallback keys (F1, Ctrl+?) - Updated dialog content display to highlight Ctrl+h - Updated status bar integration test Assisted-By: docker-agent
Previously the help dialog only showed bindings exposed in Bindings() method, which didn't include many global shortcuts that were actually available. Now includes: - Ctrl+y - toggle yolo mode - Ctrl+o - toggle hide tool results - Ctrl+s - cycle agent - Ctrl+m - model picker - Ctrl+x - clear queue - Ctrl+z - suspend - Ctrl+b - toggle sidebar (when not in lean mode) These shortcuts are all functional but weren't discoverable before. Assisted-By: docker-agent
Created two separate methods: - Bindings() - Returns curated subset for status bar (existing behavior) - AllBindings() - Returns comprehensive list for help dialog This way the help dialog shows ALL available shortcuts (Ctrl+y, Ctrl+o, Ctrl+s, Ctrl+m, Ctrl+x, Ctrl+z, Ctrl+b) while the status bar remains uncluttered and only shows the most essential commands. Fixes the issue where adding bindings to show in help would also crowd the status bar unnecessarily. Assisted-By: docker-agent
Now there's only ONE place where bindings are defined: - AllBindings() - Defines ALL available key bindings (single source of truth) - Bindings() - Filters AllBindings() to return only status bar keys Benefits: - DRY: No code duplication - Maintainability: Add new binding in one place, automatically appears in help - Curated status bar: Filter decides what shows in status bar - Single source of truth for all keyboard shortcuts The filter uses a whitelist map to determine which bindings should appear in the status bar vs only in the comprehensive help dialog. Assisted-By: docker-agent
Added up/down/c/e/d keys to the status bar whitelist so that content panel navigation bindings (↑↓ select prev/next, c copy, e edit, d delete) appear in the status bar when in content context. This restores the original behavior where chatPage.Bindings() were always included in the status bar when the content panel is focused. Assisted-By: docker-agent
Kept the original keyboard shortcuts table and just added a note that Ctrl+H shows the complete list. Assisted-By: docker-agent
- Add blank line after embedded field (embeddedstructfieldcheck) - Use switch instead of if-else chain (gocritic) - Combine append chains (gocritic) - Fix variable shadowing of 'key' import (gocritic) - Remove nil check that's always true (staticcheck) - Remove unused width parameter (unparam) - Fix imports formatting (gci) Assisted-By: docker-agent
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dgageot
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a contextual help dialog accessible via Ctrl+H (or F1/Ctrl+?) that displays all available keyboard shortcuts.
Features
Key Changes
pkg/tui/dialog/help.go)AllBindings()method)Testing
Tested in tmux with multiple terminal widths. All contextual bindings display correctly based on panel focus.