MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / toggleExpand

Function toggleExpand

frontend/app/treeview/treeview.tsx:337–356  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

335 };
336
337 const toggleExpand = (id: string) => {
338 const node = nodesById.get(id);
339 if (node == null || !node.isDirectory || node.notfound || node.staterror) {
340 return;
341 }
342 const expanded = expandedIds.has(id);
343 if (!expanded) {
344 loadChildren(id);
345 }
346 setExpandedIds((prev) => {
347 const next = new Set(prev);
348 if (expanded) {
349 next.delete(id);
350 } else {
351 next.add(id);
352 }
353 return next;
354 });
355 scrollToId(id);
356 };
357
358 const selectVisibleNodeAt = (index: number) => {
359 if (index < 0 || index >= visibleRows.length) {

Callers 2

onKeyDownFunction · 0.85
treeview.tsxFile · 0.85

Calls 4

loadChildrenFunction · 0.85
scrollToIdFunction · 0.85
getMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected