Files
opencode-manager/frontend/src/components/session/RouteSessionPicker.tsx
T
Chris Scott d26ab578f0 feat(sessions): move the session picker into the desktop right tool panel
Replace the tool rail's Activity tool with a Sessions tool that renders the
full session picker (Activity, This project and Projects tabs, linked-server
selector, add repository), shared with the mobile sheet via RouteSessionPicker.

- A docked panel stays open and follows navigation (picker navigation mode
  'panel'); the floating overlay closes on select (mode 'replace').
- The session page's sessions shortcut and /sessions open the panel; the
  collapsed sidebar opens it when a tool rail is mounted and falls back to
  the modal dialog otherwise.
- useToolPanelToggle is the single panel toggle for the rail, shortcuts and
  sidebar.
- Remove ActivityList, the fixed activity panel width and the window label.
2026-10-25 17:16:36 -04:00

35 lines
1.3 KiB
TypeScript

import { LinkedServersNav } from '@/components/navigation/LinkedServersNav'
import { SessionPickerPanel } from '@/components/session/SessionPickerDialog'
import type { SessionPickerNavigation } from '@/hooks/useSessionPickerNavigation'
import { useSessionPickerRouteScope } from '@/hooks/useSessionPickerRouteScope'
export interface RouteSessionPickerProps {
/** Session and repo handlers built by the host, so choosing a row navigates the same way it hosts. */
navigation: SessionPickerNavigation
/**
* Replaces the panel's internal add-repo dialog with the host's own, letting the host close itself
* first. When omitted the panel opens its own dialog.
*/
onAddRepo?: () => void
}
/**
* Session picker scoped to the route in view, including the linked-server selector. Hosts mount it
* only while visible, so the route scope resolves repos and the remote server only then.
*/
export function RouteSessionPicker({ navigation, onAddRepo }: RouteSessionPickerProps) {
const { currentRepo, activeSessionID, remote } = useSessionPickerRouteScope(true)
return (
<SessionPickerPanel
open
currentRepo={currentRepo}
activeSessionID={activeSessionID}
{...navigation}
remote={remote}
searchTrailing={<LinkedServersNav variant="header" />}
onAddRepo={onAddRepo}
/>
)
}