Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(desktop-app): skeleton the notification tray agent line while the catalog loads
Mfb55d2f3ef9b
diff --git a/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx b/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsxindex e395a4207..2b159ebce 100644--- a/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx+++ b/desktop-app/ui/src/components/AppHeader/__tests__/notifications.test.tsx@@ -22,10 +22,16 @@ type AgentsCatalogStub = null | {teamAgentNames: string[]agentDisplayByName: Record<string, string>}-const agentsCatalogMock = vi.hoisted(() => ({ catalog: null as AgentsCatalogStub }))+const agentsCatalogMock = vi.hoisted(() => ({+ catalog: null as AgentsCatalogStub,+ loading: false,+}))vi.mock('@hooks/domain/useAgentsDataController', () => ({- useAgentsDataController: () => ({ accessCatalog: agentsCatalogMock.catalog }),+ useAgentsDataController: () => ({+ accessCatalog: agentsCatalogMock.catalog,+ loading: agentsCatalogMock.loading,+ }),}))vi.mock('@hooks/domain/useContextsDataController', () => ({@@ -91,6 +97,7 @@ describe('AppHeader notification tray presentation', () => {cleanup()notificationMocks.notifications.length = 0agentsCatalogMock.catalog = null+ agentsCatalogMock.loading = falsevi.clearAllMocks()vi.unstubAllGlobals()})@@ -135,6 +142,32 @@ describe('AppHeader notification tray presentation', () => {).toBeNull()})+ // QA parity with the control-ui header fix: while the access catalog (the+ // display-name map) is still loading, the tray agent line is a skeleton —+ // never a flash of the raw slug.+ it('skeletonizes the tray agent line while the access catalog loads', () => {+ agentsCatalogMock.loading = true+ notificationMocks.notifications.push({+ id: 'notification-1',+ kind: 'assistant_reply' as const,+ agentName: 'research-agent',+ text: 'Your answer is ready.',+ timestamp: Date.now(),+ read: true,+ })++ render(<AppHeader />)+ fireEvent.click(screen.getByRole('button', { name: 'Notifications and approvals' }))++ const agentLine = screen+ .getByTestId('notification-menu-item')+ .querySelector('.notification-menu-agent')+ expect(agentLine?.querySelector('.notification-menu-agent-skeleton')).not.toBeNull()+ expect(+ screen.queryByText('research-agent', { selector: '.notification-menu-agent' })+ ).toBeNull()+ })+it('opens a notification when its card surface is clicked', () => {const notification = {id: 'notification-1',diff --git a/desktop-app/ui/src/components/HeaderActions/index.tsx b/desktop-app/ui/src/components/HeaderActions/index.tsxindex 053167bd0..46dd895f5 100644--- a/desktop-app/ui/src/components/HeaderActions/index.tsx+++ b/desktop-app/ui/src/components/HeaderActions/index.tsx@@ -91,7 +91,8 @@ export const HeaderActions = React.memo(function HeaderActions({onNotificationTrayOpenChange,onShellOverlayOpenChange,}: HeaderActionsProps) {- const { accessCatalog: agentsAccessCatalog } = useAgentsDataController()+ const { accessCatalog: agentsAccessCatalog, loading: agentsCatalogLoading } =+ useAgentsDataController()const { globalMcpServers, mcpServersByAgent } = useMcpServersDataController()const {teams,@@ -849,7 +850,18 @@ export const HeaderActions = React.memo(function HeaderActions({><div className="notification-menu-item-header"><p className="notification-menu-agent">- {notificationAgentDisplay(notification.agentName)}+ {/* While the access catalog is still loading the+ * display-name map is unknown — skeleton the line+ * instead of flashing the raw slug (QA parity with+ * the control-ui header fix). */}+ {agentsCatalogLoading ? (+ <span+ className="notification-menu-agent-skeleton"+ aria-label="Loading agent name"+ />+ ) : (+ notificationAgentDisplay(notification.agentName)+ )}</p><span className="notification-menu-time">{formatNotificationTime(notification.timestamp)}diff --git a/desktop-app/ui/src/styles.css b/desktop-app/ui/src/styles.cssindex 526a5c62c..489b0e008 100644--- a/desktop-app/ui/src/styles.css+++ b/desktop-app/ui/src/styles.css@@ -1103,6 +1103,24 @@ h3 {white-space: nowrap;}+/* Placeholder while the access catalog (display-name map) is still loading —+ * same shimmer family as .chat-skeleton-line. */+.notification-menu-agent-skeleton {+ display: inline-block;+ width: 7.5rem;+ height: var(--font-size-sm);+ border-radius: 999px;+ background: linear-gradient(+ 90deg,+ rgba(var(--edge-rgb), 0.12) 0%,+ rgba(var(--edge-rgb), 0.26) 46%,+ rgba(var(--edge-rgb), 0.12) 100%+ );+ background-size: 220% 100%;+ animation: skeleton-shimmer 1.2s ease-in-out infinite;+ vertical-align: middle;+}+.notification-menu-text {margin: 0;font-size: var(--font-size-sm);