mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(frontend): scope linked-server pickers to the canonical project and stabilize the model pill
Sheet, desktop rail and session-page dialog resolve the same canonical remote project, reuse the page's session cache and hold the all-directories search while it resolves. Deleting the open session keeps ?repoTab=. Context usage keeps its identity between streaming flushes so ModelQuickSelect skips re-renders, the location prefetch waits for repo data, and dialog and bottom sheet share one return-focus hook. Picker route parsing, remote project query options and the local new-session button are shared.
This commit is contained in:
1 parent
52aeb7780f
commit
bd746574e8
28 files changed
+827
-181
No files matched your search
@@ -68,6 +68,23 @@ export function remoteProjectName(project: OpenCodeProject): string {
|
||||
return project.name?.trim() || getDirectoryName(project.canonical)
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the project that owns a directory, matching its canonical directory and anything nested
|
||||
* inside it.
|
||||
*
|
||||
* @param projects Projects of the server that owns the directory.
|
||||
* @param directory Directory whose owning project is resolved.
|
||||
* @returns The owning project, or undefined when the directory belongs to none of them.
|
||||
*/
|
||||
export function findRemoteProjectForDirectory(
|
||||
projects: OpenCodeProject[],
|
||||
directory: string,
|
||||
): OpenCodeProject | undefined {
|
||||
return projects.find(
|
||||
(project) => directory === project.canonical || directory.startsWith(`${project.canonical}/`),
|
||||
)
|
||||
}
|
||||
|
||||
export type VcsInfo = Awaited<ReturnType<OpenCodeApi['vcs']['get']>>['data']
|
||||
|
||||
export type VcsFileStatus = Awaited<ReturnType<OpenCodeApi['vcs']['status']>>['data'][number]
|
||||
|
||||
Reference in new issue
Block a user