Improve dnd + embeds - #30
Open
paulsonnentag wants to merge 9 commits into
Open
Conversation
Show a drop cursor while dragging over the editor, and put dropped embeds on their own line when dropped into a line with content.
New `embed` package (TypeScript + vite) registers an unlisted wildcard patchwork:tool that renders the embed chrome (live title with rename, open-with tool picker, open button) around a nested patchwork-view. codemirror-markdown and tldraw4 now mount it via tool-id="embed" instead of each hand-rolling the same titlebar, and persist tool picks from its patchwork:embed-tool-changed event (marker text / shape props).
Collaborator
✅ Patchwork glance readyhttps://patchwork-preview-30--patchwork-base.netlify.appPatchwork from |
Drop the search box (and its filtering, keyboard nav, and forcing of arbitrary tool ids) in favor of a simple click-to-pick list. When the host doesn't pin a tool, show the doc's fallback tool as the current selection instead of a special "Open with..." placeholder state.
Two fixes for the shared embed frame: - Read embed-tool-id from the outer <patchwork-view> too: tools receive the inner <patchwork-view-legacy> element, which never carries the attribute, so every remount silently dropped the pinned tool back to the fallback. - Hosts (codemirror widget, tldraw shape) stop propagation of patchwork:embed-tool-changed once handled, so a pick inside a nested embed no longer also rewrites the outer embed's tool. Also show the embed package version in the frame header as a deploy check.
Trim the comments added on this branch down to their load-bearing content across the embed package, codemirror-markdown, and tldraw4.
Replace the imperative DOM construction and manual re-render calls in the embed tool with a Solid component: signals for doc/datatype/pinned tool drive the title, rename input, tool button, and picker menu reactively. Behavior and CSS are unchanged; solid-js resolves through the importmap as a bootloader external.
paulsonnentag
marked this pull request as ready for review
July 28, 2026 14:02
pnpm install never wrote the new workspace project into pnpm-lock.yaml, so CI's frozen-lockfile install failed. Importer entry written against the already-pinned snapshots (the subduction sync server that the patchwork pnpm plugin needs for re-resolving automerge: deps is currently down, blocking a regular lockfile regeneration); verified locally with pnpm install --frozen-lockfile passing lockfile validation.
Member
|
is copy the right cursor icon for this? i wonder if we'd be better off using |
Contributor
Author
I'll add this |
…Effect=link in codemirror and tldraw, tldraw drops get random shape ids instead of url-derived ones
Contributor
Author
…reates the nested view imperatively; reword an embed comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Shared embed between tldraw and codemirror
Nicer drag and drop in markdown