Files
opencode-manager/frontend/src/components/session/SessionPickerSheet.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

37 lines
1.1 KiB
TypeScript

import { useState } from 'react'
import { BottomSheet } from '@/components/ui/bottom-sheet'
import { AddRepoDialog } from '@/components/repo/AddRepoDialog'
import { RouteSessionPicker } from '@/components/session/RouteSessionPicker'
import { useSessionPickerLocationPrefetch } from '@/hooks/useSessionPickerLocationPrefetch'
import { useSessionPickerNavigation } from '@/hooks/useSessionPickerNavigation'
interface SessionPickerSheetProps {
isOpen: boolean
onClose: () => void
}
export function SessionPickerSheet({ isOpen, onClose }: SessionPickerSheetProps) {
const [addRepoOpen, setAddRepoOpen] = useState(false)
const pickerNavigation = useSessionPickerNavigation({ mode: 'replace', onClose })
useSessionPickerLocationPrefetch()
const panel = isOpen ? (
<RouteSessionPicker
navigation={pickerNavigation}
onAddRepo={() => {
onClose()
setAddRepoOpen(true)
}}
/>
) : null
return (
<>
<BottomSheet isOpen={isOpen} onClose={onClose} heightClass="h-[90dvh]" ariaLabel="Sessions">
{panel}
</BottomSheet>
<AddRepoDialog open={addRepoOpen} onOpenChange={setAddRepoOpen} />
</>
)
}