Context
A user expected to drag a Markdown file from Finder into the workspace and have the app open it for a one-off preview. The current external drag/drop path reaches the workspace, but openDroppedVaultPathsAtTarget only opens paths that already exist in vaultStore.entries, so files outside the vault are silently ignored.
Proposed behavior
- Dropping a supported external file from Finder onto an editor pane opens a temporary, read-only preview tab.
- The file is not copied into the vault.
- The file is not added to the file tree.
- The tab is not persisted/restored across sessions.
- The tab does not participate in autosave, dirty state, inline review, agent edited-files, or accept/reject change flows.
- If the dropped file is already inside the vault, keep the existing behavior and open it as a normal vault-backed tab.
- If the drop lands on a file tree folder, keep the existing behavior and copy the external file into that folder.
Initial scope
Support Markdown/text-like files first, especially .md, .mdx, .txt, and other safe text formats. The header can identify the tab as External Preview and expose Open Externally / Reveal in Finder actions.
Implementation notes
- Model this explicitly as a temporary/read-only external preview instead of treating it as a normal editable vault file.
- Avoid routing external preview tabs through
useEditableFileResource, because that flow assumes relativePath is vault-scoped and saves via save_vault_file.
- Add a small backend read command for external preview metadata/content, with file existence/type validation and size limits.
Edge cases to cover
- External file dropped onto workspace pane opens a preview.
- External file dropped onto file tree folder copies into the vault instead.
- Vault file dragged from Finder opens as a normal vault tab.
- Multiple dropped files preserve order and insert consecutive tabs.
- Pane-edge drops create/use split panes correctly.
- Large text files are truncated or rejected without freezing the UI.
- Unsupported binaries/directories do not get read as text.
- Deleted/moved external files fail gracefully for
Open Externally and Reveal in Finder.
- External previews are excluded from session restore, review state, autosave, and agent change tracking.
Context
A user expected to drag a Markdown file from Finder into the workspace and have the app open it for a one-off preview. The current external drag/drop path reaches the workspace, but
openDroppedVaultPathsAtTargetonly opens paths that already exist invaultStore.entries, so files outside the vault are silently ignored.Proposed behavior
Initial scope
Support Markdown/text-like files first, especially
.md,.mdx,.txt, and other safe text formats. The header can identify the tab asExternal Previewand exposeOpen Externally/Reveal in Finderactions.Implementation notes
useEditableFileResource, because that flow assumesrelativePathis vault-scoped and saves viasave_vault_file.Edge cases to cover
Open ExternallyandReveal in Finder.