diff --git a/src/contentScript/contentScriptCore.ts b/src/contentScript/contentScriptCore.ts index 0fb91c2f88..b2eb8d22cd 100644 --- a/src/contentScript/contentScriptCore.ts +++ b/src/contentScript/contentScriptCore.ts @@ -103,8 +103,10 @@ export async function init(): Promise { void initSidebarActivation(); if (!isLoadedInIframe()) { - // FIXME: do we want to do this? It will cause the panels to be reset on non-SPA navigation/reload - // Update `sidePanel` + // TODO: https://github.com/pixiebrix/pixiebrix-extension/issues/8209 + // Reset panels in `sidePanel` on content script initialization (which happens on non-SPA reload/navigation). + // That's the safe behavior for now to avoid showing stale data/invalid forms. + // Re-examine this call when we implement: https://www.notion.so/pixiebrix/0efdedb6c1e44b088e65106202e08c28 void renderPanelsIfVisible(); } diff --git a/src/contentScript/sidebarController.tsx b/src/contentScript/sidebarController.tsx index 6df2d9be32..ec13ac1a9b 100644 --- a/src/contentScript/sidebarController.tsx +++ b/src/contentScript/sidebarController.tsx @@ -211,7 +211,10 @@ export async function renderPanelsIfVisible(): Promise { expectContext("contentScript"); if (isLoadedInIframe()) { - console.warn("renderPanelsIfVisible should not be called from a frame"); + // The top-level frame is responsible for managing the panels for the sidebar + console.warn( + "sidebarController:renderPanelsIfVisible should not be called from a frame", + ); return; }