Skip to content

fix: insert only plain text when dropping onto a note - #193

Merged
polyrainbow merged 1 commit into
mainfrom
fix/pinned-note-drop-extra-text
Oct 7, 2026
Merged

polyrainbow merged 1 commit into
mainfrom
fix/pinned-note-drop-extra-text

Conversation

@polyrainbow

Copy link
Copy Markdown
Owner

Problem

Dragging a pinned note from the header into the editor inserted the note's wikilink followed by stray characters.

The note's drop handler inserted every string item of the drag. A drag can carry several string items besides text/plain, such as text/uri-list and text/html, and the browser can add private items of its own. The pinned note sets only text/plain (the wikilink), so the extra text came from those other items.

Fix

handleDrop in src/components/Note.tsx now inserts only the text/plain item. File items still go through the unchanged kind === "file" branch, so a dropped image is still added to the graph with its .subtext sidecar, and its slug is inserted.

Side effect: text dropped in from another app is now inserted once, as plain text. Before, the app's link or HTML version of the same text was inserted next to it.

Testing

  • ESLint and tsc pass.
  • Not yet tested with a real drag in the app. To check: drag a pinned note into a note and confirm only the wikilink is inserted, then drop a JPG and confirm it is added as a file.

🤖 Generated with Claude Code

Dragging a pinned note into the editor inserted its wikilink followed
by stray characters: the drop handler inserted every string item of
the drag, including flavors other than text/plain. Only the text/plain
item is inserted now; dropped files are handled as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@polyrainbow
polyrainbow merged commit 64efa78 into main Oct 7, 2026
6 checks passed
@polyrainbow
polyrainbow deleted the fix/pinned-note-drop-extra-text branch October 7, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant