mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +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.
37 lines
1.1 KiB
TypeScript
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} />
|
|
</>
|
|
)
|
|
}
|