Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(desktop): unify titlebar header actions

Josué58f8586e59b1
diff --git a/desktop-app/ui/src/App.tsx b/desktop-app/ui/src/App.tsx
index a36ccc3e2..249eea5a9 100644
--- a/desktop-app/ui/src/App.tsx
+++ b/desktop-app/ui/src/App.tsx
@@ -2069,22 +2069,9 @@ export function App() {
: undefined
}
>
- {vm.navItem === DESKTOP_ROUTES.chat ? (
- <TitlebarActionsPortal container={titlebarActionsRoot}>
- <AppHeader
- placement="titlebar"
- searchFocusRequestId={globalSearchFocusRequestId}
- notificationOpenRequestId={notificationOpenRequestId}
- notificationTrayMode={
- notificationTrayUsesDrawer ? 'drawer' : 'overlay'
- }
- notificationTrayReady={notificationDrawerReady}
- onNotificationTrayOpenChange={setHeaderNotificationTrayOpen}
- onShellOverlayOpenChange={setHeaderShellOverlayOpen}
- />
- </TitlebarActionsPortal>
- ) : (
+ <TitlebarActionsPortal container={titlebarActionsRoot}>
<AppHeader
+ placement="titlebar"
searchFocusRequestId={globalSearchFocusRequestId}
notificationOpenRequestId={notificationOpenRequestId}
notificationTrayMode={
@@ -2094,7 +2081,7 @@ export function App() {
onNotificationTrayOpenChange={setHeaderNotificationTrayOpen}
onShellOverlayOpenChange={setHeaderShellOverlayOpen}
/>
- )}
+ </TitlebarActionsPortal>
<ToastStack items={vm.toasts} />
{vm.navItem === DESKTOP_ROUTES.chat && (
<ChatViewWorkspace
diff --git a/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx b/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
index 95c4e700a..1b4013c6a 100644
--- a/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
+++ b/desktop-app/ui/src/__tests__/App.deepLinks.test.tsx
@@ -24,7 +24,11 @@ const confirmDialogHarness = vi.hoisted(() => ({
}))
const appHeaderHarness = vi.hoisted(() => ({
- props: null as null | { searchFocusRequestId?: number; notificationOpenRequestId?: number },
+ props: null as null | {
+ placement?: 'default' | 'titlebar'
+ searchFocusRequestId?: number
+ notificationOpenRequestId?: number
+ },
}))
const chatLocalSearchHarness = vi.hoisted(() => ({ rendered: vi.fn() }))
@@ -395,6 +399,22 @@ describe('App deep-link orchestration', () => {
expect(sidebarHarness.props?.collapsed).toBe(true)
})
+ it('uses the shared titlebar header on every authenticated route', () => {
+ const routes = Object.values(DESKTOP_ROUTES)
+
+ for (const navItem of routes) {
+ currentController = makeController({
+ initialExperienceLoading: false,
+ navItem,
+ } as Partial<AppController>)
+ const view = render(<App />)
+
+ expect(appHeaderHarness.props?.placement).toBe('titlebar')
+
+ view.unmount()
+ }
+ })
+
it('runs registered new-tab and composer-focus commands through existing chat selection', () => {
currentController = makeController({
initialExperienceLoading: false,
diff --git a/desktop-app/ui/src/__tests__/chatDrawerHeaderStacking.test.tsx b/desktop-app/ui/src/__tests__/chatDrawerHeaderStacking.test.tsx
index cb9d50521..db1ce1cea 100644
--- a/desktop-app/ui/src/__tests__/chatDrawerHeaderStacking.test.tsx
+++ b/desktop-app/ui/src/__tests__/chatDrawerHeaderStacking.test.tsx
@@ -31,6 +31,12 @@ function toastStackZIndex(): number {
return Number(match[1])
}
+function toastStackTop(): string {
+ const match = /\.toast-stack\s*\{[^}]*top:\s*([^;]+);/.exec(stylesCss)
+ if (!match) throw new Error('.toast-stack top offset not found')
+ return match[1].trim()
+}
+
beforeEach(() => {
const style = document.createElement('style')
style.dataset.testStyles = 'header-stacking'
@@ -69,4 +75,22 @@ describe('chat drawer header stacking', () => {
// This is exactly why the un-lifted header would hide behind the chat drawer.
expect(layer('layer-header')).toBeLessThan(layer('layer-chat-overlay'))
})
+
+ it('anchors alerts below the custom titlebar with the shared spacing token', () => {
+ expect(toastStackTop()).toBe('calc(var(--window-titlebar-height) + var(--space-2))')
+ })
+
+ it('shares the titlebar divider border with its interactive controls', () => {
+ expect(stylesCss).toMatch(
+ /\.window-titlebar\s*\{[^}]*border-bottom:\s*1px solid var\(--titlebar-divider-border\)/
+ )
+ expect(tokensCss).toMatch(/--titlebar-control-border:\s*var\(--titlebar-divider-border\)/)
+ })
+
+ it('reserves exactly the notification drawer rail for a mounted app', () => {
+ expect(stylesCss).toMatch(
+ /--app-header-utilities-width:\s*calc\(var\(--app-notification-drawer-width\) \+ var\(--space-4\)\)/
+ )
+ expect(stylesCss).toMatch(/\.notification-menu--app-drawer\s*\{[^}]*right:\s*var\(--space-4\)/)
+ })
})
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index ed1e62936..42eb44478 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -89,7 +89,7 @@ h3 {
justify-content: flex-start;
padding: 0 var(--space-2);
background: var(--topbar-gradient);
- border-bottom: 1px solid rgba(var(--edge-rgb), 0.28);
+ border-bottom: 1px solid var(--titlebar-divider-border);
user-select: none;
-webkit-app-region: drag;
}
@@ -2459,7 +2459,7 @@ h3 {
.content-panel {
--app-notification-drawer-width: clamp(280px, 42vw, 420px);
- --app-header-utilities-width: calc(var(--app-notification-drawer-width) + var(--space-2) + 36px);
+ --app-header-utilities-width: calc(var(--app-notification-drawer-width) + var(--space-4));
/* Chat drawer owns its own width, decoupled from the notification drawer.
React sets `--chat-drawer-width` inline (session-only, drag-resizable); this
clamp is only the pre-mount / closed-state fallback. Floor 340px == the
@@ -10128,7 +10128,7 @@ button.page-breadcrumb-link--plain-action:hover:enabled {
.toast-stack {
position: fixed;
- top: 16px;
+ top: calc(var(--window-titlebar-height) + var(--space-2));
right: 16px;
z-index: 4000;
display: grid;
diff --git a/desktop-app/ui/src/styles/tokens.css b/desktop-app/ui/src/styles/tokens.css
index d4f3f8793..d09416a36 100644
--- a/desktop-app/ui/src/styles/tokens.css
+++ b/desktop-app/ui/src/styles/tokens.css
@@ -158,8 +158,9 @@
--window-control-mac-minimize: rgb(255, 189, 46);
--window-control-mac-expand: rgb(40, 201, 64);
--window-control-mac-border: rgba(var(--overlay-rgb), 0.28);
+ --titlebar-divider-border: rgba(var(--edge-rgb), 0.28);
--titlebar-control-ink: #ffffff;
- --titlebar-control-border: rgba(255, 255, 255, 0.3);
+ --titlebar-control-border: var(--titlebar-divider-border);
--titlebar-control-surface: rgb(var(--panel-rgb));
/* chat-view session tabs (Chrome-style: shrink to a floor, cap at a ceiling) */
@@ -286,6 +287,6 @@
--mcp-health-shell-surface: rgba(var(--panel-rgb), 0.96);
--mcp-health-rows-surface: rgba(var(--panel-rgb), 0.86);
--titlebar-control-ink: #000000;
- --titlebar-control-border: rgba(var(--overlay-rgb), 0.3);
+ --titlebar-control-border: var(--titlebar-divider-border);
--titlebar-control-surface: rgb(var(--panel-rgb));
}