Skip to content

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

feat(brain): add sync history sub-tab with full-height table

Steven Enamakeld2535f58b9ab
diff --git a/app/src/components/intelligence/SyncAuditPanel.tsx b/app/src/components/intelligence/SyncAuditPanel.tsx
index e92c282cdd..029496eea0 100644
--- a/app/src/components/intelligence/SyncAuditPanel.tsx
+++ b/app/src/components/intelligence/SyncAuditPanel.tsx
@@ -100,7 +100,12 @@ function WhenCell({ iso, ago }: { iso: string; ago: string }) {
);
}
-export function SyncAuditPanel() {
+interface SyncAuditPanelProps {
+ /** Fill a height-bounded parent (only rows scroll) instead of a capped card. */
+ fill?: boolean;
+}
+
+export function SyncAuditPanel({ fill = false }: SyncAuditPanelProps = {}) {
const { t } = useT();
const { syncingIds } = useMemorySyncActivity();
const [entries, setEntries] = useState<SyncAuditEntry[]>([]);
@@ -309,7 +314,7 @@ export function SyncAuditPanel() {
return (
<DataTable<SyncAuditEntry>
// Sits among other cards on the scrolling Sync tab: capped, scrolls inside.
- fill={false}
+ fill={fill}
maxHeight="24rem"
testId="sync-history-table"
title={t('sync.auditTitle', 'Sync History')}
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index 14c6a1689c..7ce508a60c 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -62,6 +62,8 @@ const en: TranslationMap = {
'brain.tabs.goals': 'Goals',
'brain.tabs.sources': 'Sources',
'brain.tabs.sync': 'Sync',
+ 'brain.sync.viewStatus': 'Status',
+ 'brain.sync.viewHistory': 'History',
'brain.empty': 'Your brain is empty for now: connect a source to start building memory.',
'brain.error': "Couldn't load your brain. Please try again.",
'brain.refreshError': "Couldn't refresh your brain. Showing the last data that loaded.",
diff --git a/app/src/pages/Brain.tsx b/app/src/pages/Brain.tsx
index 03cf30a517..da9e4894bf 100644
--- a/app/src/pages/Brain.tsx
+++ b/app/src/pages/Brain.tsx
@@ -40,6 +40,9 @@ const navIcon = (d: string) => (
const BRAIN_TABS: readonly BrainTab[] = ['welcome', 'graph', 'goals', 'sources', 'sync'];
+/** Sub-tabs of Sync, reflected in `?view=`: live status, or the run history. */
+type SyncView = 'status' | 'history';
+
/**
* Backoff ladder for automatically retrying a failed graph load.
*
@@ -78,6 +81,16 @@ export default function Brain() {
},
[location.pathname, location.search, navigate]
);
+ const syncView: SyncView =
+ new URLSearchParams(location.search).get('view') === 'history' ? 'history' : 'status';
+ const setSyncView = useCallback(
+ (view: SyncView) => {
+ const params = new URLSearchParams(location.search);
+ params.set('view', view);
+ navigate({ pathname: location.pathname, search: `?${params.toString()}` });
+ },
+ [location.pathname, location.search, navigate]
+ );
const [graph, setGraph] = useState<GraphExportResponse | null>(null);
const [error, setError] = useState<string | null>(null);
const [mode, setMode] = useState<GraphMode>('tree');
@@ -327,10 +340,29 @@ export default function Brain() {
PanelPage so every page opens with the same flush header band, rather
than a bordered card floating in the content column. */
<div className="h-full p-4">
- <SettingsTabbedPage
+ <SettingsTabbedPage<SyncView>
title={t(BRAIN_HEADERS[activeTab as Exclude<BrainTab, 'welcome'>].titleKey)}
- description={t(BRAIN_HEADERS[activeTab as Exclude<BrainTab, 'welcome'>].descKey)}>
- <div className="w-full space-y-5">
+ description={t(BRAIN_HEADERS[activeTab as Exclude<BrainTab, 'welcome'>].descKey)}
+ {...(activeTab === 'sync'
+ ? {
+ tabs: [
+ { id: 'status', label: t('brain.sync.viewStatus') },
+ { id: 'history', label: t('brain.sync.viewHistory') },
+ ],
+ value: syncView,
+ onChange: setSyncView,
+ tabsAriaLabel: t('brain.tabs.sync'),
+ tabsTestIdPrefix: 'brain-sync-view',
+ // History is a full-height table: only its rows scroll.
+ scrollable: syncView !== 'history',
+ }
+ : {})}>
+ <div
+ className={
+ activeTab === 'sync' && syncView === 'history'
+ ? 'flex h-full min-h-0 flex-col'
+ : 'w-full space-y-5'
+ }>
{activeTab === 'graph' && (
<div className="space-y-5 animate-fade-up">
<MemoryControls
@@ -395,7 +427,7 @@ export default function Brain() {
</div>
)}
- {activeTab === 'sync' && (
+ {activeTab === 'sync' && syncView === 'status' && (
<div className="space-y-5 animate-fade-up">
<Card padded divided={false}>
<MemoryTreeStatusPanel onToast={addToast} />
@@ -405,13 +437,13 @@ export default function Brain() {
<Card padded divided={false} data-testid="brain-sync-activity">
<SyncActivityCard />
</Card>
- {/* Sync history relocated from the Memory Inspection panel so
- the Sync tab is the single sync surface. */}
- {/* The panel is a standard DataTable card (title, search,
- paging) — no outer card, or it would be framed twice. */}
- <div data-testid="brain-sync-history">
- <SyncAuditPanel />
- </div>
+ </div>
+ )}
+
+ {/* Sync → History: the run history as a full-height table. */}
+ {activeTab === 'sync' && syncView === 'history' && (
+ <div className="flex min-h-0 flex-1 flex-col" data-testid="brain-sync-history">
+ <SyncAuditPanel fill />
</div>
)}
</div>