diff --git a/packages/ui/src/components/session/SessionSidebar.tsx b/packages/ui/src/components/session/SessionSidebar.tsx index bb3a2355..69cce2ec 100644 --- a/packages/ui/src/components/session/SessionSidebar.tsx +++ b/packages/ui/src/components/session/SessionSidebar.tsx @@ -178,9 +178,6 @@ export const SessionSidebar: React.FC = ({ const [editTitle, setEditTitle] = React.useState(''); const [editingProjectDialogId, setEditingProjectDialogId] = React.useState(null); const [expandedParents, setExpandedParents] = React.useState>(new Set()); - const [directoryStatus] = React.useState>( - () => new Map(), - ); const safeStorage = React.useMemo(() => getSafeStorage(), []); const [collapsedProjects, setCollapsedProjects] = React.useState>(new Set()); @@ -1233,7 +1230,6 @@ export const SessionSidebar: React.FC = ({ groupDirectory={groupDirectory} projectId={projectId} archivedBucket={archivedBucket} - directoryStatus={directoryStatus} currentSessionId={currentSessionId} pinnedSessionIds={pinnedSessionIds} expandedParents={expandedParents} @@ -1272,7 +1268,6 @@ export const SessionSidebar: React.FC = ({ /> ), [ - directoryStatus, currentSessionId, pinnedSessionIds, expandedParents, diff --git a/packages/ui/src/components/session/sidebar/DOCUMENTATION.md b/packages/ui/src/components/session/sidebar/DOCUMENTATION.md index 7f0ee4c1..c699c331 100644 --- a/packages/ui/src/components/session/sidebar/DOCUMENTATION.md +++ b/packages/ui/src/components/session/sidebar/DOCUMENTATION.md @@ -39,7 +39,6 @@ - `hooks/useSessionActions.ts`: Centralizes session row actions (select/open, rename, share/unshare, archive/delete, confirmations). - `hooks/useSessionSearchEffects.ts`: Handles search open/close UX and input focus behavior. - `hooks/useSessionPrefetch.ts`: Prefetches messages for nearby/active sessions to improve perceived load speed. -- `hooks/useDirectoryStatusProbe.ts`: Probes and caches directory existence status for session/path indicators. - `hooks/useSessionGrouping.ts`: Builds grouped session structures and search text/filter helpers. - `hooks/useSessionSidebarSections.ts`: Composes final per-project sections and group search metadata for rendering. - `hooks/useProjectSessionSelection.ts`: Resolves active/current project-session selection logic and session-directory context. diff --git a/packages/ui/src/components/session/sidebar/SessionNodeItem.tsx b/packages/ui/src/components/session/sidebar/SessionNodeItem.tsx index 5a63746c..5db883a5 100644 --- a/packages/ui/src/components/session/sidebar/SessionNodeItem.tsx +++ b/packages/ui/src/components/session/sidebar/SessionNodeItem.tsx @@ -51,7 +51,6 @@ type Props = { groupDirectory?: string | null; projectId?: string | null; archivedBucket?: boolean; - directoryStatus: Map; currentSessionId: string | null; pinnedSessionIds: Set; expandedParents: Set; @@ -65,7 +64,7 @@ type Props = { handleSaveEdit: () => void; handleCancelEdit: () => void; toggleParent: (expansionKey: string) => void; - handleSessionSelect: (sessionId: string, sessionDirectory: string | null, isMissingDirectory: boolean, projectId?: string | null) => void; + handleSessionSelect: (sessionId: string, sessionDirectory: string | null, projectId?: string | null) => void; handleSessionDoubleClick: (sessionId: string, sessionTitle: string) => void; togglePinnedSession: (sessionId: string) => void; handleShareSession: (session: Session) => void; @@ -202,7 +201,6 @@ const areEqual = (prev: Props, next: Props): boolean => { const nextDirectory = normalizePath((nextSession as Session & { directory?: string | null }).directory ?? null) ?? normalizePath(next.groupDirectory ?? null); if (prevDirectory !== nextDirectory) return false; - if ((prevDirectory ? prev.directoryStatus.get(prevDirectory) : null) !== (nextDirectory ? next.directoryStatus.get(nextDirectory) : null)) return false; if ((prev.secondaryMeta?.projectLabel ?? null) !== (next.secondaryMeta?.projectLabel ?? null)) return false; if ((prev.secondaryMeta?.branchLabel ?? null) !== (next.secondaryMeta?.branchLabel ?? null)) return false; @@ -222,7 +220,6 @@ function SessionNodeItemComponent(props: Props): React.ReactNode { groupDirectory, projectId, archivedBucket = false, - directoryStatus, currentSessionId, pinnedSessionIds, expandedParents, @@ -351,8 +348,6 @@ function SessionNodeItemComponent(props: Props): React.ReactNode { ); const sessionStatus = useGlobalSessionStatus(session.id); const sessionPermissions = useSessionPermissions(session.id, sessionDirectory ?? undefined); - const directoryState = sessionDirectory ? directoryStatus.get(sessionDirectory) : null; - const isMissingDirectory = directoryState === 'missing'; const isActive = currentSessionId === session.id; const sessionTitle = resolvedSession.title || t('sessions.sidebar.session.untitled'); const hasChildren = node.children.length > 0; @@ -718,7 +713,7 @@ function SessionNodeItemComponent(props: Props): React.ReactNode { toggleRowSelected(session.id, sessionDirectory ?? null, collectNodeDescendantIds(node)); return; } - handleSessionSelect(session.id, sessionDirectory, isMissingDirectory, projectId); + handleSessionSelect(session.id, sessionDirectory, projectId); }; const handleRowMouseDown = (event: React.MouseEvent) => { @@ -955,7 +950,6 @@ function SessionNodeItemComponent(props: Props): React.ReactNode { // stays put. '-ml-3', depth > 0 ? 'pl-[32px]' : 'pl-[18px]', - isMissingDirectory ? 'opacity-75' : '', // Active (currently open) session gets a subtle primary tint; // multi-select highlight takes precedence when both apply. isActive && !isRowSelected && 'bg-primary/10', @@ -972,18 +966,17 @@ function SessionNodeItemComponent(props: Props): React.ReactNode {