From a8480f671083e12bd5ce5e12ef5e894dc802c0cd Mon Sep 17 00:00:00 2001 From: Till JS Date: Fri, 3 Apr 2026 13:48:25 +0200 Subject: [PATCH] fix(ui): allow multiple detail views open across AppPages Previously, clicking a detail view in one AppPage would close the overlay in all other AppPages because the global click handler closed on ANY click outside the overlay card. Now the click handler only closes the overlay when the click is inside the SAME AppPage but outside the overlay card. Clicks in other AppPages are ignored, allowing multiple detail views to be open simultaneously side by side. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../web/src/lib/components/workbench/AppPage.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/manacore/apps/web/src/lib/components/workbench/AppPage.svelte b/apps/manacore/apps/web/src/lib/components/workbench/AppPage.svelte index 32b60c5ab..6ac815c78 100644 --- a/apps/manacore/apps/web/src/lib/components/workbench/AppPage.svelte +++ b/apps/manacore/apps/web/src/lib/components/workbench/AppPage.svelte @@ -216,12 +216,20 @@ } let overlayCardEl = $state(null); + let appPageEl = $state(null); - // Close overlay on any click outside the overlay card + // Close overlay on click outside the overlay card BUT inside this AppPage + // (clicks in other AppPages should NOT close this overlay) $effect(() => { if (!overlay) return; function handleGlobalClick(e: MouseEvent) { - if (overlayCardEl && !overlayCardEl.contains(e.target as Node)) { + const target = e.target as Node; + if ( + overlayCardEl && + appPageEl && + appPageEl.contains(target) && + !overlayCardEl.contains(target) + ) { overlayStack = []; siblingIds = []; siblingKey = ''; @@ -238,6 +246,7 @@