bug(tui): preset cycling uses ctrl+t instead of spec-required ctrl+tab; persona tab-cycling binding missing #9358

Open
opened 2026-04-14 15:25:31 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit Message: fix(tui): correct preset cycling keybinding to ctrl+tab and add persona tab-cycling
  • Branch: fix/tui-keybinding-preset-persona-cycling

Background and Context

ADR-045 (TUI Persona System) specifies two distinct keybindings for persona and preset cycling in the TUI main chat screen:

  • tab: cycles through personas in the user's configured cycle list (personas with cycle_order > 0, sorted by cycle_order)
  • ctrl+tab: cycles through the current persona's argument presets

The current implementation in src/cleveragents/tui/app.py (_TextualCleverAgentsTuiApp.BINDINGS) deviates from this specification in two ways:

  1. Wrong keybinding for preset cycling: ctrl+t is used instead of ctrl+tab
  2. Missing persona cycling binding: There is no tab binding for cycling through personas

Current Behavior

src/cleveragents/tui/app.py defines:

BINDINGS: ClassVar[list[tuple[str, str, str]]] = [
    ("ctrl+q", "quit", "Quit"),
    ("f1", "help", "Help"),
    ("ctrl+t", "cycle_preset", "Cycle Preset"),
]
  • ctrl+t triggers action_cycle_preset (preset cycling) — should be ctrl+tab
  • No binding exists for persona cycling via tab

Expected Behavior

Per ADR-045 §Tab Cycling Behavior and §Ctrl+Tab Preset Cycling:

BINDINGS: ClassVar[list[tuple[str, str, str]]] = [
    ("ctrl+q", "quit", "Quit"),
    ("f1", "help", "Help"),
    ("ctrl+tab", "cycle_preset", "Cycle Preset"),
    ("tab", "cycle_persona", "Cycle Persona"),
]
  • ctrl+tab should trigger preset cycling (action_cycle_preset)
  • tab should trigger persona cycling (action_cycle_persona) — a new action that cycles through personas with cycle_order > 0

Acceptance Criteria

  • ctrl+tab binding triggers action_cycle_preset in CleverAgentsTuiApp
  • tab binding triggers a new action_cycle_persona action that cycles through personas with cycle_order > 0 sorted by cycle_order
  • action_cycle_persona updates the PersonaBar after cycling
  • BDD scenarios in tui_first_run.feature or a new tui_keybindings.feature verify the correct bindings
  • All existing tests continue to pass

Supporting Information

  • Specification: docs/adr/ADR-045-tui-persona-system.md §Tab Cycling Behavior (line ~154) and §Ctrl+Tab Preset Cycling (line ~165)
  • Affected file: src/cleveragents/tui/app.py_TextualCleverAgentsTuiApp.BINDINGS and missing action_cycle_persona method

Subtasks

  • Change ("ctrl+t", "cycle_preset", "Cycle Preset") to ("ctrl+tab", "cycle_preset", "Cycle Preset") in _TextualCleverAgentsTuiApp.BINDINGS
  • Add ("tab", "cycle_persona", "Cycle Persona") binding
  • Implement action_cycle_persona method that cycles through personas with cycle_order > 0
  • Update _refresh_persona_bar call after persona cycling
  • Add BDD scenarios verifying the keybindings
  • Run nox -s unit_tests-3.13 and verify all tests pass
  • Verify coverage ≥97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • The ctrl+tab binding replaces ctrl+t for preset cycling in _TextualCleverAgentsTuiApp
  • A new tab binding and action_cycle_persona method are implemented per ADR-045
  • BDD scenarios cover both keybindings
  • All subtasks above are completed and checked off
  • 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 lines providing relevant 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

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit Message**: `fix(tui): correct preset cycling keybinding to ctrl+tab and add persona tab-cycling` - **Branch**: `fix/tui-keybinding-preset-persona-cycling` --- ## Background and Context ADR-045 (TUI Persona System) specifies two distinct keybindings for persona and preset cycling in the TUI main chat screen: - **`tab`**: cycles through personas in the user's configured cycle list (personas with `cycle_order > 0`, sorted by `cycle_order`) - **`ctrl+tab`**: cycles through the current persona's argument presets The current implementation in `src/cleveragents/tui/app.py` (`_TextualCleverAgentsTuiApp.BINDINGS`) deviates from this specification in two ways: 1. **Wrong keybinding for preset cycling**: `ctrl+t` is used instead of `ctrl+tab` 2. **Missing persona cycling binding**: There is no `tab` binding for cycling through personas ## Current Behavior `src/cleveragents/tui/app.py` defines: ```python BINDINGS: ClassVar[list[tuple[str, str, str]]] = [ ("ctrl+q", "quit", "Quit"), ("f1", "help", "Help"), ("ctrl+t", "cycle_preset", "Cycle Preset"), ] ``` - `ctrl+t` triggers `action_cycle_preset` (preset cycling) — should be `ctrl+tab` - No binding exists for persona cycling via `tab` ## Expected Behavior Per ADR-045 §Tab Cycling Behavior and §Ctrl+Tab Preset Cycling: ```python BINDINGS: ClassVar[list[tuple[str, str, str]]] = [ ("ctrl+q", "quit", "Quit"), ("f1", "help", "Help"), ("ctrl+tab", "cycle_preset", "Cycle Preset"), ("tab", "cycle_persona", "Cycle Persona"), ] ``` - `ctrl+tab` should trigger preset cycling (`action_cycle_preset`) - `tab` should trigger persona cycling (`action_cycle_persona`) — a new action that cycles through personas with `cycle_order > 0` ## Acceptance Criteria - [ ] `ctrl+tab` binding triggers `action_cycle_preset` in `CleverAgentsTuiApp` - [ ] `tab` binding triggers a new `action_cycle_persona` action that cycles through personas with `cycle_order > 0` sorted by `cycle_order` - [ ] `action_cycle_persona` updates the PersonaBar after cycling - [ ] BDD scenarios in `tui_first_run.feature` or a new `tui_keybindings.feature` verify the correct bindings - [ ] All existing tests continue to pass ## Supporting Information - Specification: `docs/adr/ADR-045-tui-persona-system.md` §Tab Cycling Behavior (line ~154) and §Ctrl+Tab Preset Cycling (line ~165) - Affected file: `src/cleveragents/tui/app.py` — `_TextualCleverAgentsTuiApp.BINDINGS` and missing `action_cycle_persona` method ## Subtasks - [ ] Change `("ctrl+t", "cycle_preset", "Cycle Preset")` to `("ctrl+tab", "cycle_preset", "Cycle Preset")` in `_TextualCleverAgentsTuiApp.BINDINGS` - [ ] Add `("tab", "cycle_persona", "Cycle Persona")` binding - [ ] Implement `action_cycle_persona` method that cycles through personas with `cycle_order > 0` - [ ] Update `_refresh_persona_bar` call after persona cycling - [ ] Add BDD scenarios verifying the keybindings - [ ] Run `nox -s unit_tests-3.13` and verify all tests pass - [ ] Verify coverage ≥97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - The `ctrl+tab` binding replaces `ctrl+t` for preset cycling in `_TextualCleverAgentsTuiApp` - A new `tab` binding and `action_cycle_persona` method are implemented per ADR-045 - BDD scenarios cover both keybindings - All subtasks above are completed and checked off - 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 lines providing relevant 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 --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
HAL9000 added this to the v3.7.0 milestone 2026-04-16 08:22:18 +00:00
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.

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