feat(tui): show project copy in session list (#31421)

This commit is contained in:
James Long 2026-06-09 12:10:37 -04:00 committed by GitHub
commit ffcb45d7c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 37 deletions

View file

@ -23,6 +23,7 @@ export const { use: useProject, provider: ProjectProvider } = createSimpleContex
project: {
id: undefined as string | undefined,
worktree: undefined as string | undefined,
mainDir: undefined as string | undefined,
},
instance: {
path: defaultPath,
@ -36,15 +37,19 @@ export const { use: useProject, provider: ProjectProvider } = createSimpleContex
async function sync() {
const workspace = store.workspace.current
const [path, project] = await Promise.all([
const [instancePath, project] = await Promise.all([
sdk.client.path.get({ workspace }),
sdk.client.project.current({ workspace }),
])
const directories = project.data?.id
? await sdk.client.project.directories({ projectID: project.data.id, workspace })
: undefined
batch(() => {
setStore("instance", "path", reconcile(path.data || defaultPath))
setStore("instance", "path", reconcile(instancePath.data || defaultPath))
setStore("project", "id", project.data?.id)
setStore("project", "worktree", project.data?.worktree)
setStore("project", "mainDir", directories?.data?.find((item) => item.type === "main")?.directory)
})
}