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
@@ -5,7 +5,9 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { MemoryRouter, useLocation } from 'react-router-dom'
|
||||
import type { ReactNode } from 'react'
|
||||
import { TooltipProvider } from '@/components/ui/tooltip'
|
||||
import { LOCAL_OPENCODE_SERVER_ID } from '@opencode-manager/shared/schemas'
|
||||
import { DesktopSessionTree } from './DesktopSessionTree'
|
||||
import { useSidebarServerStore } from '@/stores/sidebarServerStore'
|
||||
import type { Repo } from '@/api/types'
|
||||
|
||||
type SessionFixture = {
|
||||
@@ -90,6 +92,11 @@ vi.mock('@/hooks/useSessionPins', () => ({
|
||||
useSessionPins: () => ({ data: sessionPinsData.current }),
|
||||
}))
|
||||
|
||||
vi.mock('@/hooks/useOpenCodeServers', () => ({
|
||||
useOpenCodeServers: () => ({ servers: [], isLoading: false }),
|
||||
useOpenCodeServerStatuses: () => ({ statuses: [], statusById: {}, isLoading: false }),
|
||||
}))
|
||||
|
||||
vi.mock('@/contexts/EventContext', () => ({
|
||||
usePermissions: () => ({
|
||||
hasForSession: (sessionID: string) => permissionSessions.current.has(sessionID),
|
||||
@@ -156,6 +163,8 @@ const fetchedDirectories = () => new Set(sessionsHookCalls.flatMap((call) => cal
|
||||
|
||||
describe('DesktopSessionTree', () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear()
|
||||
useSidebarServerStore.setState({ serverId: LOCAL_OPENCODE_SERVER_ID })
|
||||
listReposMock.mockReset()
|
||||
listReposMock.mockResolvedValue([repoA, repoB, repoC])
|
||||
getRepoSiblingsMock.mockReset()
|
||||
|
||||
Reference in new issue
Block a user