mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat(servers): switch the sidebar listing between local and linked servers
The Servers section becomes a Local/server switcher shared by the desktop sidebar, collapsed rail and mobile repo sheet. Selecting a linked server lists its projects and sessions with the same navigation as local repos, and a remote project page mirrors the local repo page.
This commit is contained in:
1 parent
cb9b7645e6
commit
36b8c1b200
29 files changed
+2080
-201
No files matched your search
@@ -10,6 +10,10 @@ export interface UseSessionSearchOptions {
|
||||
limit?: number
|
||||
allDirectories?: boolean
|
||||
project?: { id: string; subpath: string }
|
||||
/** Searches a linked server instead of the route's server. */
|
||||
serverId?: string
|
||||
/** Seeds the search box, for callers that mount the hook after a query is already entered. */
|
||||
initialQuery?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,7 +24,8 @@ export function useSessionSearch(directories: string[], options: UseSessionSearc
|
||||
const limit = options.limit ?? DEFAULT_LIMIT
|
||||
const allDirectories = options.allDirectories ?? false
|
||||
const project = options.project
|
||||
const [query, setQuery] = useState('')
|
||||
const serverId = options.serverId
|
||||
const [query, setQuery] = useState(options.initialQuery ?? '')
|
||||
const trimmedQuery = query.trim()
|
||||
const debouncedQuery = useDebouncedValue(trimmedQuery, 150)
|
||||
const search = trimmedQuery ? debouncedQuery : ''
|
||||
@@ -39,6 +44,7 @@ export function useSessionSearch(directories: string[], options: UseSessionSearc
|
||||
keepPreviousResults: true,
|
||||
allDirectories,
|
||||
project,
|
||||
serverId,
|
||||
})
|
||||
|
||||
const directorySet = useMemo(() => new Set(directories), [directories])
|
||||
|
||||
Reference in new issue
Block a user