feat(frontend): open session details from the header

Pressing the session title opens a details sheet with server, project, branch and directory and inline rename. Linked-server sessions show a server icon and their branch, child sessions show a parent session pill, a banner marks paused live updates while the stream reconnects, and the header context indicator is removed now that usage lives on the model pill.
This commit is contained in:
Chris Scott committed 2026-10-23 20:18:27 -04:00
1 parent 52162d5c4a
commit d99fcc268e
20 files changed
+732 -418

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
import { useQuery } from '@tanstack/react-query'
import { getVcsInfo } from '@/api/opencode'
import { serverScopedKey } from '@/lib/serverScope'
export interface UseVcsInfoOptions {
enabled?: boolean
}
/**
* Reads the version-control info of a directory through the OpenCode server in
* scope. The query is keyed by directory and server id, so the session header,
* the project header and the source control panel share one cached read, and a
* linked server reports its own checkout rather than the Manager's.
*
* @param directory Absolute checkout directory; the query stays disabled without one.
* @param serverId Linked server to read from, or the local Manager when omitted.
* @param options.enabled Whether to read the info; defaults to `true`.
*/
export function useVcsInfo(
directory: string | undefined,
serverId: string | undefined,
options: UseVcsInfoOptions = {},
) {
const { enabled = true } = options
return useQuery({
queryKey: [...serverScopedKey(['opencode', 'vcs', directory ?? ''], serverId), 'info'],
queryFn: () => getVcsInfo(directory ?? '', serverId),
enabled: enabled && Boolean(directory),
retry: false,
staleTime: 60_000,
})
}