UAT: TUI preset cycling bound to ctrl+t instead of spec-required ctrl+tab; persona cycling (tab key) not bound at all #3316

Open
opened 2026-04-05 09:41:44 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: bugfix/m7-tui-keybinding-tab-persona-preset
  • Commit Message: fix(tui): correct keybindings for tab persona cycling and ctrl+tab preset cycling
  • Milestone: (backlog — see note below)
  • Parent Epic: #868

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Bug Report

Feature Area: TUI Implementation — Persona System (ADR-045)
Severity: Medium
Priority: Backlog

What Was Tested

Inspected the keybindings in src/cleveragents/tui/app.py against the persona cycling requirements in ADR-045.

Expected Behavior (from spec)

Per ADR-045 (TUI Persona System):

  1. tab key — cycles through personas in the user's configured cycle list (personas with cycle_order > 0, sorted by cycle_order)
  2. ctrl+tab key — cycles through the current persona's argument presets

Per ADR-044 (TUI Architecture), the footer shows:

Footer: F1 Help │ shift+tab Sidebar │ tab Persona │ ctrl+q Quit

Actual Behavior

The _TextualCleverAgentsTuiApp in app.py defines these bindings:

BINDINGS: ClassVar[list[tuple[str, str, str]]] = [
    ("ctrl+q", "quit", "Quit"),
    ("f1", "help", "Help"),
    ("ctrl+t", "cycle_preset", "Cycle Preset"),   # ← wrong key for preset cycling
]

Issues:

  1. Preset cycling is bound to ctrl+t instead of ctrl+tab — users following the spec/documentation will press ctrl+tab and nothing will happen
  2. Persona cycling (tab key) is not bound at all — pressing tab in the prompt will trigger default Textual focus cycling behavior, not persona switching
  3. shift+tab for sidebar cycling is not bound — pressing shift+tab will trigger Textual's reverse focus cycling, not sidebar state transitions

Steps to Reproduce

  1. Launch the TUI with multiple personas configured
  2. Press tab in the prompt — expect persona cycling, observe focus change instead
  3. Press ctrl+tab — expect preset cycling, observe nothing
  4. Press ctrl+t — observe preset cycling (wrong key)
  5. Press shift+tab — expect sidebar state change, observe reverse focus cycling

Code Location

  • src/cleveragents/tui/app.py lines 92-96 — BINDINGS definition
  • ADR-045 section "Tab Cycling Behavior" — specifies tab for persona cycling
  • ADR-045 section "Ctrl+Tab Preset Cycling" — specifies ctrl+tab for preset cycling
  • ADR-044 footer spec — shows shift+tab Sidebar and tab Persona

Impact

Users cannot use the documented keyboard shortcuts for persona and preset cycling. The core ergonomic benefit of the persona system (single-keypress context switching) is broken.

Subtasks

  • Fix BINDINGS in _TextualCleverAgentsTuiApp: replace ("ctrl+t", "cycle_preset", "Cycle Preset") with ("ctrl+tab", "cycle_preset", "Cycle Preset")
  • Add ("tab", "cycle_persona", "Persona") binding to BINDINGS
  • Add ("shift+tab", "cycle_sidebar", "Sidebar") binding to BINDINGS
  • Implement action_cycle_persona method if not already present, wiring it to the persona cycle list logic per ADR-045
  • Implement action_cycle_sidebar method if not already present, wiring it to the three-state sidebar transition (hidden → visible → fullscreen) per ADR-044
  • Verify footer bar reflects the corrected bindings: F1 Help │ shift+tab Sidebar │ tab Persona │ ctrl+tab Preset │ ctrl+s Sessions │ ctrl+q Quit
  • Tests (Behave): Add/update BDD scenarios covering correct keybinding dispatch for tab, ctrl+tab, and shift+tab
  • Tests (Robot): Add integration test verifying keybinding behavior in a live TUI session
  • Verify coverage ≥97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • The BINDINGS list in src/cleveragents/tui/app.py matches the ADR-044/ADR-045 specification exactly: tab → persona cycling, ctrl+tab → preset cycling, shift+tab → sidebar cycling.
  • 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 about the implementation.
  • 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.
  • All nox stages pass.
  • Coverage ≥ 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `bugfix/m7-tui-keybinding-tab-persona-preset` - **Commit Message**: `fix(tui): correct keybindings for tab persona cycling and ctrl+tab preset cycling` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #868 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Bug Report **Feature Area:** TUI Implementation — Persona System (ADR-045) **Severity:** Medium **Priority:** Backlog ### What Was Tested Inspected the keybindings in `src/cleveragents/tui/app.py` against the persona cycling requirements in ADR-045. ### Expected Behavior (from spec) Per ADR-045 (TUI Persona System): 1. **`tab` key** — cycles through personas in the user's configured cycle list (personas with `cycle_order > 0`, sorted by `cycle_order`) 2. **`ctrl+tab` key** — cycles through the current persona's argument presets Per ADR-044 (TUI Architecture), the footer shows: ``` Footer: F1 Help │ shift+tab Sidebar │ tab Persona │ ctrl+q Quit ``` ### Actual Behavior The `_TextualCleverAgentsTuiApp` in `app.py` defines these bindings: ```python BINDINGS: ClassVar[list[tuple[str, str, str]]] = [ ("ctrl+q", "quit", "Quit"), ("f1", "help", "Help"), ("ctrl+t", "cycle_preset", "Cycle Preset"), # ← wrong key for preset cycling ] ``` Issues: 1. **Preset cycling** is bound to `ctrl+t` instead of `ctrl+tab` — users following the spec/documentation will press `ctrl+tab` and nothing will happen 2. **Persona cycling** (`tab` key) is **not bound at all** — pressing `tab` in the prompt will trigger default Textual focus cycling behavior, not persona switching 3. **`shift+tab` for sidebar cycling** is not bound — pressing `shift+tab` will trigger Textual's reverse focus cycling, not sidebar state transitions ### Steps to Reproduce 1. Launch the TUI with multiple personas configured 2. Press `tab` in the prompt — expect persona cycling, observe focus change instead 3. Press `ctrl+tab` — expect preset cycling, observe nothing 4. Press `ctrl+t` — observe preset cycling (wrong key) 5. Press `shift+tab` — expect sidebar state change, observe reverse focus cycling ### Code Location - `src/cleveragents/tui/app.py` lines 92-96 — `BINDINGS` definition - ADR-045 section "Tab Cycling Behavior" — specifies `tab` for persona cycling - ADR-045 section "Ctrl+Tab Preset Cycling" — specifies `ctrl+tab` for preset cycling - ADR-044 footer spec — shows `shift+tab Sidebar` and `tab Persona` ### Impact Users cannot use the documented keyboard shortcuts for persona and preset cycling. The core ergonomic benefit of the persona system (single-keypress context switching) is broken. ## Subtasks - [ ] Fix `BINDINGS` in `_TextualCleverAgentsTuiApp`: replace `("ctrl+t", "cycle_preset", "Cycle Preset")` with `("ctrl+tab", "cycle_preset", "Cycle Preset")` - [ ] Add `("tab", "cycle_persona", "Persona")` binding to `BINDINGS` - [ ] Add `("shift+tab", "cycle_sidebar", "Sidebar")` binding to `BINDINGS` - [ ] Implement `action_cycle_persona` method if not already present, wiring it to the persona cycle list logic per ADR-045 - [ ] Implement `action_cycle_sidebar` method if not already present, wiring it to the three-state sidebar transition (hidden → visible → fullscreen) per ADR-044 - [ ] Verify footer bar reflects the corrected bindings: `F1 Help │ shift+tab Sidebar │ tab Persona │ ctrl+tab Preset │ ctrl+s Sessions │ ctrl+q Quit` - [ ] Tests (Behave): Add/update BDD scenarios covering correct keybinding dispatch for `tab`, `ctrl+tab`, and `shift+tab` - [ ] Tests (Robot): Add integration test verifying keybinding behavior in a live TUI session - [ ] Verify coverage ≥97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - The `BINDINGS` list in `src/cleveragents/tui/app.py` matches the ADR-044/ADR-045 specification exactly: `tab` → persona cycling, `ctrl+tab` → preset cycling, `shift+tab` → sidebar cycling. - 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 about the implementation. - 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. - All nox stages pass. - Coverage ≥ 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Low (keybinding mismatch is a minor UX issue, not a functional blocker)
  • Milestone: v3.7.0 (TUI keybindings are M8 scope)
  • MoSCoW: Should Have — the spec defines specific keybindings and they should match. However, this is a simple configuration fix, not a structural issue.
  • Parent Epic: #868 (TUI Interface, Modals and Persona System)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Low (keybinding mismatch is a minor UX issue, not a functional blocker) - **Milestone**: v3.7.0 (TUI keybindings are M8 scope) - **MoSCoW**: Should Have — the spec defines specific keybindings and they should match. However, this is a simple configuration fix, not a structural issue. - **Parent Epic**: #868 (TUI Interface, Modals and Persona System) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.7.0 milestone 2026-04-05 10:11:49 +00:00
freemo removed this from the v3.7.0 milestone 2026-04-07 00:00:08 +00:00
Owner

Label compliance fix applied:

  • Removed conflicting labels: MoSCoW/Should have (deprecated lowercase) and MoSCoW/Should Have (conflicting tier)
  • Kept: MoSCoW/Could Have (canonical, most lenient tier)
  • Reason: Issue had 3 MoSCoW labels across two different tiers. Normalized to single canonical MoSCoW/Could Have.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Removed conflicting labels: `MoSCoW/Should have` (deprecated lowercase) and `MoSCoW/Should Have` (conflicting tier) - Kept: `MoSCoW/Could Have` (canonical, most lenient tier) - Reason: Issue had 3 MoSCoW labels across two different tiers. Normalized to single canonical `MoSCoW/Could Have`. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
Reference
cleveragents/cleveragents-core#3316
No description provided.