Skip to content

ENG-1792: Add edit block button to rendered dg-canvas#1203

Open
sid597 wants to merge 3 commits into
mainfrom
eng-1792-add-edit-block-button-to-rendered-dg-canvas
Open

ENG-1792: Add edit block button to rendered dg-canvas#1203
sid597 wants to merge 3 commits into
mainfrom
eng-1792-add-edit-block-button-to-rendered-dg-canvas

Conversation

@sid597

@sid597 sid597 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

https://www.loom.com/share/5a61fddb73824341865e254fb3431243

Adds a minimal Blueprint edit button overlaid top-right on the embedded canvas that focuses the underlying {{dg-canvas}} block via setBlockFocusAndSelection, using the same getUids/.roam-block idiom as the ResultsView Edit Block action so it also works for canvases in the right sidebar.

Fixes ENG-1792


Open in Devin Review

Overlay Button on the embedded canvas that focuses the underlying
{{dg-canvas}} block via setBlockFocusAndSelection, using the same
getUids/.roam-block idiom as the ResultsView Edit Block action so it
works in the right sidebar too.
@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

ENG-1792

@supabase

supabase Bot commented Jul 6, 2026

Copy link
Copy Markdown

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 ↗︎.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jul 6, 2026 3:39pm

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread apps/roam/src/components/canvas/CanvasEmbed.tsx Outdated
Comment thread apps/roam/src/components/canvas/CanvasEmbed.tsx
Review follow-up: getUids accepts a null element and returns empty
ids, so use the closest() generic instead of a non-null assertion.
@sid597

sid597 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

The crash claim is incorrect: getUids (roamjs-components/dom/getUids) accepts a null element and returns { blockUid: "", windowId: "" }, so a missing .roam-block ancestor makes the edit button a no-op, not a render crash — same failure mode as the identical idiom in ResultsView. The cast was misleading about nullability though, so d53a010 switches to the closest() generic, which types the lookup as nullable with no assertion.

On the button hit area over the canvas: acknowledged — it mirrors the existing bottom-right sync-icon overlay, and the top-right corner sits outside tldraw's own toolbar zones. Will verify interaction in the demo recording.

Top right overlaps the tldraw style panel; bottom right is the corner
the plugin already uses for its cloud sync icon, offset left so both
fit.
@sid597 sid597 requested a review from mdroidian July 6, 2026 15:48
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