diff --git a/frontend/src/lib/components/DropdownV2.svelte b/frontend/src/lib/components/DropdownV2.svelte
index e9fbf71ab8..c2f56b7d44 100644
--- a/frontend/src/lib/components/DropdownV2.svelte
+++ b/frontend/src/lib/components/DropdownV2.svelte
@@ -13,7 +13,7 @@
import DropdownV2Inner from './DropdownV2Inner.svelte'
import { pointerDownOutside } from '$lib/utils'
import { createDropdownMenu, melt, createSync } from '@melt-ui/svelte'
- import { overlayPortalTarget } from '$lib/components/common/overlayHost.svelte'
+ import { overlayPortalTarget, overlayShown } from '$lib/components/common/overlayHost.svelte'
import type { MenubarMenuElements } from '@melt-ui/svelte'
import ResolveOpen from '$lib/components/common/menu/ResolveOpen.svelte'
import Button from '$lib/components/common/button/Button.svelte'
@@ -89,6 +89,7 @@
// Overlays belong to the enclosing pane when there is one — see overlayHost.
const hostPortal = overlayPortalTarget('body')
+ const shown = overlayShown()
const {
elements: { menu: menuEl, item, trigger },
@@ -198,7 +199,7 @@
{/if}
-{#if open && !hidePopup}
+{#if open && !hidePopup && shown()}
>
- /** The folders above the name truncate too: even the name at its last floor does not fit. */
+ /** Even the name at its last floor does not fit: the folders above it truncate too, and a
+ * section's own widget may shrink. */
scopesGive?: boolean
/** Filled in for the bar to choose a stage with; left undefined, nothing is measured. */
measures?: TrailMeasures
@@ -543,17 +544,21 @@ not this component) — so the lead can run the whole line.
{#if section.content && measure}
{:else}
-
+
sectionContentWidth, (w) => !measure && section.content && (sectionContentWidth = w)
+ () => sectionContentWidth,
+ (w) => !measure && section.content && !scopesGive && (sectionContentWidth = w)
}
>
-
- {@render children?.()}
-
+{#if shown()}
+
+ {@render children?.()}
+
+{/if}
diff --git a/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte b/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte
index 912d6e02e2..3ecb6a93f1 100644
--- a/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte
+++ b/frontend/src/lib/components/common/confirmationModal/ConfirmationModal.svelte
@@ -1,7 +1,11 @@
{
+ if (!hostActive()) return
if ((e.ctrlKey || e.metaKey) && e.key === 'l') {
e.preventDefault()
aiChatDisplay?.focusInput()
diff --git a/frontend/src/lib/components/copilot/chat/AssistantSettingsModal.svelte b/frontend/src/lib/components/copilot/chat/AssistantSettingsModal.svelte
index 5315912fa2..d3a9d7982a 100644
--- a/frontend/src/lib/components/copilot/chat/AssistantSettingsModal.svelte
+++ b/frontend/src/lib/components/copilot/chat/AssistantSettingsModal.svelte
@@ -48,6 +48,7 @@ callers that already know which section they mean, such as the "+" menu's Manage
import { useOperatingWorkspace } from '$lib/components/operatingWorkspace.svelte'
import AssistantDangerZoneSection from './AssistantDangerZoneSection.svelte'
import { useActingUser } from '$lib/actingUser.svelte'
+ import { overlayHostActive } from '$lib/components/common/overlayHost.svelte'
// Prefilled title marks the issue as AI Sessions feedback for triage.
const FEEDBACK_ISSUE_URL =
@@ -64,6 +65,7 @@ callers that already know which section they mean, such as the "+" menu's Manage
const operatingWorkspace = useOperatingWorkspace()
const aiChatManager = getAiChatManager()
+ const hostActive = overlayHostActive()
let isOpen = $state(false)
let section = $state('tools')
@@ -109,7 +111,8 @@ callers that already know which section they mean, such as the "+" menu's Manage
* it would then answer the key it was revealed by — reverting the very draft the
* user was brought here to see. */
function onKeydown(event: KeyboardEvent) {
- if (!isOpen || event.key !== 'Escape') return
+ // Hidden hosts stay mounted and still receive window keys — see overlayHost.
+ if (!isOpen || event.key !== 'Escape' || !hostActive()) return
const blocker = blockingSection
if (!blocker || blocker === section) return
event.preventDefault()
@@ -132,7 +135,9 @@ callers that already know which section they mean, such as the "+" menu's Manage
// assistant can call here, so it must not shift when the autonomy picker does.
// The danger zone writes the workspace's AI config, which only its admins may change.
const acting = useActingUser(() => ws)
- let isWsAdmin = $derived(!!acting.current && (acting.current.is_admin || acting.current.is_super_admin))
+ let isWsAdmin = $derived(
+ !!acting.current && (acting.current.is_admin || acting.current.is_super_admin)
+ )
let tools = $derived(summarizeTools(aiChatManager.availableTools))
let providerTools = $derived(aiChatManager.providerTools)
@@ -326,9 +331,7 @@ callers that already know which section they mean, such as the "+" menu's Manage