Skip to content

ENG-1373: Drag pages onto the canvas to create node shapes#1083

Open
sid597 wants to merge 2 commits into
mainfrom
eng-1373-drag-and-drop-pages-to-canvas
Open

ENG-1373: Drag pages onto the canvas to create node shapes#1083
sid597 wants to merge 2 commits into
mainfrom
eng-1373-drag-and-drop-pages-to-canvas

Conversation

@sid597
Copy link
Copy Markdown
Collaborator

@sid597 sid597 commented May 25, 2026

No description provided.

Page refs aren't draggable by default, so make them draggable via the
existing rm-page-ref observer and route the drag payload through the canvas
text-content handler that already turns [[name]] into a discourse-node shape.

- Always-on: only the draggable attribute is global; the drag payload and
  drop handling live in the canvas component, so drags are inert unless a
  canvas is open.
- Custom MIME (application/x-roam-page), not text/plain, so a drag can't leak
  [[title]] into other blocks or apps.
- Guard the existing block-dragstart so dragging a ref doesn't also attach its
  containing block's UID.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 25, 2026

ENG-1373

@supabase
Copy link
Copy Markdown

supabase Bot commented May 25, 2026

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 014d57e942

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

onPageRefObserverChange(overlayHandler)(true);
}

onPageRefObserverChange(makePageRefDraggable)(true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Scope page-ref dragging to canvas interactions

Enabling onPageRefObserverChange(makePageRefDraggable)(true) unconditionally at startup makes every .rm-page-ref in Roam draggable, not just refs involved in canvas drops. In practice this changes normal editor behavior: click-drag gestures on page refs (including in regular blocks) start HTML drag operations, which interferes with expected text selection/editing flows outside the canvas. This regression is user-facing across the app and should be gated to canvas-specific contexts or a dedicated drag handle.

Useful? React with 👍 / 👎.

The always-on registration had no matching teardown, so the singleton
rm-page-ref observer and the makePageRefDraggable callback survived extension
unload/reload. Add a cleanup that unregisters the handler; for users without
the overlay/preview/suggestive handlers this empties the set and disconnects
the observer.
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