Skip to content

Text dropped on a page becomes a text box (#288) - #294

Merged
Joost-8 merged 1 commit into
mainfrom
claude/issue-288-drag-text-2cdd0e
Nov 22, 2026
Merged

Joost-8 merged 1 commit into
mainfrom
claude/issue-288-drag-text-2cdd0e

Conversation

@Joost-8

@Joost-8 Joost-8 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Discussion #288: paragraphs dragged from another app (Zotero beside Obsidian in Split View) did nothing on a notebook. They worked in a plain .md note.

What changed

  • Text dropped on a notebook page or a board becomes a text box where it lands. It is one undo step and comes in selected, like a paste. Between pages, it goes on the page in view.
  • Plain text is used as it is. A drag that carries only HTML is reduced to text, keeping paragraphs, line breaks and list items (src/view/drop-text.ts, pure, with tests).
  • These keep their old behaviour: dropped files, pictures and PDFs, drags from Obsidian's file list, and [[links]] or obsidian:// links to vault files. A text box you are typing in takes the drop itself. Practice files, PDF tabs and read-only notebooks refuse it, as they refuse a paste.
  • Second cause, found in the real-Obsidian rig with mobile on: on mobile, Obsidian's drag manager sets dropEffect = "move" on every dragover. A drag that only allows a copy was then refused before any drop event fired. The notebook's dragover (and the drawer backdrop's, over the notebook) now sets copy for drags from outside Obsidian.
  • The debug overlay has its own drag and drop lines. The drag line shows the types, effectAllowed, and whether it is Obsidian's own drag. The drop line shows the target, what the drop carried, and what it became (text box, file, refused or nothing).

Unproven on the iPad

I couldn't test a drop from another app on the device. Two things are unknown:

  • whether iPadOS passes that drop into Obsidian's WebView at all;
  • whether it uses the same effectAllowed as the rig's drag.

The HUD lines will answer both from one screen recording.

How to test

  1. Install the build and turn on the input debug overlay (command "Toggle input debug overlay").
  2. On the iPad, open a notebook beside Safari or Zotero in Split View. Select a paragraph, drag it onto a page and drop it.
    • Expected: a text box at the drop point, selected. Undo removes it.
    • If nothing happens: a recording of the HUD's drag and drop lines. No drag line means iPadOS never handed the drag to Obsidian.
  3. Do the same on a board.
  4. Regression check: drag a PDF and a picture from Obsidian's file list (with the drawer open) onto the notebook. They import as before, with no text box.

Rig checks done (desktop and mobile on):

  • text and HTML drops on a page and on a board;
  • a text drop over the open drawer's backdrop;
  • undo;
  • [[red.png]] dropped as text imports the picture;
  • a file-list drag of a picture still imports it.

CI gates all pass locally: lint, review lint, CSS lint, typecheck, build and tests. One test failed, but only in this worktree: it reads node_modules/onnxruntime-web from the working directory, and the worktree has no node_modules of its own.

🤖 Generated with Claude Code

Paragraphs dragged from another app (Zotero beside Obsidian in Split
View) become a text box at the drop point, on a notebook page or a
board: one undo step, selected, as a paste makes. HTML alone is reduced
to text. Files, pictures, PDFs, vault links and Obsidian's own drags
keep their handling; a text box being typed in keeps its own drop.

Found in the real-Obsidian rig with `mobile on`: Obsidian's mobile drag
manager sets dropEffect "move" on every dragover, and a drag that only
allows a copy was refused before any drop event. The notebook now sets
"copy" for drags from outside Obsidian (view and drawer backdrop).

The debug HUD gets its own drag and drop lines (types, effectAllowed,
target, outcome) so a recording settles whether iPadOS hands a drop from
another app to Obsidian's WebView at all; that is unproven.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Joost-8
Joost-8 merged commit dc0b2e2 into main Nov 22, 2026
1 check passed
@Joost-8
Joost-8 deleted the claude/issue-288-drag-text-2cdd0e branch November 22, 2026 20:28
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