From d3e05c32451dd0f7d4d8891db060c975df80320f Mon Sep 17 00:00:00 2001 From: jz Date: Tue, 19 May 2026 12:59:13 -0400 Subject: [PATCH] allow clicks on page when slip is not active also ignore claude config dotfiles --- .gitignore | 1 + src/content/panel/hooks/useElementSelection.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b17593c..36142d1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ coverage .env.local .eslintcache clay-slip-v*.zip +.claude diff --git a/src/content/panel/hooks/useElementSelection.ts b/src/content/panel/hooks/useElementSelection.ts index ced7f16..c8215d3 100644 --- a/src/content/panel/hooks/useElementSelection.ts +++ b/src/content/panel/hooks/useElementSelection.ts @@ -38,13 +38,21 @@ function clickIsOnInteractive(target: EventTarget | null): boolean { * `e.preventDefault()` / `e.stopPropagation()`. In passive mode the user * picks components from the Tree tab in the panel instead, which goes * directly through the store and doesn't need these listeners at all. + * + * **Skipped while the panel is collapsed (FAB-only state).** When the + * panel is closed the user expects the page to behave normally — but + * the click handler swallows clicks inside any `[data-uri]` element via + * `preventDefault()` + `stopPropagation()`. Without this gate, collapsing + * the panel still breaks clicks on Clay-managed regions of the page. */ export function useElementSelection(): void { const components = useStore((s) => s.components); const setSelectedStore = useStore((s) => s.setSelected); + const collapsed = useStore((s) => s.collapsed); useEffect(() => { if (isEditMode()) return; + if (collapsed) return; const byElement = new Map( components.map((c) => [c.element, c]) @@ -84,5 +92,5 @@ export function useElementSelection(): void { document.removeEventListener('mouseover', onMouseOver, true); setHoveredOutline(hovered, null); }; - }, [components, setSelectedStore]); + }, [components, setSelectedStore, collapsed]); }