Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(notices): add notice center component with app-level notice support

Steven Enamakelbb5722865838
diff --git a/app/src/App.tsx b/app/src/App.tsx
index 7b837b57f4..2fcf7ad5a2 100644
--- a/app/src/App.tsx
+++ b/app/src/App.tsx
@@ -26,11 +26,11 @@ import RootShellLayout from './components/layout/shell/RootShellLayout';
import { SidebarSlotProvider } from './components/layout/shell/SidebarSlot';
import LocalAIDownloadSnackbar from './components/LocalAIDownloadSnackbar';
import SecretPromptDialog from './components/mcp-setup/SecretPromptDialog';
+import NoticeCenter from './components/notices/NoticeCenter';
import OpenhumanLinkModal from './components/OpenhumanLinkModal';
import PersistRehydrationScreen from './components/PersistRehydrationScreen';
import PttHotkeyManager from './components/PttHotkeyManager';
import SecurityBanner from './components/SecurityBanner';
-import NoticeCenter from './components/notices/NoticeCenter';
import AppWalkthrough from './components/walkthrough/AppWalkthrough';
import { useNotchBootSync } from './hooks/useNotchBootSync';
import { I18nProvider } from './lib/i18n/I18nContext';
diff --git a/app/src/components/notices/NoticeCenter.tsx b/app/src/components/notices/NoticeCenter.tsx
index 501b80b3a9..96bf2de1fe 100644
--- a/app/src/components/notices/NoticeCenter.tsx
+++ b/app/src/components/notices/NoticeCenter.tsx
@@ -25,8 +25,8 @@ import { LuBell, LuInfo, LuTriangleAlert, LuX } from 'react-icons/lu';
import { cn } from '../../lib/cn';
import { useT } from '../../lib/i18n/I18nContext';
import { Button } from '../ui';
-import { useEmbeddingBudgetNativeNotice } from './useEmbeddingBudgetNativeNotice';
import { type AppNotice, type NoticeSeverity, peakSeverity, useAppNotices } from './useAppNotices';
+import { useEmbeddingBudgetNativeNotice } from './useEmbeddingBudgetNativeNotice';
/** Accent per severity — the badge fill and the row's leading icon. */
const SEVERITY_STYLE: Record<NoticeSeverity, { badge: string; icon: string }> = {
diff --git a/app/src/components/notices/useAppNotices.ts b/app/src/components/notices/useAppNotices.ts
index f10658b38a..afbc84e89a 100644
--- a/app/src/components/notices/useAppNotices.ts
+++ b/app/src/components/notices/useAppNotices.ts
@@ -69,7 +69,9 @@ const SEVERITY_RANK: Record<NoticeSeverity, number> = { error: 0, warning: 1, in
export function peakSeverity(notices: readonly AppNotice[]): NoticeSeverity | null {
return notices.reduce<NoticeSeverity | null>(
(peak, notice) =>
- peak === null || SEVERITY_RANK[notice.severity] < SEVERITY_RANK[peak] ? notice.severity : peak,
+ peak === null || SEVERITY_RANK[notice.severity] < SEVERITY_RANK[peak]
+ ? notice.severity
+ : peak,
null
);
}
@@ -151,9 +153,7 @@ export function useAppNotices(): AppNotice[] {
id: budgetId,
// Exhausted is not a warning: memory has already stopped growing.
severity: exhausted ? 'error' : 'warning',
- title: exhausted
- ? t('memoryBudget.exhaustedTitle')
- : t('memoryBudget.approachingTitle'),
+ title: exhausted ? t('memoryBudget.exhaustedTitle') : t('memoryBudget.approachingTitle'),
body: exhausted
? t('memoryBudget.exhaustedMessage')
: t('memoryBudget.approachingMessage').replace('{pct}', String(budgetPct)),