fix(frontend): resolve the deepest owning remote project and refresh VCS info after branch changes

findRemoteProjectForDirectory now returns the longest matching canonical path, so nested linked-server projects attribute sessions to the innermost project. Switching, creating and renaming a local branch invalidate that directory's VCS info query, so branch labels refresh immediately.
This commit is contained in:
Chris Scott committed 2026-10-24 10:37:41 -04:00
1 parent 4b7652451b
commit adb251081f
8 files changed
+128 -15

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
import { useQuery } from '@tanstack/react-query'
import { getVcsInfo } from '@/api/opencode'
import { serverScopedKey } from '@/lib/serverScope'
import { vcsInfoQueryKey } from '@/lib/queryInvalidation'
export interface UseVcsInfoOptions {
enabled?: boolean
@@ -14,7 +14,7 @@ export function useVcsInfo(
const { enabled = true } = options
return useQuery({
queryKey: [...serverScopedKey(['opencode', 'vcs', directory ?? ''], serverId), 'info'],
queryKey: vcsInfoQueryKey(directory, serverId),
queryFn: () => getVcsInfo(directory ?? '', serverId),
enabled: enabled && Boolean(directory),
staleTime: 30_000,