Skip to content
This repository was archived by the owner on Apr 22, 2026. It is now read-only.

Commit f2f29d3

Browse files
authored
fix: handle DataTable RowSelected event for TUI workspace navigation (#43)
* fix: TUI workspace navigation exits and launches claude with plan prompt When user presses Enter on a workspace in the TUI: - TUI exits completely (returns WorkspaceInfo) - Shell executes: cd to workspace, set tab title, activate venv, launch claude - Tab title derived from beads issue title (truncated to 30 chars) - Claude launched with 'plan <issue-id>' when purpose contains beads ID - All user inputs sanitized with shlex.quote() for security Closes agentspaces-2ln * fix: handle DataTable RowSelected event for TUI workspace navigation DataTable with cursor_type="row" consumes Enter key and emits RowSelected events, which takes precedence over App-level keybindings. Added on_data_table_row_selected handler to properly capture Enter presses and delegate to action_navigate(). The App-level binding is retained for footer display purposes.
1 parent 5c4ddfe commit f2f29d3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/agentspaces/ui/app.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class WorkspacesTUI(App[WorkspaceInfo | None]):
7676
BINDINGS: ClassVar[list[Binding]] = [ # type: ignore[assignment]
7777
Binding("q", "quit", "Quit"),
7878
Binding("r", "refresh", "Refresh"),
79-
Binding("enter", "navigate", "Navigate"),
79+
# Enter handled via on_data_table_row_selected; binding kept for footer display
80+
Binding("enter", "navigate", "Navigate", show=True),
8081
Binding("d", "remove", "Remove"),
8182
Binding("space", "toggle_select", "Select"),
8283
]
@@ -162,6 +163,14 @@ def on_data_table_row_highlighted(self, event: DataTable.RowHighlighted) -> None
162163
preview = self.query_one(PreviewPanel)
163164
preview.update_preview(workspace)
164165

166+
def on_data_table_row_selected(self, _event: DataTable.RowSelected) -> None:
167+
"""Handle row selection (Enter pressed on DataTable).
168+
169+
DataTable consumes Enter key and emits RowSelected, so we handle
170+
navigation here rather than via App-level keybinding.
171+
"""
172+
self.action_navigate()
173+
165174
def action_toggle_select(self) -> None:
166175
"""Toggle selection of current row."""
167176
table = self.query_one(WorkspaceTable)

0 commit comments

Comments
 (0)