Skip to content

The agent that grows with you

refactor(ui-tui): single source for the floating-panel kind set

kshitije8c1882766d2
diff --git a/ui-tui/src/app/overlayStore.ts b/ui-tui/src/app/overlayStore.ts
index 861e86685fe..056b06d4cf5 100644
--- a/ui-tui/src/app/overlayStore.ts
+++ b/ui-tui/src/app/overlayStore.ts
@@ -107,17 +107,28 @@ export const $isBlocked = computed(
* `statusBar: 'off'` needs no branch: `StatusRulePane` returns null for both
* slots, so the timers are never mounted in the first place.
*/
-export const $isStatusRuleOccluded = computed([$overlayState, $uiState], (overlay, ui) =>
+/**
+ * True when any floating overlay PANEL is open (widget overlays and inline
+ * completions are separate concerns — see $isStatusRuleOccluded for why
+ * completions never occlude the status rule).
+ *
+ * SINGLE SOURCE for the floating-panel kind set: consumed by both
+ * FloatingOverlays' render gate (plus completions, which it adds locally)
+ * and $isStatusRuleOccluded's top-statusbar occlusion arm. Add new floating
+ * panels HERE so the timer gate can't silently miss them.
+ */
+export const hasFloatingPanel = (overlay: OverlayState): boolean =>
Boolean(
- overlay.widget ||
- (ui.statusBar === 'top' &&
- (overlay.modelPicker ||
- overlay.pager ||
- overlay.petPicker ||
- overlay.pluginsHub ||
- overlay.sessions ||
- overlay.skillsHub))
+ overlay.modelPicker ||
+ overlay.pager ||
+ overlay.petPicker ||
+ overlay.pluginsHub ||
+ overlay.sessions ||
+ overlay.skillsHub
)
+
+export const $isStatusRuleOccluded = computed([$overlayState, $uiState], (overlay, ui) =>
+ Boolean(overlay.widget || (ui.statusBar === 'top' && hasFloatingPanel(overlay)))
)
export const getOverlayState = () => $overlayState.get()
diff --git a/ui-tui/src/components/appOverlays.tsx b/ui-tui/src/components/appOverlays.tsx
index f7fbfae7d2f..aa9fcd65473 100644
--- a/ui-tui/src/components/appOverlays.tsx
+++ b/ui-tui/src/components/appOverlays.tsx
@@ -4,7 +4,7 @@ import type { ReactNode } from 'react'
import { useGateway } from '../app/gatewayContext.js'
import type { AppOverlaysProps } from '../app/interfaces.js'
-import { $overlayState, patchOverlayState } from '../app/overlayStore.js'
+import { $overlayState, hasFloatingPanel, patchOverlayState } from '../app/overlayStore.js'
import { $uiSessionId, $uiTheme } from '../app/uiStore.js'
import { ActiveSessionSwitcher } from './activeSessionSwitcher.js'
@@ -191,14 +191,7 @@ export function FloatingOverlays({
const sid = useStore($uiSessionId)
const theme = useStore($uiTheme)
- const hasAny =
- overlay.modelPicker ||
- overlay.pager ||
- overlay.petPicker ||
- overlay.sessions ||
- overlay.skillsHub ||
- overlay.pluginsHub ||
- completions.length
+ const hasAny = hasFloatingPanel(overlay) || completions.length
if (!hasAny) {
return null