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.
This commit is contained in:
Chris Scott committed 2026-10-25 17:16:36 -04:00
1 parent 82c46bbdb2
commit d26ab578f0
25 files changed
+639 -695

No files matched your search

@@ -0,0 +1,34 @@
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}
/>
)
}
@@ -1,9 +1,7 @@
import { useState } from 'react'
import { BottomSheet } from '@/components/ui/bottom-sheet'
import { LinkedServersNav } from '@/components/navigation/LinkedServersNav'
import { AddRepoDialog } from '@/components/repo/AddRepoDialog'
import { SessionPickerPanel } from '@/components/session/SessionPickerDialog'
import { useSessionPickerRouteScope } from '@/hooks/useSessionPickerRouteScope'
import { RouteSessionPicker } from '@/components/session/RouteSessionPicker'
import { useSessionPickerLocationPrefetch } from '@/hooks/useSessionPickerLocationPrefetch'
import { useSessionPickerNavigation } from '@/hooks/useSessionPickerNavigation'
@@ -14,18 +12,12 @@ interface SessionPickerSheetProps {
export function SessionPickerSheet({ isOpen, onClose }: SessionPickerSheetProps) {
const [addRepoOpen, setAddRepoOpen] = useState(false)
const { currentRepo, activeSessionID, remote } = useSessionPickerRouteScope(isOpen)
const pickerNavigation = useSessionPickerNavigation({ mode: 'replace', onClose })
useSessionPickerLocationPrefetch()
const panel = isOpen ? (
<SessionPickerPanel
open={isOpen}
currentRepo={currentRepo}
activeSessionID={activeSessionID}
{...pickerNavigation}
remote={remote}
searchTrailing={<LinkedServersNav variant="header" />}
<RouteSessionPicker
navigation={pickerNavigation}
onAddRepo={() => {
onClose()
setAddRepoOpen(true)