diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx index 276cd432..a94b1177 100644 --- a/apps/mobile/src/screens/WorkspaceScreen.tsx +++ b/apps/mobile/src/screens/WorkspaceScreen.tsx @@ -1991,6 +1991,7 @@ const NotebookManagerModal = ({ }) => { const { client } = useSession(); const queryClient = useQueryClient(); + const createNotebookInputRef = useRef(null); const [name, setName] = useState(""); const [parentId, setParentId] = useState(null); const [editingNotebookId, setEditingNotebookId] = useState(null); @@ -2072,6 +2073,12 @@ const NotebookManagerModal = ({ ]); }; + const prepareCreateChildNotebook = (notebook: Notebook) => { + setParentId(notebook.id); + setName(""); + setTimeout(() => createNotebookInputRef.current?.focus(), 50); + }; + return ( @@ -2086,7 +2093,7 @@ const NotebookManagerModal = ({ 新建笔记本 - + createNotebookMutation.mutate()} @@ -2168,6 +2175,11 @@ const NotebookManagerModal = ({ )} + {!editing ? ( + prepareCreateChildNotebook(notebook)}> + + + ) : null} requestDeleteNotebook(notebook)}>