From 7373bcb00e704b952cb9d9cd4d30ee36a70e836f Mon Sep 17 00:00:00 2001 From: roundaboutpi Date: Wed, 24 Jun 2026 15:16:46 -0700 Subject: [PATCH] feat(ui): add collapse all / expand all toggle to DocList --- src/ui/src/components/DocList.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ui/src/components/DocList.tsx b/src/ui/src/components/DocList.tsx index 9d3a91f..ae97cbc 100644 --- a/src/ui/src/components/DocList.tsx +++ b/src/ui/src/components/DocList.tsx @@ -422,6 +422,12 @@ export function DocList() { return n; }); + // Collapse/expand every section at once. allCollapsed reflects current state so + // the single button flips its action and label. + const allCollapsed = sections.length > 0 && sections.every((s) => collapsedSections.has(s.label)); + const collapseAll = () => setCollapsedSections(new Set(sections.map((s) => s.label))); + const expandAll = () => setCollapsedSections(new Set()); + const selectStyle: React.CSSProperties = { width: 'auto' }; return ( @@ -573,6 +579,16 @@ export function DocList() { )) )} + {!search && sections.length > 0 && ( + + )} {/* List */}