MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / SetupSidebar

Function SetupSidebar

ai-code-studio/src/components/SetupSidebar.tsx:129–239  ·  view source on GitHub ↗
({
  snapshot,
  config,
  setupReady,
  showSettings,
  appInfo,
  isTestingConnection,
  setupChecklist,
  onReset,
  onRefreshSessions,
  onTestConnection,
  onToggleSettings,
  onOpenWizard,
  onOpenAbout,
  onSelectSession,
  onRenameSession,
  onDeleteSession,
  onOpenMemory,
}: SetupSidebarProps)

Source from the content-addressed store, hash-verified

127};
128
129export function SetupSidebar({
130 snapshot,
131 config,
132 setupReady,
133 showSettings,
134 appInfo,
135 isTestingConnection,
136 setupChecklist,
137 onReset,
138 onRefreshSessions,
139 onTestConnection,
140 onToggleSettings,
141 onOpenWizard,
142 onOpenAbout,
143 onSelectSession,
144 onRenameSession,
145 onDeleteSession,
146 onOpenMemory,
147}: SetupSidebarProps) {
148 const [search, setSearch] = useState('');
149 const running = snapshot.run.status === 'running';
150 const hasQueuedOrApproval =
151 Boolean(snapshot.run.pendingApproval) || (snapshot.run.queue?.length || 0) > 0;
152 const busy = running || hasQueuedOrApproval;
153 const selectedSession =
154 snapshot.sessions.items.find(item => item.sessionId === snapshot.sessions.selectedSessionId) || null;
155
156 const currentPreset =
157 providerPresets.find(
158 preset =>
159 preset.upstreamBaseUrl === config.upstreamBaseUrl &&
160 preset.upstreamModel === config.upstreamModel,
161 ) || null;
162
163 const filteredSessions = useMemo(() => {
164 const keyword = search.trim().toLowerCase();
165 if (!keyword) {
166 return snapshot.sessions.items;
167 }
168 return snapshot.sessions.items.filter(session =>
169 `${session.summary || ''} ${session.sessionId}`.toLowerCase().includes(keyword),
170 );
171 }, [search, snapshot.sessions.items]);
172
173 return (
174 <aside className="flex w-[260px] shrink-0 flex-col overflow-hidden border-r border-[#E8E0D4] bg-[#F7F4EC]">
175 <div className="h-[36px] shrink-0" style={{ WebkitAppRegion: 'drag' } as React.CSSProperties} />
176 <div className="px-3 pb-2">
177 <SidebarAction
178 icon={<Plus size={16} />}
179 label="New session"
180 disabled={busy}
181 onClick={busy ? undefined : onReset}
182 />
183 <SidebarAction
184 icon={<Brain size={16} />}
185 label="Memory"
186 onClick={onOpenMemory}

Callers

nothing calls this directly

Calls 1

labelForRunStatusFunction · 0.90

Tested by

no test coverage detected