UAT: TUI Conversation block cursor missing enter/space key handlers — context menu and expand/collapse not implemented #5567

Open
opened 2026-04-09 07:35:32 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: TUI — Block Cursor Navigation (v3.7.0)
Severity: Medium — block cursor navigation partially implemented; interactive actions missing
Discovered by: UAT Testing (uat-pool-1, worker: tui-sidebar-layout)


What Was Tested

Code analysis of src/cleveragents/tui/widgets/conversation.py on the feature/m8-tui-mainscreen branch against the TUI specification (§29842, §29862-29977, §30415-30438).


Expected Behavior (from spec §29842, §29862-29977)

The spec defines block cursor interaction:

The block cursor provides keyboard-driven message navigation — enter or space expands/collapses a block.

Pressing enter with the block cursor on any conversation block opens a floating context menu.

Spec §30415-30438 defines the full block cursor key bindings:

Key Action
alt+up Move block cursor to previous block
alt+down Move block cursor to next block
enter Open context menu for focused block
space Expand/collapse focused block
escape Clear block cursor, return focus to prompt

The context menu (§29881) should offer: Copy, Edit, Retry, Branch, Pin, Expand/Collapse, Delete.


Actual Behavior

The Conversation widget on the feature/m8-tui-mainscreen branch implements:

  • move_cursor_up() / move_cursor_down() / clear_cursor() — navigation works
  • gutter indicator (\u258c) — visual indicator works
  • cursor_index: reactive[int] — reactive state works

But is missing:

  • No enter key handler to open context menu
  • No space key handler to expand/collapse focused block
  • No BlockContextMenu widget or floating overlay
  • No escape key handler to clear cursor (this is handled in MainScreen.action_escape_cascade() but not in Conversation directly)

The Conversation.compose() yields a single Static widget for the entire stream — there are no individual block widgets that can be focused or interacted with.


Code Location

src/cleveragents/tui/widgets/conversation.py on feature/m8-tui-mainscreen branch:

  • _render_stream() renders all blocks as a single Static markup string
  • No individual block widgets exist that could receive key events
  • BlockSelected message class is defined but never posted

  1. Refactor Conversation to yield individual block widgets (one per ConversationBlock) instead of a single Static markup string
  2. Each block widget should handle enter (post BlockSelected message) and space (toggle expand/collapse)
  3. Implement BlockContextMenu as a floating overlay widget
  4. Wire BlockSelected message in MainScreen to show the context menu

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** TUI — Block Cursor Navigation (v3.7.0) **Severity:** Medium — block cursor navigation partially implemented; interactive actions missing **Discovered by:** UAT Testing (uat-pool-1, worker: tui-sidebar-layout) --- ## What Was Tested Code analysis of `src/cleveragents/tui/widgets/conversation.py` on the `feature/m8-tui-mainscreen` branch against the TUI specification (§29842, §29862-29977, §30415-30438). --- ## Expected Behavior (from spec §29842, §29862-29977) The spec defines block cursor interaction: > The block cursor provides keyboard-driven message navigation — `enter` or `space` expands/collapses a block. > Pressing `enter` with the block cursor on any conversation block opens a floating context menu. Spec §30415-30438 defines the full block cursor key bindings: | Key | Action | |-----|--------| | `alt+up` | Move block cursor to previous block | | `alt+down` | Move block cursor to next block | | `enter` | Open context menu for focused block | | `space` | Expand/collapse focused block | | `escape` | Clear block cursor, return focus to prompt | The context menu (§29881) should offer: Copy, Edit, Retry, Branch, Pin, Expand/Collapse, Delete. --- ## Actual Behavior The `Conversation` widget on the `feature/m8-tui-mainscreen` branch implements: - ✅ `move_cursor_up()` / `move_cursor_down()` / `clear_cursor()` — navigation works - ✅ `▌` gutter indicator (`\u258c`) — visual indicator works - ✅ `cursor_index: reactive[int]` — reactive state works But is **missing**: - ❌ No `enter` key handler to open context menu - ❌ No `space` key handler to expand/collapse focused block - ❌ No `BlockContextMenu` widget or floating overlay - ❌ No `escape` key handler to clear cursor (this is handled in `MainScreen.action_escape_cascade()` but not in `Conversation` directly) The `Conversation.compose()` yields a single `Static` widget for the entire stream — there are no individual block widgets that can be focused or interacted with. --- ## Code Location `src/cleveragents/tui/widgets/conversation.py` on `feature/m8-tui-mainscreen` branch: - `_render_stream()` renders all blocks as a single `Static` markup string - No individual block widgets exist that could receive key events - `BlockSelected` message class is defined but never posted --- ## Recommended Fix 1. Refactor `Conversation` to yield individual block widgets (one per `ConversationBlock`) instead of a single `Static` markup string 2. Each block widget should handle `enter` (post `BlockSelected` message) and `space` (toggle expand/collapse) 3. Implement `BlockContextMenu` as a floating overlay widget 4. Wire `BlockSelected` message in `MainScreen` to show the context menu --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Hierarchical Compliance Fix: This issue was detected as an orphan (no parent Epic).

Solution: Linked to Epic #4963 (TUI Core Layout & Navigation — MainScreen, Sidebar, Hotkeys) based on scope alignment.

Hierarchy: Issue #5567 → Epic #4963


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

**Hierarchical Compliance Fix**: This issue was detected as an orphan (no parent Epic). **Solution**: Linked to Epic #4963 (TUI Core Layout & Navigation — MainScreen, Sidebar, Hotkeys) based on scope alignment. **Hierarchy**: Issue #5567 → Epic #4963 --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
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#5567
No description provided.