From 84f0d6a49cc22fb8d42b29cee59de3abb7c91b06 Mon Sep 17 00:00:00 2001 From: tianma Date: Sat, 27 Jun 2026 17:48:55 +0800 Subject: [PATCH] Polish Evernote-style note selection --- apps/web/src/app/App.tsx | 170 ++++++++++++++++++++++++++++----------- 1 file changed, 122 insertions(+), 48 deletions(-) diff --git a/apps/web/src/app/App.tsx b/apps/web/src/app/App.tsx index cd224566..baf78aa8 100644 --- a/apps/web/src/app/App.tsx +++ b/apps/web/src/app/App.tsx @@ -19,6 +19,7 @@ import { Archive, ArrowDownWideNarrow, Bold, + Check, ChevronLeft, CheckSquare, ChevronDown, @@ -170,6 +171,8 @@ const MEMO_TEMPLATES: MemoTemplate[] = [ const MEMO_LONG_PRESS_DELAY_MS = 520; const MEMO_LONG_PRESS_MOVE_TOLERANCE_PX = 14; +const getSelectionCountLabel = (count: number) => (count > 0 ? `已选择 ${count} 条` : "选择笔记"); + const useDismissableLayer = (open: boolean, onClose: () => void) => { const ref = useRef(null); @@ -1013,7 +1016,7 @@ const WorkspaceApp = ({ {activePane !== "editor" && !memoSelectionModeActive ? ( setMobileNotebookPickerOpen(false)} @@ -1523,9 +1527,9 @@ const MobileBottomNav = ({ /> } label="我的" onClick={onOpenSettings} /> @@ -1864,7 +1871,7 @@ const MobileNotebookPickerItem = ({
- } - label="选择笔记" - onClick={onEnterSelectionMode} - /> + {!isSelectionMode ? ( + <> + } + label="选择笔记" + onClick={onEnterSelectionMode} + /> -
+
+ + ) : null}
显示方式
{memoListDensityOptions.map((option) => ( @@ -2003,8 +2020,12 @@ const MobileListActionsSheet = ({ {mobileSortOptions.map((option) => ( -
已选择 {selectedMemoIds.size} 条
+
{selectionCountLabel}
) : ( )} {listTitle} -
-
{listTitle}
-
- {listContextLabel} · - {listCountLabel} -
-
- @@ -3128,7 +3196,7 @@ const MemoListPane = ({ value={moveTargetNotebookId} disabled={view === "trash" || notebooks.length === 0 || isMoving} onChange={(event) => setMoveTargetNotebookId(event.target.value)} - title="移动到笔记本" + title={moveTargetTitle} > {moveNotebookOptions.map((item) => (