Skip to content

Commit 4094ce1

Browse files
authored
fix(tui): list a child session when its exact ID is typed in the open menu (#62262)
1 parent f9c9234 commit 4094ce1

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/tui/src/component/dialog-open.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export function DialogOpen(props: { sessions: SessionInfo[]; onLoad: (sessions:
161161
const seen = new Set<string>()
162162
const match = matched()
163163
const list = [...data.session.list(), ...props.sessions, ...(match ? [match] : [])].filter((session) => {
164-
if (session.parentID || seen.has(session.id)) return false
164+
if ((session.parentID && session.id !== match?.id) || seen.has(session.id)) return false
165165
if (session.time.archived !== undefined && session.id !== match?.id) return false
166166
seen.add(session.id)
167167
return true

‎packages/tui/test/cli/tui/dialog-open.test.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test("selecting an unhydrated session preserves its location", async () => {
5959
}
6060
})
6161

62-
test("finds and opens an exact session ID outside the recent list", async () => {
62+
test("finds and opens an exact child session ID outside the recent list", async () => {
6363
const sessionID = "ses_04a7a3d82ffeIphUJgd3SnEqiv"
6464
const remote = { directory: "/tmp/opencode/archive", workspaceID: "ws_archive" }
6565
const fixture = await renderOpen((url) => {
@@ -68,6 +68,7 @@ test("finds and opens an exact session ID outside the recent list", async () =>
6868
return json({
6969
data: {
7070
id: sessionID,
71+
parentID: "ses_04a7a3d82ffeParentSessionID",
7172
projectID: "proj_archive",
7273
cost: 0,
7374
tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },

0 commit comments

Comments
 (0)