From eb278f3a11df30b83884faeeea23a4dbdbb2f0fc Mon Sep 17 00:00:00 2001 From: yoma Date: Thu, 9 Jul 2026 05:35:37 +0800 Subject: [PATCH] Add mobile notebook expand controls --- apps/mobile/src/screens/WorkspaceScreen.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx index d7e3549b..34dd534a 100644 --- a/apps/mobile/src/screens/WorkspaceScreen.tsx +++ b/apps/mobile/src/screens/WorkspaceScreen.tsx @@ -2051,6 +2051,7 @@ const NotebookManagerModal = ({ const notebookOptions = flattenNotebooks(notebooks, notebookSortMode); const notebookSearchQuery = notebookSearchText.trim(); const childNotebookIds = getNotebookParentIdSet(notebooks); + const hasCollapsibleNotebooks = childNotebookIds.size > 0; const visibleNotebookOptions = notebookSearchQuery ? filterNotebookOptions(notebookOptions, notebookSearchText) : filterCollapsedNotebookOptions(notebookOptions, collapsedNotebookIds); @@ -2147,6 +2148,14 @@ const NotebookManagerModal = ({ }); }; + const collapseAllNotebooks = () => { + setCollapsedNotebookIds(new Set(childNotebookIds)); + }; + + const expandAllNotebooks = () => { + setCollapsedNotebookIds(new Set()); + }; + return ( @@ -2204,6 +2213,12 @@ const NotebookManagerModal = ({ onSortModeChange("memo-count-desc")} /> onSortModeChange("updated-desc")} /> + {hasCollapsibleNotebooks && !notebookSearchQuery ? ( + + + + + ) : null} {visibleNotebookOptions.map(({ depth, notebook }) => { const editing = editingNotebookId === notebook.id; const parentOptions = notebookOptions.filter((option) => option.notebook.id !== notebook.id && !isNotebookDescendant(notebooks, option.notebook.id, notebook.id));