From 1e36175f294cd00d25e8fbae752eb4b6a434bbb0 Mon Sep 17 00:00:00 2001 From: tianma-if Date: Wed, 12 Aug 2026 18:21:43 +0800 Subject: [PATCH] fix(web): refine memo menu interactions --- apps/web/src/components/EditorPane.tsx | 2 +- apps/web/src/components/MemoCard.tsx | 1 + apps/web/src/components/MemoListPane.tsx | 20 +++++++++++----- apps/web/src/components/ui/context-menu.tsx | 8 +++---- apps/web/src/components/ui/dropdown-menu.tsx | 8 +++---- apps/web/src/components/ui/select.tsx | 2 +- tests/e2e/dark-mode.spec.ts | 24 ++++++++++++++++++++ tests/e2e/memo-list-actions.spec.ts | 21 +++++++++++++++++ 8 files changed, 70 insertions(+), 16 deletions(-) create mode 100644 tests/e2e/memo-list-actions.spec.ts diff --git a/apps/web/src/components/EditorPane.tsx b/apps/web/src/components/EditorPane.tsx index ecf51749..a06701af 100644 --- a/apps/web/src/components/EditorPane.tsx +++ b/apps/web/src/components/EditorPane.tsx @@ -3814,7 +3814,7 @@ const RichEditorPane = ({ onValueChange={(value) => handleNotebookChange(value)} > - + {currentNotebookLabel} {notebookOptions.map((notebook) => ( diff --git a/apps/web/src/components/MemoCard.tsx b/apps/web/src/components/MemoCard.tsx index 60ec7738..bee8af77 100644 --- a/apps/web/src/components/MemoCard.tsx +++ b/apps/web/src/components/MemoCard.tsx @@ -413,6 +413,7 @@ export const MemoCard = ({ title={t("memoCard.moreActions")} aria-label={t("memoCard.moreActions")} aria-haspopup="menu" + data-memo-actions-trigger onClick={(event) => { event.stopPropagation(); onOpenKeyboardContextMenu(event.currentTarget); diff --git a/apps/web/src/components/MemoListPane.tsx b/apps/web/src/components/MemoListPane.tsx index cfdd3ccc..9d346eba 100644 --- a/apps/web/src/components/MemoListPane.tsx +++ b/apps/web/src/components/MemoListPane.tsx @@ -9,6 +9,7 @@ import { type KeyboardEvent as ReactKeyboardEvent, type ReactNode, } from "react"; +import { createPortal } from "react-dom"; import { useTranslation } from "react-i18next"; import * as m from "motion/react-m"; import { @@ -140,9 +141,13 @@ export const MemoSelectionActionBar = ({ onMoveTargetChange: (notebookId: string) => void; }) => { const { t } = useTranslation(); + const selectedMoveNotebookName = moveNotebookOptions.find((item) => item.id === moveTargetNotebookId)?.name; return ( -
+
@@ -153,7 +158,7 @@ export const MemoSelectionActionBar = ({