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 1/2] 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} +
Date: Sun, 4 Jan 2026 10:48:45 +0800 Subject: [PATCH 2/2] chore(note_grid): remove unused tree import --- apps/client/src/widgets/collections/legacy/ListOrGridView.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx index 136a8f225..5b0d47d97 100644 --- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx @@ -7,7 +7,6 @@ import attribute_renderer from "../../../services/attribute_renderer"; import content_renderer from "../../../services/content_renderer"; import { t } from "../../../services/i18n"; import link from "../../../services/link"; -import tree from "../../../services/tree"; import { useImperativeSearchHighlighlighting, useNoteLabel, useNoteLabelBoolean } from "../../react/hooks"; import Icon from "../../react/Icon"; import NoteLink from "../../react/NoteLink";