Skip to content

ENG-1990: Restore sidebar navigation for blocks containing a smartblock#1199

Open
sid597 wants to merge 3 commits into
mainfrom
eng-1990-left-sidebar-doesnt-let-you-navigate-to-a-block-containing-a
Open

ENG-1990: Restore sidebar navigation for blocks containing a smartblock#1199
sid597 wants to merge 3 commits into
mainfrom
eng-1990-left-sidebar-doesnt-let-you-navigate-to-a-block-containing-a

Conversation

@sid597

@sid597 sid597 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

https://www.loom.com/share/f123ad86812345f1a21cb41205d852f6

Sidebar rows rendered via RoamRenderedBlock (blocks containing a SmartBlock button) had no click handler, so clicking the text did nothing. Per the approach agreed on the ticket: a click watcher on the rendered block now navigates via the existing openTarget unless the click originated on a data-roamjs-smartblock-button element, which passes through to the SmartBlocks extension.

Fixes ENG-1990


Open in Devin Review

Clicks on the rendered block navigate via openTarget unless the click
originated on a data-roamjs-smartblock-button element, which passes
through to the SmartBlocks extension.
@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

ENG-1990

@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:48pm

Request Review

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

@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/LeftSidebarView.tsx
Comment thread apps/roam/src/components/LeftSidebarView.tsx
Review follow-up: page refs, tags, block refs, links, inputs and
buttons inside the rendered block navigate or act on their own, so the
outer click handler double-fired. Navigation now only triggers for
clicks on inert content.
@sid597

sid597 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Review addressed in a466f51. The double-navigation finding was valid — page refs, tags, block refs, links and inputs inside the rendered block act on their own, so the outer handler double-fired. The exclusion is now a selector covering all interactive elements (a, button, input, [data-link-title], [data-tag], .rm-block-ref); button subsumes the SmartBlock trigger. Navigation only fires for clicks on inert content, which keeps the agreed behavior from the ticket.

On the overlay alternative: a clickable overlay above the rendered block would intercept the SmartBlock button itself, which is the one thing that must stay clickable, so the exclusion-selector approach was kept. e.defaultPrevented isn't reliable here since Roam's internal handlers don't consistently call preventDefault.

Pointer events are disabled inside the rendered block and re-enabled
only on buttons, so clicks on text, refs, or empty space navigate to
the block (never entering edit mode or ref navigation), while
smartblock buttons keep running their action.
@sid597

sid597 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Approach revised in 39520f0 after product clarification: the rendered block is now fully inert except buttons — pointer-events are disabled on everything inside .dg-sidebar-rendered-block and re-enabled only on button elements. Clicking text, refs, tags, or empty space navigates to the block (and can never enter Roam's edit mode or trigger ref navigation, since those clicks no longer reach Roam's elements); clicking a button (e.g. a SmartBlock trigger) only runs its action. This replaces the interactive-element exclusion selector, which is no longer needed beyond the button check on the bubbled click.

@sid597 sid597 requested a review from mdroidian July 6, 2026 15:54
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