feat(tui): implement help panel (F1) with context-sensitive help #1013

Closed
opened 2026-03-17 01:11:15 +00:00 by brent.edwards · 1 comment
Member

Help panel accessible via F1, context-sensitive to current screen/mode.

Dependencies

  • Parent: #868 (Epic: TUI Interface)
  • Tracked by: #926
Help panel accessible via F1, context-sensitive to current screen/mode. ## Dependencies - Parent: #868 (Epic: TUI Interface) - Tracked by: #926
brent.edwards added this to the v3.8.0 milestone 2026-03-17 01:12:06 +00:00
Author
Member

Implemented in PR #1250.

Design and implementation notes:

  • Added a dedicated help overlay widget at src/cleveragents/tui/widgets/help_panel_overlay.py.
  • The widget owns three concerns:
    • resolving the active help context from the current prompt text
    • rendering the help panel content for that context
    • toggling visibility for F1
  • I kept the implementation intentionally small and aligned with the currently implemented TUI surface rather than trying to model future screens that do not exist yet.

Help contexts implemented:

  • Main Screen
  • Slash Commands
  • Reference Picker
  • Shell Mode

Context resolution rules:

  • prompt starts with / -> Slash Commands
  • prompt starts with ! or $ -> Shell Mode
  • prompt contains @ -> Reference Picker
  • otherwise -> Main Screen

App integration notes:

  • Updated src/cleveragents/tui/app.py so action_help() now toggles the HelpPanelOverlay instead of overwriting the conversation panel.
  • The help panel is added to the main widget tree and hidden on mount.
  • Repeated F1 on the same context hides the panel again; changing the prompt mode and pressing F1 re-renders the panel for the new context.
  • The conversation panel behavior for prompt, command, and shell output was left unchanged. This ticket only replaces the old one-line help message path with the overlay.

Presentation notes:

  • Added #help-panel styling in src/cleveragents/tui/cleveragents.tcss so the help content displays as a distinct overlay panel.

Test coverage notes:

  • Added features/tui_help_panel_overlay_coverage.feature and features/steps/tui_help_panel_overlay_coverage_steps.py to cover:
    • help-context resolution
    • help-panel rendering
    • help-panel toggle/hide behavior
  • Expanded features/tui_app_coverage.feature and features/steps/tui_app_coverage_steps.py to cover:
    • help panel hidden on mount
    • main-screen help content
    • slash-command help context
    • shell-mode help context
    • toggle-off behavior on repeated F1
  • Added Robot smoke coverage in robot/tui_smoke.robot for help-panel context switching using the mocked-Textual app harness.
  • Updated the changelog for the new help-panel behavior.

Validation run:

  • nox -s lint typecheck unit_tests -- features/tui_help_panel_overlay_coverage.feature features/tui_app_coverage.feature
    • saved log: /tmp/issue-1013-targeted-nox.log
  • PYTHONPATH=src NO_COLOR=1 .nox/unit_tests-3-13/bin/robot --outputdir build/reports/robot-smoke --variable PYTHON:/tmp/issue-1013/.nox/unit_tests-3-13/bin/python robot/tui_smoke.robot
    • saved log: /tmp/issue-1013-robot.log
  • nox -s coverage_report
    • saved log: /tmp/issue-1013-coverage.log
    • result: COVERAGE OK: 98.7% (threshold: 97%)
  • nox -s integration_tests e2e_tests
    • saved log: /tmp/issue-1013-integration-e2e.log
    • results:
      • Session integration_tests-3.13 was successful in 28 minutes.
      • Session e2e_tests-3.13 was successful in 21 minutes.

Traceability:

  • Commit: 0ae733d0 (feat(tui): implement help panel (F1) with context-sensitive help)
Implemented in PR #1250. Design and implementation notes: - Added a dedicated help overlay widget at `src/cleveragents/tui/widgets/help_panel_overlay.py`. - The widget owns three concerns: - resolving the active help context from the current prompt text - rendering the help panel content for that context - toggling visibility for `F1` - I kept the implementation intentionally small and aligned with the currently implemented TUI surface rather than trying to model future screens that do not exist yet. Help contexts implemented: - `Main Screen` - `Slash Commands` - `Reference Picker` - `Shell Mode` Context resolution rules: - prompt starts with `/` -> `Slash Commands` - prompt starts with `!` or `$` -> `Shell Mode` - prompt contains `@` -> `Reference Picker` - otherwise -> `Main Screen` App integration notes: - Updated `src/cleveragents/tui/app.py` so `action_help()` now toggles the `HelpPanelOverlay` instead of overwriting the conversation panel. - The help panel is added to the main widget tree and hidden on mount. - Repeated `F1` on the same context hides the panel again; changing the prompt mode and pressing `F1` re-renders the panel for the new context. - The conversation panel behavior for prompt, command, and shell output was left unchanged. This ticket only replaces the old one-line help message path with the overlay. Presentation notes: - Added `#help-panel` styling in `src/cleveragents/tui/cleveragents.tcss` so the help content displays as a distinct overlay panel. Test coverage notes: - Added `features/tui_help_panel_overlay_coverage.feature` and `features/steps/tui_help_panel_overlay_coverage_steps.py` to cover: - help-context resolution - help-panel rendering - help-panel toggle/hide behavior - Expanded `features/tui_app_coverage.feature` and `features/steps/tui_app_coverage_steps.py` to cover: - help panel hidden on mount - main-screen help content - slash-command help context - shell-mode help context - toggle-off behavior on repeated `F1` - Added Robot smoke coverage in `robot/tui_smoke.robot` for help-panel context switching using the mocked-Textual app harness. - Updated the changelog for the new help-panel behavior. Validation run: - `nox -s lint typecheck unit_tests -- features/tui_help_panel_overlay_coverage.feature features/tui_app_coverage.feature` - saved log: `/tmp/issue-1013-targeted-nox.log` - `PYTHONPATH=src NO_COLOR=1 .nox/unit_tests-3-13/bin/robot --outputdir build/reports/robot-smoke --variable PYTHON:/tmp/issue-1013/.nox/unit_tests-3-13/bin/python robot/tui_smoke.robot` - saved log: `/tmp/issue-1013-robot.log` - `nox -s coverage_report` - saved log: `/tmp/issue-1013-coverage.log` - result: `COVERAGE OK: 98.7% (threshold: 97%)` - `nox -s integration_tests e2e_tests` - saved log: `/tmp/issue-1013-integration-e2e.log` - results: - `Session integration_tests-3.13 was successful in 28 minutes.` - `Session e2e_tests-3.13 was successful in 21 minutes.` Traceability: - Commit: `0ae733d0` (`feat(tui): implement help panel (F1) with context-sensitive help`)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#1013
No description provided.