diff --git a/eslint.config.mjs b/eslint.config.mjs index fb235290..1b7ad4e4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -74,7 +74,7 @@ export default [ // obsidianmd: defer to follow-up PRs "obsidianmd/vault/iterate": "error", - "obsidianmd/prefer-active-doc": "off", + "obsidianmd/prefer-active-doc": "error", "obsidianmd/object-assign": "off", "obsidianmd/ui/sentence-case": "off", "obsidianmd/no-unsupported-api": "off", diff --git a/src/components/chat-components/RelevantNotes.tsx b/src/components/chat-components/RelevantNotes.tsx index 117f432a..43926fd1 100644 --- a/src/components/chat-components/RelevantNotes.tsx +++ b/src/components/chat-components/RelevantNotes.tsx @@ -112,7 +112,7 @@ function RelevantNote({ const loadContent = useCallback(async () => { if (fileContent) return; // Don't load if we already have content - const file = app.vault.getAbstractFileByPath(note.document.path); + const file = app.vault.getAbstractFileByPath(note.note.path); if (file instanceof TFile) { const content = await app.vault.cachedRead(file); @@ -128,7 +128,7 @@ function RelevantNote({ // Take first 1000 characters as preview setFileContent(cleanContent.slice(0, 1000) + (cleanContent.length > 1000 ? "..." : "")); } - }, [fileContent, note.document.path]); + }, [fileContent, note.note.path]); useEffect(() => { if (isOpen) { @@ -161,7 +161,7 @@ function RelevantNote({ { - const file = app.vault.getAbstractFileByPath(note.document.path); + const file = app.vault.getAbstractFileByPath(note.note.path); if (file instanceof TFile) { handleDragStart(e, file); } @@ -179,9 +179,9 @@ function RelevantNote({ } }} className="tw-block tw-w-full tw-truncate tw-text-sm tw-font-bold tw-text-normal" - title={`${note.document.title} - drag to insert wikilink`} + title={`${note.note.title} - drag to insert wikilink`} > - {note.document.title} + {note.note.title} @@ -198,7 +198,7 @@ function RelevantNote({
- {note.document.path} + {note.note.path}
{fileContent && (
@@ -243,11 +243,11 @@ function RelevantNotePopover({ children: React.ReactNode; }) { return ( - + {children} - {note.document.title} - {note.document.path} + {note.note.title} + {note.note.path}