Skip to content

Commit 7441c38

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 76d5ab6 commit 7441c38

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
@@ -949,11 +949,24 @@ export function Session() {
949949
keybind: "session_child_first",
950950
category: "Session",
951951
hidden: true,
952+
enabled: !session()?.parentID,
952953
onSelect: (dialog) => {
953954
moveFirstChild()
954955
dialog.clear()
955956
},
956957
},
958+
{
959+
title: "Go to child session",
960+
value: "session.child.first.subagent",
961+
keybind: "session_child_first_subagent",
962+
category: "Session",
963+
hidden: true,
964+
enabled: !!session()?.parentID,
965+
onSelect: childSessionHandler((dialog) => {
966+
moveFirstChild()
967+
dialog.clear()
968+
}),
969+
},
957970
{
958971
title: "Go to parent session",
959972
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)