From ae5d410e4926099aba4db0f4431be9c0c67c4d8a Mon Sep 17 00:00:00 2001 From: sid597 Date: Sun, 5 Jul 2026 23:55:50 +0530 Subject: [PATCH 1/3] ENG-1990: Restore sidebar navigation for blocks containing a smartblock 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. --- apps/roam/src/components/LeftSidebarView.tsx | 23 ++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/roam/src/components/LeftSidebarView.tsx b/apps/roam/src/components/LeftSidebarView.tsx index efad98788..2fff35afd 100644 --- a/apps/roam/src/components/LeftSidebarView.tsx +++ b/apps/roam/src/components/LeftSidebarView.tsx @@ -179,7 +179,13 @@ const toggleFoldedState = async ({ } }; -const RoamRenderedBlock = ({ uid }: { uid: string }) => { +const RoamRenderedBlock = ({ + uid, + onNavigate, +}: { + uid: string; + onNavigate: (e: React.MouseEvent) => void; +}) => { const [version, setVersion] = useState(0); useEffect(() => { @@ -192,8 +198,14 @@ const RoamRenderedBlock = ({ uid }: { uid: string }) => { }; }, [uid]); + const handleClick = (e: React.MouseEvent) => { + const target = e.target as HTMLElement; + if (target.closest("[data-roamjs-smartblock-button]")) return; + onNavigate(e); + }; + return ( -
+
); @@ -215,8 +227,11 @@ const ChildRow = ({ if (ref.type === "block" && isSmartBlockUid(ref.uid)) { return (
-
- +
+ void openTarget(e, child.text, onloadArgs)} + />
); From a466f51407b98465594bdbbba8a1072247259607 Mon Sep 17 00:00:00 2001 From: sid597 Date: Mon, 6 Jul 2026 13:47:59 +0530 Subject: [PATCH 2/3] ENG-1990: Exclude all interactive elements from sidebar block navigation 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. --- apps/roam/src/components/LeftSidebarView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/roam/src/components/LeftSidebarView.tsx b/apps/roam/src/components/LeftSidebarView.tsx index 2fff35afd..3bdcae1dc 100644 --- a/apps/roam/src/components/LeftSidebarView.tsx +++ b/apps/roam/src/components/LeftSidebarView.tsx @@ -179,6 +179,9 @@ const toggleFoldedState = async ({ } }; +const RENDERED_BLOCK_INTERACTIVE_SELECTOR = + "a, button, input, [data-link-title], [data-tag], .rm-block-ref"; + const RoamRenderedBlock = ({ uid, onNavigate, @@ -200,7 +203,7 @@ const RoamRenderedBlock = ({ const handleClick = (e: React.MouseEvent) => { const target = e.target as HTMLElement; - if (target.closest("[data-roamjs-smartblock-button]")) return; + if (target.closest(RENDERED_BLOCK_INTERACTIVE_SELECTOR)) return; onNavigate(e); }; From 39520f0db371fa3b738998ba573e15baf8f34579 Mon Sep 17 00:00:00 2001 From: sid597 Date: Mon, 6 Jul 2026 21:18:34 +0530 Subject: [PATCH 3/3] ENG-1990: Make rendered sidebar blocks inert except buttons 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. --- apps/roam/src/components/LeftSidebarView.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/roam/src/components/LeftSidebarView.tsx b/apps/roam/src/components/LeftSidebarView.tsx index 3bdcae1dc..142977592 100644 --- a/apps/roam/src/components/LeftSidebarView.tsx +++ b/apps/roam/src/components/LeftSidebarView.tsx @@ -179,9 +179,6 @@ const toggleFoldedState = async ({ } }; -const RENDERED_BLOCK_INTERACTIVE_SELECTOR = - "a, button, input, [data-link-title], [data-tag], .rm-block-ref"; - const RoamRenderedBlock = ({ uid, onNavigate, @@ -203,7 +200,7 @@ const RoamRenderedBlock = ({ const handleClick = (e: React.MouseEvent) => { const target = e.target as HTMLElement; - if (target.closest(RENDERED_BLOCK_INTERACTIVE_SELECTOR)) return; + if (target.closest("button")) return; onNavigate(e); }; @@ -1063,6 +1060,9 @@ export const mountLeftSidebar = async ({ .dg-sidebar-rendered-block .block-border-left { display: none; } .dg-sidebar-rendered-block .block-ref-count-button { display: none; } .dg-sidebar-rendered-block .rm-block-main { min-height: unset; padding: 0; } + .dg-sidebar-rendered-block * { pointer-events: none; } + .dg-sidebar-rendered-block button, + .dg-sidebar-rendered-block button * { pointer-events: auto; } `; document.head.appendChild(style); }