From 907824fafb7362f5d50eafead430731e00d059a3 Mon Sep 17 00:00:00 2001 From: sid597 Date: Fri, 31 Oct 2025 23:00:48 +0530 Subject: [PATCH 1/2] Check if left sidebar script is loaded in graph --- apps/roam/src/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/roam/src/index.ts b/apps/roam/src/index.ts index 84a2050e9..3b6d826b8 100644 --- a/apps/roam/src/index.ts +++ b/apps/roam/src/index.ts @@ -146,6 +146,20 @@ export default runExtension(async (onloadArgs) => { installDiscourseFloatingMenu(onloadArgs); + const leftSidebarScript = document.querySelector( + 'script#roam-left-sidebar[src="https://sid597.github.io/roam-left-sidebar/js/main.js"]', + ); + + if (leftSidebarScript) { + renderToast({ + id: "discourse-graph-left-sidebar-conflict", + intent: "warning", + timeout: 10000, + content: + "Discourse Graph detected the Roam left sidebar script. Running both sidebars may cause issues, Please remove the Roam left sidebar script from your Roam instance, and reload the graph.", + }); + } + return { elements: [ style, From 92d1491ca242cefc723fd3f5075b0812b4f019f8 Mon Sep 17 00:00:00 2001 From: sid597 Date: Fri, 31 Oct 2025 23:08:26 +0530 Subject: [PATCH 2/2] address coderabbit review --- apps/roam/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/roam/src/index.ts b/apps/roam/src/index.ts index 3b6d826b8..dd451bd59 100644 --- a/apps/roam/src/index.ts +++ b/apps/roam/src/index.ts @@ -156,7 +156,7 @@ export default runExtension(async (onloadArgs) => { intent: "warning", timeout: 10000, content: - "Discourse Graph detected the Roam left sidebar script. Running both sidebars may cause issues, Please remove the Roam left sidebar script from your Roam instance, and reload the graph.", + "Discourse Graph detected the Roam left sidebar script. Running both sidebars may cause issues. Please remove the Roam left sidebar script from your Roam instance, and reload the graph.", }); }