Skip to content

Commit 2e574ac

Browse files
committed
fix(tui): use bare down key to enter child session in subagent view
Match the pattern of up/left/right navigation in subagent view by using a bare down key instead of <leader>down to navigate into child sessions. Only the root session view still requires <leader>down.
1 parent 87aaa76 commit 2e574ac

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

packages/opencode/src/cli/cmd/tui/routes/session/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,11 +962,24 @@ export function Session() {
962962
keybind: "session_child_first",
963963
category: "Session",
964964
hidden: true,
965+
enabled: !session()?.parentID,
965966
onSelect: (dialog) => {
966967
moveFirstChild()
967968
dialog.clear()
968969
},
969970
},
971+
{
972+
title: "Go to child session",
973+
value: "session.child.first.subagent",
974+
keybind: "session_child_first_subagent",
975+
category: "Session",
976+
hidden: true,
977+
enabled: !!session()?.parentID,
978+
onSelect: childSessionHandler((dialog) => {
979+
moveFirstChild()
980+
dialog.clear()
981+
}),
982+
},
970983
{
971984
title: "Go to parent session",
972985
value: "session.parent",

packages/opencode/src/cli/cmd/tui/routes/session/subagent-footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ export function SubagentFooter() {
128128
<box
129129
onMouseOver={() => setHover("child")}
130130
onMouseOut={() => setHover(null)}
131-
onMouseUp={() => command.trigger("session.child.first")}
131+
onMouseUp={() => command.trigger("session.child.first.subagent")}
132132
backgroundColor={hover() === "child" ? theme.backgroundElement : theme.backgroundPanel}
133133
>
134134
<text fg={theme.text}>
135-
Child <span style={{ fg: theme.textMuted }}>{keybind.print("session_child_first")}</span>
135+
Child <span style={{ fg: theme.textMuted }}>{keybind.print("session_child_first_subagent")}</span>
136136
</text>
137137
</box>
138138
</Show>

packages/opencode/src/config/keybinds.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const KeybindsSchema = Schema.Struct({
104104
history_previous: keybind("up", "Previous history item"),
105105
history_next: keybind("down", "Next history item"),
106106
session_child_first: keybind("<leader>down", "Go to first child session"),
107+
session_child_first_subagent: keybind("down", "Go to first child session (from subagent)"),
107108
session_child_cycle: keybind("right", "Go to next child session"),
108109
session_child_cycle_reverse: keybind("left", "Go to previous child session"),
109110
session_parent: keybind("up", "Go to parent session"),

0 commit comments

Comments
 (0)