Skip to content

The agent that grows with you

fix(desktop): hide fixed titlebar clusters on contributed full pages

KoNit-K3f044f988748
diff --git a/apps/desktop/src/app/routes.titlebar-clusters.test.ts b/apps/desktop/src/app/routes.titlebar-clusters.test.ts
new file mode 100644
index 00000000000..b023d14448c
--- /dev/null
+++ b/apps/desktop/src/app/routes.titlebar-clusters.test.ts
@@ -0,0 +1,21 @@
+import { describe, expect, it } from 'vitest'
+
+import { hidesFixedTitlebarClusters, isOverlayView } from './routes'
+
+describe('hidesFixedTitlebarClusters', () => {
+ it('hides clusters on contributed full pages and overlays', () => {
+ expect(hidesFixedTitlebarClusters('extension')).toBe(true)
+ expect(hidesFixedTitlebarClusters('settings')).toBe(true)
+ })
+
+ it('keeps clusters on chat and first-party workspace pages', () => {
+ expect(hidesFixedTitlebarClusters('chat')).toBe(false)
+ expect(hidesFixedTitlebarClusters('skills')).toBe(false)
+ expect(hidesFixedTitlebarClusters('messaging')).toBe(false)
+ expect(hidesFixedTitlebarClusters('artifacts')).toBe(false)
+ })
+
+ it('does not treat extension as an overlay', () => {
+ expect(isOverlayView('extension')).toBe(false)
+ })
+})
diff --git a/apps/desktop/src/app/routes.ts b/apps/desktop/src/app/routes.ts
index 03a51179517..8c54a6ac357 100644
--- a/apps/desktop/src/app/routes.ts
+++ b/apps/desktop/src/app/routes.ts
@@ -141,6 +141,15 @@ export function isOverlayView(view: AppView): boolean {
return OVERLAY_VIEWS.has(view)
}
+/** True when TitlebarControls must unmount the app's fixed tool clusters.
+ * Overlays already own the window; contributed full pages (`extension`)
+ * bring their own titlebar chrome (`titleBar.center` etc.) and the clusters
+ * would otherwise sit on top of it. First-party workspace pages
+ * (skills/messaging/artifacts) keep the clusters. */
+export function hidesFixedTitlebarClusters(view: AppView): boolean {
+ return isOverlayView(view) || view === 'extension'
+}
+
/** The pathname of a router target. Every classifier below reasons about a
* PATH, but callers navigate to full targets (`/skills?tab=mcp`), and an
* unstripped query reaches the session-id parser — `/skills?tab=mcp` reads as
diff --git a/apps/desktop/src/app/shell/titlebar-controls.test.tsx b/apps/desktop/src/app/shell/titlebar-controls.test.tsx
new file mode 100644
index 00000000000..56f3a53c118
--- /dev/null
+++ b/apps/desktop/src/app/shell/titlebar-controls.test.tsx
@@ -0,0 +1,70 @@
+// @vitest-environment jsdom
+import { cleanup, render, screen } from '@testing-library/react'
+import { MemoryRouter } from 'react-router'
+import { afterEach, beforeEach, describe, expect, it } from 'vitest'
+
+import { registry } from '@/contrib/registry'
+import { I18nProvider } from '@/i18n'
+
+import { ROUTES_AREA } from '../routes'
+
+import { TitlebarControls } from './titlebar-controls'
+
+function renderControls(pathname: string) {
+ return render(
+ <MemoryRouter initialEntries={[pathname]}>
+ <I18nProvider configClient={null} initialLocale="en">
+ <TitlebarControls onOpenSettings={() => {}} />
+ </I18nProvider>
+ </MemoryRouter>
+ )
+}
+
+const windowControls = () => screen.queryByLabelText('Window controls')
+const appControls = () => screen.queryByLabelText('App controls')
+
+describe('TitlebarControls fixed clusters', () => {
+ let disposeRoute: () => void
+
+ beforeEach(() => {
+ disposeRoute = registry.register({
+ area: ROUTES_AREA,
+ data: { path: '/kanban' },
+ id: 'test-kanban-route',
+ render: () => null
+ })
+ })
+
+ afterEach(() => {
+ disposeRoute()
+ cleanup()
+ })
+
+ it('hides the app clusters on a contributed full-page route', () => {
+ renderControls('/kanban')
+
+ expect(windowControls()).toBeNull()
+ expect(appControls()).toBeNull()
+ })
+
+ it('keeps the app clusters on chat', () => {
+ renderControls('/')
+
+ expect(windowControls()).not.toBeNull()
+ expect(appControls()).not.toBeNull()
+ })
+
+ it('hides the app clusters on an overlay', () => {
+ renderControls('/settings')
+
+ expect(windowControls()).toBeNull()
+ expect(appControls()).toBeNull()
+ })
+
+ it('keeps the app clusters on a first-party workspace page', () => {
+ renderControls('/skills')
+
+ expect(windowControls()).not.toBeNull()
+ expect(appControls()).not.toBeNull()
+ })
+})
diff --git a/apps/desktop/src/app/shell/titlebar-controls.tsx b/apps/desktop/src/app/shell/titlebar-controls.tsx
index d54d8393614..c3a2f507bfe 100644
--- a/apps/desktop/src/app/shell/titlebar-controls.tsx
+++ b/apps/desktop/src/app/shell/titlebar-controls.tsx
@@ -25,7 +25,7 @@ import {
} from '@/store/layout'
import { $unreadSessionCount } from '@/store/session-dot-state'
-import { appViewForPath, isOverlayView } from '../routes'
+import { appViewForPath, hidesFixedTitlebarClusters } from '../routes'
import {
TITLEBAR_ICON_BADGE_SCALE,
@@ -235,11 +235,12 @@ export function TitlebarControls({ leftTools = [], tools = [], onOpenSettings }:
}
]
- // While a full-screen overlay (settings, command center, …) is open it should
+ // While a full-screen overlay (settings, command center, …) or a contributed
+ // full-context plugin page (`extension`, e.g. /kanban) is open it should
// visually own the window. These control clusters are `fixed` at a higher
- // z-index than the overlay card, so they'd otherwise bleed over it — hide them
- // and let the overlay's own chrome (close button, drag region) take over.
- if (isOverlayView(appViewForPath(location.pathname))) {
+ // z-index than the overlay card / plugin titlebar chrome, so they'd otherwise
+ // bleed over it — hide them and let that surface's own chrome take over.
+ if (hidesFixedTitlebarClusters(appViewForPath(location.pathname))) {
return null
}