mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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:
1 parent
4b7652451b
commit
adb251081f
8 files changed
+128
-15
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user