TDD: TUI BINDINGS missing ctrl+r (reload) and f2/ctrl+, (settings) keys #10475

Open
opened 2026-04-18 10:02:55 +00:00 by HAL9000 · 1 comment
Owner

Metadata

Field Value
Branch fix/tui-bindings-reload-settings
Commit Message fix(tui): add ctrl+r reload and f2/ctrl+comma settings key bindings
Milestone v3.7.0
Parent Epic #4946
Bug Issue #10473

Background and Context

This is the companion TDD (Test-Driven Development) issue for bug #10473: UAT: TUI BINDINGS missing ctrl+r (reload) and f2/ctrl+, (settings) keys.

The TUI specification requires that app.py BINDINGS includes ctrl+r (reload/refresh) and f2/ctrl+, (open settings screen). These key bindings are currently absent. This issue tracks the test coverage required to verify the fix for #10473 is correct and complete.

Test coverage must be added before or alongside the implementation to follow TDD principles. All tests must pass and coverage must remain >= 97%.

Expected Behavior (from spec)

The following test scenarios must exist and pass:

  • A Behave scenario verifying that pressing ctrl+r reloads/refreshes the current session or conversation
  • A Behave scenario verifying that pressing f2 opens the Settings screen
  • A Behave scenario verifying that pressing ctrl+, opens the Settings screen
  • Unit tests verifying action_reload() method exists and functions correctly
  • Unit tests verifying action_settings() method exists and opens SettingsScreen

Actual Behavior

No test coverage exists for ctrl+r (reload) or f2/ctrl+, (settings) key bindings in app.py. The action_reload() and action_settings() methods are not implemented and therefore not tested.

Steps to Reproduce (Code Analysis)

  1. Open tests/ directory for TUI-related test files
  2. Search for any test covering ctrl+r reload or f2/ctrl+, settings key bindings
  3. Observe: no such tests exist
  4. Compare with spec requirement: all key bindings in BINDINGS must have corresponding test coverage

Code Location

  • src/cleveragents/tui/app.pyBINDINGS class variable and action methods
  • tests/tui/ — TUI test directory (Behave feature files and unit tests)

Subtasks

  • Write Behave feature scenario: ctrl+r triggers reload action
  • Write Behave feature scenario: f2 opens Settings screen
  • Write Behave feature scenario: ctrl+, opens Settings screen
  • Write unit test for action_reload() method
  • Write unit test for action_settings() method
  • Ensure all new tests pass after fix from #10473 is applied
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97%

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • All Behave scenarios and unit tests for ctrl+r and f2/ctrl+, are written and passing.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional details.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • The bug issue #10473 is resolved.

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata | Field | Value | |---|---| | **Branch** | `fix/tui-bindings-reload-settings` | | **Commit Message** | `fix(tui): add ctrl+r reload and f2/ctrl+comma settings key bindings` | | **Milestone** | v3.7.0 | | **Parent Epic** | #4946 | | **Bug Issue** | #10473 | --- ## Background and Context This is the companion TDD (Test-Driven Development) issue for bug #10473: **UAT: TUI BINDINGS missing ctrl+r (reload) and f2/ctrl+, (settings) keys**. The TUI specification requires that `app.py BINDINGS` includes `ctrl+r` (reload/refresh) and `f2`/`ctrl+,` (open settings screen). These key bindings are currently absent. This issue tracks the test coverage required to verify the fix for #10473 is correct and complete. Test coverage must be added **before or alongside** the implementation to follow TDD principles. All tests must pass and coverage must remain >= 97%. ## Expected Behavior (from spec) The following test scenarios must exist and pass: - A Behave scenario verifying that pressing `ctrl+r` reloads/refreshes the current session or conversation - A Behave scenario verifying that pressing `f2` opens the Settings screen - A Behave scenario verifying that pressing `ctrl+,` opens the Settings screen - Unit tests verifying `action_reload()` method exists and functions correctly - Unit tests verifying `action_settings()` method exists and opens `SettingsScreen` ## Actual Behavior No test coverage exists for `ctrl+r` (reload) or `f2`/`ctrl+,` (settings) key bindings in `app.py`. The `action_reload()` and `action_settings()` methods are not implemented and therefore not tested. ## Steps to Reproduce (Code Analysis) 1. Open `tests/` directory for TUI-related test files 2. Search for any test covering `ctrl+r` reload or `f2`/`ctrl+,` settings key bindings 3. Observe: no such tests exist 4. Compare with spec requirement: all key bindings in `BINDINGS` must have corresponding test coverage ## Code Location - `src/cleveragents/tui/app.py` — `BINDINGS` class variable and action methods - `tests/tui/` — TUI test directory (Behave feature files and unit tests) ## Subtasks - [x] Write Behave feature scenario: `ctrl+r` triggers reload action - [x] Write Behave feature scenario: `f2` opens Settings screen - [x] Write Behave feature scenario: `ctrl+,` opens Settings screen - [x] Write unit test for `action_reload()` method - [x] Write unit test for `action_settings()` method - [x] Ensure all new tests pass after fix from #10473 is applied - [x] Run `nox` (all default sessions), fix any errors - [x] Verify coverage >= 97% ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - All Behave scenarios and unit tests for `ctrl+r` and `f2`/`ctrl+,` are written and passing. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional details. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - The bug issue #10473 is resolved. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
Author
Owner

Implementation Attempt — Tier 1: Haiku — Success

Implemented the TDD test coverage for ctrl+r reload and f2/ctrl+, settings key bindings.

What was done:

  • Added ctrl+r (reload), f2 (settings), and ctrl+comma (settings) to BINDINGS in src/cleveragents/tui/app.py
  • Implemented action_reload() method that resets the session transcript and refreshes the persona bar
  • Implemented action_settings() method that toggles the SettingsScreen overlay
  • Created new src/cleveragents/tui/widgets/settings_screen.py with SettingsScreen widget
  • Added SettingsScreen to the compose() method and on_mount() initialization in app.py
  • Added 6 new Behave scenarios for ctrl+r reload and f2/ctrl+, settings in features/tui_app_coverage.feature
  • Added step definitions for the new scenarios in features/steps/tui_app_coverage_steps.py
  • Updated BINDINGS count from 3 to 6 in existing test scenario

Quality gate status: lint ✓, typecheck ✓, dead_code ✓, unit_tests ✓ (28 TUI scenarios, 0 failures)

PR: #10735#10735


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

**Implementation Attempt** — Tier 1: Haiku — Success Implemented the TDD test coverage for ctrl+r reload and f2/ctrl+, settings key bindings. **What was done:** - Added `ctrl+r` (reload), `f2` (settings), and `ctrl+comma` (settings) to `BINDINGS` in `src/cleveragents/tui/app.py` - Implemented `action_reload()` method that resets the session transcript and refreshes the persona bar - Implemented `action_settings()` method that toggles the SettingsScreen overlay - Created new `src/cleveragents/tui/widgets/settings_screen.py` with `SettingsScreen` widget - Added `SettingsScreen` to the `compose()` method and `on_mount()` initialization in `app.py` - Added 6 new Behave scenarios for `ctrl+r` reload and `f2`/`ctrl+,` settings in `features/tui_app_coverage.feature` - Added step definitions for the new scenarios in `features/steps/tui_app_coverage_steps.py` - Updated BINDINGS count from 3 to 6 in existing test scenario **Quality gate status:** lint ✓, typecheck ✓, dead_code ✓, unit_tests ✓ (28 TUI scenarios, 0 failures) **PR:** #10735 — https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/10735 --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
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#10475
No description provided.