Compare commits

...

1 Commits

Author SHA1 Message Date
CleverAgents Bot e2177a7912 fix(tui): add missing alt+up and alt+down block cursor navigation bindings
Add alt+up and alt+down key bindings to the TUI app for block cursor navigation
as specified in the TUI specification. These bindings allow users to navigate
between conversation blocks using keyboard shortcuts.

- Add alt+up binding to move cursor to previous block
- Add alt+down binding to move cursor to next block
- Implement action_move_cursor_up and action_move_cursor_down methods
- Track current block index with _current_block_index
- Update help panel to display the new bindings in Main Screen context
2026-04-19 06:11:35 +00:00
2 changed files with 14 additions and 0 deletions
+12
View File
@@ -93,6 +93,8 @@ if _TEXTUAL_AVAILABLE:
("ctrl+q", "quit", "Quit"),
("f1", "help", "Help"),
("ctrl+t", "cycle_preset", "Cycle Preset"),
("alt+up", "move_cursor_up", "Previous Block"),
("alt+down", "move_cursor_down", "Next Block"),
]
def __init__(
@@ -105,6 +107,7 @@ if _TEXTUAL_AVAILABLE:
self._command_router = command_router
self._persona_state = persona_state
self._session = SessionView(session_id="default", transcript=[])
self._current_block_index: int = -1
def compose(self) -> Any:
yield _Header(show_clock=True)
@@ -152,6 +155,15 @@ if _TEXTUAL_AVAILABLE:
self._persona_state.cycle_preset(self._session.session_id)
self._refresh_persona_bar()
def action_move_cursor_up(self) -> None:
"""Move block cursor to the previous block in the conversation."""
if self._current_block_index > 0:
self._current_block_index -= 1
def action_move_cursor_down(self) -> None:
"""Move block cursor to the next block in the conversation."""
self._current_block_index += 1
def _refresh_persona_bar(self) -> None:
persona = self._persona_state.active_persona(self._session.session_id)
preset = self._persona_state.current_preset(self._session.session_id)
@@ -33,6 +33,8 @@ _CONTEXT_ITEMS: dict[str, tuple[tuple[str, str], ...]] = {
"Main Screen": (
("enter", "Submit prompt"),
("ctrl+t", "Cycle to next argument preset"),
("alt+up", "Move to previous block"),
("alt+down", "Move to next block"),
("@", "Open Reference Picker overlay"),
("/", "Open Slash Command overlay"),
("! / $", "Activate shell mode"),