MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ProjectsPanel

Function ProjectsPanel

graph-ui/src/projects/ProjectsPanel.tsx:142–857  ·  view source on GitHub ↗
(props: ProjectsPanelProps)

Source from the content-addressed store, hash-verified

140}
141
142export default function ProjectsPanel(props: ProjectsPanelProps): JSX.Element {
143 const { source, project } = props;
144 const pollMs = props.pollMs ?? POLL_MS;
145 const root = useRef<HTMLDivElement | null>(null);
146 const mounted = useRef(true);
147
148 // ------------------------------------------------------------ the list --
149 const [projects, setProjects] = useState<ProjectEntry[] | undefined>(undefined);
150 const [listError, setListError] = useState('');
151 const [listNotice, setListNotice] = useState('');
152 const [health, setHealth] = useState<Record<string, HealthState>>({});
153 const [armed, setArmed] = useState('');
154
155 // ------------------------------------------------------------ the form --
156 const [path, setPath] = useState('');
157 const [name, setName] = useState('');
158 const [nameTouched, setNameTouched] = useState(false);
159 const [browseLevel, setBrowseLevel] = useState<BrowseLevel | undefined>(undefined);
160 const [browseError, setBrowseError] = useState('');
161 const [startNotice, setStartNotice] = useState('');
162 const [jobs, setJobs] = useState<IndexJob[]>([]);
163 const jobsRef = useRef<IndexJob[]>([]);
164
165 // ------------------------------------------------------------- the adr --
166 const [adr, setAdr] = useState<{ state: 'idle' | 'loading' | 'ready' | 'error'; record?: AdrRecord; detail: string }>({
167 state: 'idle',
168 detail: '',
169 });
170 const [adrDraft, setAdrDraft] = useState('');
171 const [adrNotice, setAdrNotice] = useState('');
172
173 // ---------------------------------------------------------- the server --
174 const [processes, setProcesses] = useState<ProcessReport | undefined>(undefined);
175 const [processesError, setProcessesError] = useState('');
176 const [logs, setLogs] = useState<LogTail | undefined>(undefined);
177 const [logsError, setLogsError] = useState('');
178 const [uiLog, setUiLog] = useState<UiLogTail | undefined>(undefined);
179 const [uiLogError, setUiLogError] = useState('');
180
181 useEffect(() => {
182 mounted.current = true;
183 root.current?.focus();
184 return () => {
185 mounted.current = false;
186 };
187 }, []);
188
189 const loadProjects = useCallback(async () => {
190 try {
191 const list = await source.listProjects();
192 if (!mounted.current) {
193 return;
194 }
195 setProjects(list);
196 setListError('');
197 } catch (error) {
198 if (mounted.current) {
199 setListError(text.listError(describeError(error)));

Callers

nothing calls this directly

Calls 15

finishedSinceFunction · 0.90
anyIndexingFunction · 0.90
childPathFunction · 0.90
describeErrorFunction · 0.85
loadProjectsFunction · 0.85
removeFunction · 0.85
healthSentenceFunction · 0.85
changePathFunction · 0.85
jobSentenceFunction · 0.85
saveAdrFunction · 0.85
checkFunction · 0.70
startFunction · 0.70

Tested by

no test coverage detected