mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
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.
35 lines
1.3 KiB
TypeScript
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}
|
|
/>
|
|
)
|
|
}
|