feat(frontend): replace the repos sheet with a sessions picker sheet

The mobile tab bar's Repos sheet becomes a Sessions sheet with Activity, Sessions and Projects tabs, matching the mobile app. The picker body is shared with the desktop session dialog, the scope toggles by tapping the selected Sessions tab, and the header adds new-session, add-repo and server controls. The collapsed desktop sidebar opens the session dialog instead of the old sheet.
This commit is contained in:
Chris Scott committed 2026-10-23 19:56:10 -04:00
1 parent 2e31cb45ba
commit 578a2211ba
25 files changed
+1131 -1493

No files matched your search

@@ -1,6 +1,9 @@
import { useEffect, useId, useMemo, useState } from 'react'
import type { Repo } from '@/api/types'
import { useNavigableRepos } from '@/hooks/useSidebarRepoGroups'
import { NewSessionButton } from '@/components/navigation/RepoSessionNav'
import { isRepoReady } from '@/components/navigation/sidebar-session-tree'
import { getSessionPath } from '@/lib/navigation'
import { cn, getRepoBranchLabel, getRepoDisplayName } from '@/lib/utils'
import {
PickerSearchBar,
@@ -13,8 +16,10 @@ interface ProjectPickerContentProps {
open: boolean
currentRepo: Repo | undefined
onSelectRepo: (repo: Repo) => void
onNavigate: (path: string) => void
switchHint: string
searchInputRef: React.RefObject<HTMLInputElement | null>
searchTrailing?: React.ReactNode
}
interface ProjectPickerRow {
@@ -26,8 +31,10 @@ export function ProjectPickerContent({
open,
currentRepo,
onSelectRepo,
onNavigate,
switchHint,
searchInputRef,
searchTrailing,
}: ProjectPickerContentProps) {
const { repos, isLoading } = useNavigableRepos()
const listId = useId()
@@ -89,6 +96,7 @@ export function ProjectPickerContent({
onKeyDown={handleSearchKeyDown}
placeholder="Search projects..."
name="project-picker-search"
trailing={searchTrailing}
/>
<div
@@ -149,6 +157,16 @@ export function ProjectPickerContent({
</span>
)}
</div>
{isRepoReady(repo) ? (
<NewSessionButton
directory={repo.fullPath}
label={getRepoDisplayName(repo)}
sessionPath={(sessionId) => getSessionPath(repo.id, sessionId)}
onOpenSession={onNavigate}
/>
) : (
<span className="shrink-0 pr-2 text-xs text-muted-foreground">Not ready</span>
)}
</div>
)
})