From d52f9f2a92795d619d0f2d3d16c7d3aaafe8c4ac Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 30 Aug 2025 19:07:06 +0300 Subject: [PATCH] chore(react/collections): highlighting in grid title --- apps/client/src/widgets/collections/legacy/ListView.tsx | 3 +++ apps/client/src/widgets/react/hooks.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/collections/legacy/ListView.tsx b/apps/client/src/widgets/collections/legacy/ListView.tsx index c25f4ac55..eb3ea1de0 100644 --- a/apps/client/src/widgets/collections/legacy/ListView.tsx +++ b/apps/client/src/widgets/collections/legacy/ListView.tsx @@ -87,11 +87,14 @@ function GridNoteCard({ note, parentNote, highlightedTokens }: { note: FNote, pa 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 (
{ + return (el: HTMLElement | null | undefined) => { if (!el || !highlightRegex) return; if (!mark.current) {