diff --git a/modules/ui/obsidian-notes-editor.js b/modules/ui/obsidian-notes-editor.js index 81878548..e8d5964f 100644 --- a/modules/ui/obsidian-notes-editor.js +++ b/modules/ui/obsidian-notes-editor.js @@ -44,15 +44,16 @@ async function findOrCreateNote(elementId, elementType, coordinates) { } if (matches.length === 1) { - // Single match - load it + // Single match - show dialog with option to use it or choose different one const match = matches[0]; const content = await ObsidianBridge.getNote(match.path); - return { + const noteData = { path: match.path, name: match.name, content, frontmatter: match.frontmatter }; + return await showSingleMatchDialog(noteData, elementId, elementType, coordinates); } // Multiple matches - show selection dialog @@ -99,6 +100,46 @@ async function showLinkedNoteDialog(note, elementId, elementType, coordinates) { }); } +async function showSingleMatchDialog(note, elementId, elementType, coordinates) { + return new Promise((resolve, reject) => { + alertMessage.innerHTML = ` +
✓ Found note by coordinates:
+Found a note near this location. You can use it or browse for a different one.
+