Skip to content

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

TypeScript

chore: ui colors fix

Josué717bb72a765f
diff --git a/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx b/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx
index e1ec335aa..09c4ac150 100644
--- a/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx
+++ b/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx
@@ -116,6 +116,27 @@ describe('AppHeader notification tray presentation', () => {
await waitFor(() => expect(notificationMocks.refresh).toHaveBeenCalledOnce())
})
+ it('does not show the empty notification state before the open refresh settles', async () => {
+ let resolveRefresh: (() => void) | undefined
+ notificationMocks.refresh.mockReturnValueOnce(
+ new Promise<void>(resolve => {
+ resolveRefresh = resolve
+ })
+ )
+
+ render(<AppHeader />)
+ fireEvent.click(screen.getByRole('button', { name: 'Notifications and approvals' }))
+
+ expect(screen.getByRole('dialog', { name: 'Notifications and approvals' })).toBeTruthy()
+ expect(screen.queryByText('No notifications or pending approvals right now.')).toBeNull()
+
+ resolveRefresh?.()
+
+ await waitFor(() => {
+ expect(screen.getByText('No notifications or pending approvals right now.')).toBeTruthy()
+ })
+ })
+
it('opens a clickable notification card with the keyboard', () => {
const notification = {
id: 'notification-1',
diff --git a/desktop-app/ui/src/components/AppHeader/__tests__/searchCollapse.test.tsx b/desktop-app/ui/src/components/AppHeader/__tests__/searchCollapse.test.tsx
index 685b5eb3f..b189f18f1 100644
--- a/desktop-app/ui/src/components/AppHeader/__tests__/searchCollapse.test.tsx
+++ b/desktop-app/ui/src/components/AppHeader/__tests__/searchCollapse.test.tsx
@@ -4,10 +4,9 @@ import { cleanup, render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { AppHeader } from '../index'
-// The collapsed idle contract: `.global-search` may only carry `is-open` while
-// there is query/result state. Focusing an empty field or typing-then-clearing
-// must leave the container without `is-open` once idle — the CSS `:focus-within`
-// rule handles the transient expansion during focus, `is-open` does not.
+// The titlebar search opens its reusable results surface on focus, even before
+// the user types. The input keeps the short titlebar label while the results
+// panel carries the longer searchable-scope prompt.
vi.mock('@hooks/domain/useAgentsDataController', () => ({
useAgentsDataController: () => ({ accessCatalog: null }),
@@ -81,7 +80,7 @@ describe('AppHeader global search idle collapse', () => {
vi.clearAllMocks()
})
- it('does not keep is-open after focusing an empty field and tabbing out', async () => {
+ it('opens the results surface with the scope prompt when an empty field is focused', async () => {
const user = userEvent.setup()
const { container } = render(<AppHeader />)
const search = container.querySelector('.global-search')
@@ -90,14 +89,17 @@ describe('AppHeader global search idle collapse', () => {
expect(input.getAttribute('placeholder')).toBe('Search')
await user.click(input)
- expect(search?.classList.contains('is-open')).toBe(false)
+ expect(search?.classList.contains('is-open')).toBe(true)
+ expect(
+ screen.getByText('Search teams, contexts, members, agents or connectors...')
+ ).toBeTruthy()
await user.tab()
expect(document.activeElement).not.toBe(input)
- expect(search?.classList.contains('is-open')).toBe(false)
+ expect(search?.classList.contains('is-open')).toBe(true)
})
- it('drops is-open once the typed query is cleared', async () => {
+ it('keeps the results surface open when the typed query is cleared', async () => {
const user = userEvent.setup()
const { container } = render(<AppHeader />)
const search = container.querySelector('.global-search')
@@ -107,7 +109,10 @@ describe('AppHeader global search idle collapse', () => {
expect(search?.classList.contains('is-open')).toBe(true)
await user.clear(input)
- expect(search?.classList.contains('is-open')).toBe(false)
+ expect(search?.classList.contains('is-open')).toBe(true)
+ expect(
+ screen.getByText('Search teams, contexts, members, agents or connectors...')
+ ).toBeTruthy()
})
it('renders explicit titlebar search chrome for contrast', () => {
@@ -120,9 +125,18 @@ describe('AppHeader global search idle collapse', () => {
const bell = container.querySelector<HTMLElement>('.notification-bell--titlebar')
expect(icon?.textContent).toBe('⌕')
- expect(icon?.style.color).toBe('var(--titlebar-action-ink)')
expect(placeholder?.textContent).toBe('Search')
- expect(placeholder?.style.color).toBe('var(--titlebar-action-ink)')
- expect(bell?.style.color).toBe('var(--titlebar-action-ink)')
+ expect(bell).toBeTruthy()
+ })
+
+ it('opens titlebar search results for a command focus request', () => {
+ const { rerender } = render(<AppHeader placement="titlebar" searchFocusRequestId={0} />)
+
+ rerender(<AppHeader placement="titlebar" searchFocusRequestId={1} />)
+
+ expect(screen.getByRole('textbox', { name: 'Search' })).toBe(document.activeElement)
+ expect(
+ screen.getByText('Search teams, contexts, members, agents or connectors...')
+ ).toBeTruthy()
})
})
diff --git a/desktop-app/ui/src/components/HeaderActions/index.tsx b/desktop-app/ui/src/components/HeaderActions/index.tsx
index 6480f8852..87988ab71 100644
--- a/desktop-app/ui/src/components/HeaderActions/index.tsx
+++ b/desktop-app/ui/src/components/HeaderActions/index.tsx
@@ -23,6 +23,7 @@ import type {
} from './types'
const SEARCH_PLACEHOLDER = 'Search'
+const SEARCH_RESULTS_PROMPT = 'Search teams, contexts, members, agents or connectors...'
function formatApprovalTimestamp(value: string, mode: 'relative' | 'absolute'): string {
const date = new Date(value)
@@ -135,6 +136,7 @@ export const HeaderActions = React.memo(function HeaderActions({
const [searchQuery, setSearchQuery] = useState('')
const [searchOpen, setSearchOpen] = useState(false)
const [notificationsOpen, setNotificationsOpen] = useState(false)
+ const [notificationTraySettled, setNotificationTraySettled] = useState(false)
const searchRef = useRef<HTMLDivElement | null>(null)
const searchInputRef = useRef<HTMLInputElement | null>(null)
const notificationsRef = useRef<HTMLDivElement | null>(null)
@@ -145,15 +147,6 @@ export const HeaderActions = React.memo(function HeaderActions({
const notificationTrayVisible =
notificationsOpen && (!notificationTrayUsesDrawer || notificationTrayReady)
const titlebarPlacement = placement === 'titlebar'
- const titlebarForeground = 'var(--titlebar-action-ink)'
- const titlebarControlStyle = titlebarPlacement
- ? {
- background: 'var(--titlebar-action-surface)',
- borderColor: 'var(--titlebar-action-border)',
- color: titlebarForeground,
- WebkitTextFillColor: titlebarForeground,
- }
- : undefined
useEffect(() => {
const timer = window.setInterval(() => setNow(Date.now()), 30_000)
@@ -166,11 +159,7 @@ export const HeaderActions = React.memo(function HeaderActions({
useEffect(() => {
if (searchFocusRequestId <= 0) return
setNotificationsOpen(false)
- // Open based on query presence rather than delegating to the input's
- // onFocus: when the field is already focused (e.g. Escape then re-triggering
- // the shortcut) focus() is a no-op and onFocus would not re-fire. Read the
- // live input value so this stays keyed only on the request id.
- setSearchOpen((searchInputRef.current?.value ?? '').trim().length > 0)
+ setSearchOpen(true)
searchInputRef.current?.focus()
}, [searchFocusRequestId])
@@ -199,8 +188,18 @@ export const HeaderActions = React.memo(function HeaderActions({
}, [onNotificationTrayOpenChange, onShellOverlayOpenChange])
useEffect(() => {
- if (!notificationsOpen) return
- void onRefreshPendingApprovals()
+ if (!notificationsOpen) {
+ setNotificationTraySettled(false)
+ return
+ }
+ let cancelled = false
+ setNotificationTraySettled(false)
+ void onRefreshPendingApprovals().finally(() => {
+ if (!cancelled) setNotificationTraySettled(true)
+ })
+ return () => {
+ cancelled = true
+ }
}, [notificationsOpen, onRefreshPendingApprovals])
useEffect(() => {
@@ -573,6 +572,11 @@ export const HeaderActions = React.memo(function HeaderActions({
const pendingApprovalsCount = pendingApprovals.length
const inboxNotificationCount = notifications.length
const totalAttentionCount = pendingApprovalsCount + unreadNotificationCount
+ const showNotificationTrayEmpty =
+ notificationTraySettled &&
+ !pendingApprovalsLoading &&
+ !pendingApprovalsCount &&
+ !notifications.length
const notificationButtonLabel =
totalAttentionCount === 0
? 'Inbox'
@@ -633,11 +637,7 @@ export const HeaderActions = React.memo(function HeaderActions({
ref={searchRef}
>
{titlebarPlacement ? (
- <span
- aria-hidden="true"
- className="global-search__titlebar-icon"
- style={{ color: titlebarForeground, opacity: 1 }}
- >
+ <span aria-hidden="true" className="global-search__titlebar-icon">
⌕
</span>
) : null}
@@ -648,13 +648,12 @@ export const HeaderActions = React.memo(function HeaderActions({
className={`search-input${titlebarPlacement ? ' search-input--titlebar' : ''}`}
aria-label="Search"
title={SEARCH_PLACEHOLDER}
- style={titlebarControlStyle}
value={searchQuery}
onChange={event => {
setSearchQuery(event.target.value)
- setSearchOpen(event.target.value.trim().length > 0)
+ setSearchOpen(true)
}}
- onFocus={() => setSearchOpen(searchQuery.trim().length > 0)}
+ onFocus={() => setSearchOpen(true)}
onKeyDown={event => {
if (event.key === 'Escape') {
setSearchOpen(false)
@@ -662,23 +661,23 @@ export const HeaderActions = React.memo(function HeaderActions({
}}
/>
{titlebarPlacement && !searchQuery ? (
- <span
- aria-hidden="true"
- className="search-input__titlebar-placeholder"
- style={{ color: titlebarForeground, opacity: 1 }}
- >
+ <span aria-hidden="true" className="search-input__titlebar-placeholder">
{SEARCH_PLACEHOLDER}
</span>
) : null}
- {searchOpen && hasSearch && (
+ {searchOpen && (
<div className="global-search-results">
<div className="search-results-card">
- <div className="search-results-header-row">
- <strong>Search Results</strong>
- <span className="search-results-meta">
- {totalMatches} match{totalMatches === 1 ? '' : 'es'}
- </span>
- </div>
+ {hasSearch ? (
+ <div className="search-results-header-row">
+ <strong>Search Results</strong>
+ <span className="search-results-meta">
+ {totalMatches} match{totalMatches === 1 ? '' : 'es'}
+ </span>
+ </div>
+ ) : (
+ <p className="search-results-prompt">{SEARCH_RESULTS_PROMPT}</p>
+ )}
{teamDirectoryLoading && !teamDirectoryHydrated && (
<p className="search-results-loading">
@@ -873,7 +872,7 @@ export const HeaderActions = React.memo(function HeaderActions({
</section>
)}
- {!totalMatches && !teamDirectoryLoading && !pluginsAppsLoading && (
+ {hasSearch && !totalMatches && !teamDirectoryLoading && !pluginsAppsLoading && (
<p className="search-results-empty">
No matches for "{searchQuery.trim()}". Try a member email, team name, context,
agent, connector, plugin, or app.
@@ -897,7 +896,6 @@ export const HeaderActions = React.memo(function HeaderActions({
aria-expanded={notificationsOpen}
label="Notifications and approvals"
title={notificationButtonLabel}
- style={titlebarControlStyle}
onClick={() => {
setNotificationsOpen(open => !open)
setSearchOpen(false)
@@ -909,7 +907,6 @@ export const HeaderActions = React.memo(function HeaderActions({
viewBox="0 0 24 24"
stroke="currentColor"
strokeWidth={titlebarPlacement ? '2.3' : '2'}
- style={titlebarPlacement ? { color: titlebarForeground } : undefined}
>
<path
strokeLinecap="round"
@@ -1198,7 +1195,7 @@ export const HeaderActions = React.memo(function HeaderActions({
</section>
)}
- {!pendingApprovalsLoading && !pendingApprovalsCount && !notifications.length && (
+ {showNotificationTrayEmpty && (
<p className="notification-menu-empty">
No notifications or pending approvals right now.
</p>
diff --git a/desktop-app/ui/src/components/WindowTitleBar/__tests__/WindowTitleBar.test.tsx b/desktop-app/ui/src/components/WindowTitleBar/__tests__/WindowTitleBar.test.tsx
index a25e3e0e2..77ae490a2 100644
--- a/desktop-app/ui/src/components/WindowTitleBar/__tests__/WindowTitleBar.test.tsx
+++ b/desktop-app/ui/src/components/WindowTitleBar/__tests__/WindowTitleBar.test.tsx
@@ -116,6 +116,35 @@ describe('WindowTitleBar', () => {
expect(screen.getByRole('button', { name: 'Close window' })).toBeTruthy()
})
+ it('toggles maximize when the draggable titlebar area is double clicked', () => {
+ setNavigatorPlatform('MacIntel')
+ const { api } = installWindowControls()
+ const { container } = render(<WindowTitleBar />)
+
+ fireEvent.doubleClick(container.querySelector('.window-titlebar') as HTMLElement)
+
+ expect(api.toggleMaximize).toHaveBeenCalledTimes(1)
+ })
+
+ it('keeps double clicks on titlebar controls scoped to that control', () => {
+ setNavigatorPlatform('MacIntel')
+ const { api } = installWindowControls()
+ render(
+ <WindowTitleBar
+ actions={
+ <button type="button" aria-label="Search">
+ Search
+ </button>
+ }
+ />
+ )
+
+ fireEvent.doubleClick(screen.getByRole('button', { name: 'Close window' }))
+ fireEvent.doubleClick(screen.getByRole('button', { name: 'Search' }))
+
+ expect(api.toggleMaximize).not.toHaveBeenCalled()
+ })
+
it('portals provider-backed actions above the titlebar background', async () => {
setNavigatorPlatform('MacIntel')
installWindowControls()
diff --git a/desktop-app/ui/src/components/WindowTitleBar/index.tsx b/desktop-app/ui/src/components/WindowTitleBar/index.tsx
index 09ea0fd3c..050b84dc0 100644
--- a/desktop-app/ui/src/components/WindowTitleBar/index.tsx
+++ b/desktop-app/ui/src/components/WindowTitleBar/index.tsx
@@ -38,6 +38,26 @@ function getWindowControlsApi() {
return window.evenfire?.window
}
+function targetOwnsPointerGesture(target: EventTarget | null): boolean {
+ if (!(target instanceof Element)) return false
+ return Boolean(
+ target.closest(
+ [
+ '.window-titlebar__controls',
+ '.global-search',
+ '.notification-bell-wrapper',
+ 'button',
+ 'a',
+ 'input',
+ 'select',
+ 'textarea',
+ '[role="button"]',
+ '[role="link"]',
+ ].join(', ')
+ )
+ )
+}
+
export function TitlebarActionsPortal({ children, container }: TitlebarActionsPortalProps) {
return container ? createPortal(children, container) : null
}
@@ -85,10 +105,16 @@ export function WindowTitleBar({ actions, actionsRef }: WindowTitleBarProps) {
void controlsApi?.toggleMaximize()
}, [])
+ const handleTitlebarDoubleClick = React.useCallback((event: React.MouseEvent<HTMLElement>) => {
+ if (targetOwnsPointerGesture(event.target)) return
+ void getWindowControlsApi()?.toggleMaximize()
+ }, [])
+
return (
<header
className={`window-titlebar window-titlebar--platform-${platform}`}
data-platform={platform}
+ onDoubleClick={handleTitlebarDoubleClick}
>
<div className="window-titlebar__controls" aria-label="Window controls">
{controlOrder.map(action => (
diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.css
index edc67c28c..e2c126ba1 100644
--- a/desktop-app/ui/src/styles.css
+++ b/desktop-app/ui/src/styles.css
@@ -130,7 +130,7 @@ h3 {
align-items: center;
gap: var(--space-2);
pointer-events: auto;
- -webkit-app-region: no-drag;
+ -webkit-app-region: drag;
}
.window-titlebar__actions .header-left {
@@ -151,6 +151,7 @@ h3 {
min-width: 0;
max-width: min(var(--global-search-expanded), 100%);
margin-right: 0;
+ -webkit-app-region: no-drag;
}
.window-titlebar__actions .global-search:focus-within,
@@ -166,9 +167,8 @@ h3 {
border-color: var(--titlebar-action-border);
background: var(--titlebar-action-surface);
color: var(--titlebar-action-ink);
- box-shadow:
- 0 0 0 1px rgba(17, 24, 39, 0.08),
- 0 6px 14px rgba(var(--overlay-rgb), 0.1);
+ box-shadow: 0 6px 14px rgba(var(--overlay-rgb), 0.08);
+ -webkit-app-region: no-drag;
}
.window-titlebar__actions .global-search::before {
@@ -503,6 +503,7 @@ h3 {
}
.search-results-loading,
+.search-results-prompt,
.search-results-empty {
margin: 0;
font-size: var(--font-size-sm);
@@ -716,6 +717,7 @@ h3 {
.notification-bell-wrapper {
position: relative;
z-index: var(--layer-dropdown);
+ -webkit-app-region: no-drag;
}
.notification-bell.has-attention svg {
@@ -13341,6 +13343,7 @@ pre {
border-color: var(--titlebar-action-border) !important;
background: var(--titlebar-action-surface) !important;
color: var(--titlebar-action-ink) !important;
+ box-shadow: 0 6px 14px rgba(var(--overlay-rgb), 0.08) !important;
-webkit-text-fill-color: var(--titlebar-action-ink) !important;
}
@@ -13400,6 +13403,7 @@ pre {
.window-titlebar__actions .notification-bell {
border-color: var(--titlebar-action-border) !important;
background: var(--titlebar-action-surface) !important;
+ box-shadow: 0 6px 14px rgba(var(--overlay-rgb), 0.08) !important;
}
.window-titlebar__actions .notification-bell--titlebar {
diff --git a/desktop-app/ui/src/styles/tokens.css b/desktop-app/ui/src/styles/tokens.css
index 990e8efef..d4f3f8793 100644
--- a/desktop-app/ui/src/styles/tokens.css
+++ b/desktop-app/ui/src/styles/tokens.css
@@ -159,7 +159,7 @@
--window-control-mac-expand: rgb(40, 201, 64);
--window-control-mac-border: rgba(var(--overlay-rgb), 0.28);
--titlebar-control-ink: #ffffff;
- --titlebar-control-border: rgba(255, 255, 255, 0.58);
+ --titlebar-control-border: rgba(255, 255, 255, 0.3);
--titlebar-control-surface: rgb(var(--panel-rgb));
/* chat-view session tabs (Chrome-style: shrink to a floor, cap at a ceiling) */
@@ -286,6 +286,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.68);
+ --titlebar-control-border: rgba(var(--overlay-rgb), 0.3);
--titlebar-control-surface: rgb(var(--panel-rgb));
}