From b23252d04605a311013339b797c9b61c4700f044 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Sun, 4 Jan 2026 10:25:43 +0800 Subject: [PATCH] fix(note_grid): the note grid cannot open the context menu --- .../src/widgets/collections/legacy/ListOrGridView.css | 6 ++++++ .../src/widgets/collections/legacy/ListOrGridView.tsx | 11 +---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.css b/apps/client/src/widgets/collections/legacy/ListOrGridView.css index c6b21c0b1..1bfa389e5 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.css +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.css @@ -142,4 +142,10 @@ border: 1px solid var(--main-border-color); background: var(--more-accented-background-color); } + +.note-list.grid-view .note-path { + margin-left: 0.5em; + vertical-align: middle; + opacity: 0.5; +} /* #endregion */ diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index 8180e6d65..136a8f225 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -103,16 +103,7 @@ function ListNoteCard({ note, parentNote, highlightedTokens, currentLevel, expan } function GridNoteCard({ note, parentNote, highlightedTokens }: { note: FNote, parentNote: FNote, highlightedTokens: string[] | null | undefined }) { - const titleRef = useRef(null); - const [ noteTitle, setNoteTitle ] = useState(); const notePath = getNotePath(parentNote, note); - const highlightSearch = useImperativeSearchHighlighlighting(highlightedTokens); - - useEffect(() => { - tree.getNoteTitle(note.noteId, parentNote.noteId).then(setNoteTitle); - }, [ note ]); - - useEffect(() => highlightSearch(titleRef.current), [ noteTitle, highlightedTokens ]); return (
- {noteTitle} +