Преглед на файлове

fix(tui): scope session picker by directory (#42804)

Kit Langton преди 1 ден
родител
ревизия
55be895e14
променени са 1 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 7 4
      packages/tui/src/component/dialog-session-list.tsx

+ 7 - 4
packages/tui/src/component/dialog-session-list.tsx

@@ -1,6 +1,7 @@
 import { createMemo, createResource, createSignal, onMount, Show } from "solid-js"
 import path from "path"
 import type { SessionInfo } from "@opencode-ai/client"
+import { Project } from "@opencode-ai/schema/project"
 import { TextAttributes } from "@opentui/core"
 import type { RGBA } from "@opentui/core"
 import { useDialog } from "../ui/dialog"
@@ -54,10 +55,12 @@ export function DialogSessionList() {
         const response = await client.api.session.list({
           ...(allProjects
             ? {}
-            : {
-                project: current.project.id,
-                subpath: path.relative(current.project.directory, current.directory).replaceAll("\\", "/"),
-              }),
+            : current.project.id === Project.ID.global
+              ? { directory: current.directory }
+              : {
+                  project: current.project.id,
+                  subpath: path.relative(current.project.directory, current.directory).replaceAll("\\", "/"),
+                }),
           ...(query ? { search: query } : {}),
           limit: 50,
           order: "desc",