Skip to content

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

fix(dashboard): correct cost table column alignment

Steven Enamakeld241ef197008
diff --git a/app/src/components/dashboard/ModelCostTable.tsx b/app/src/components/dashboard/ModelCostTable.tsx
index 45a8814563..380753385b 100644
--- a/app/src/components/dashboard/ModelCostTable.tsx
+++ b/app/src/components/dashboard/ModelCostTable.tsx
@@ -1,6 +1,7 @@
import type { ReactNode } from 'react';
import type { CostDashboardModelStats } from '../../hooks/useCostDashboard';
+import { cn } from '../../lib/cn';
import { useT } from '../../lib/i18n/I18nContext';
import {
Badge,
@@ -11,7 +12,6 @@ import {
TableCell,
TableRow,
} from '../ui';
-import { cn } from '../../lib/cn';
import { formatCurrency, formatTokens } from './formatCurrency';
interface ModelCostTableProps {
diff --git a/app/src/components/settings/panels/EventLogPanel.tsx b/app/src/components/settings/panels/EventLogPanel.tsx
index ce228c6310..d3dc5fb7d0 100644
--- a/app/src/components/settings/panels/EventLogPanel.tsx
+++ b/app/src/components/settings/panels/EventLogPanel.tsx
@@ -1,10 +1,12 @@
+import { ArrowUpToLine, Download } from 'lucide-react';
import { useEffect, useRef, useState } from 'react';
import { useT } from '../../../lib/i18n/I18nContext';
import { getCoreHttpBaseUrl, getCoreRpcToken } from '../../../services/coreRpcClient';
import { Badge, type BadgeVariant } from '../../ui';
import Button from '../../ui/Button';
-import { SettingsSelect, SettingsTextField } from '../controls';
+import DataTable, { type DataTableColumn } from '../../ui/DataTable';
+import { SettingsSelect } from '../controls';
import SettingsPanel from '../layout/SettingsPanel';
interface EventEntry {
@@ -102,8 +104,9 @@ const EventLogPanel = () => {
*/
const [activeWorkspace, setActiveWorkspace] = useState<string | null>(null);
const activeWorkspaceRef = useRef<string | null>(null);
- const [autoScroll, setAutoScroll] = useState(true);
- const containerRef = useRef<HTMLDivElement>(null);
+ // Controlled paging so "Jump to latest" can return to page 1.
+ const [page, setPage] = useState(1);
+ const [pageSize, setPageSize] = useState(50);
const idRef = useRef(0);
const controllerRef = useRef<AbortController | null>(null);
const reconnectRef = useRef<ReturnType<typeof setTimeout> | null>(null);
@@ -248,23 +251,6 @@ const EventLogPanel = () => {
};
}, []);
- useEffect(() => {
- if (autoScroll && containerRef.current) {
- const el = containerRef.current;
- el.scrollTop = newEntriesRef.current === 'top' ? 0 : el.scrollHeight;
- }
- }, [entries, autoScroll]);
-
- const handleScroll = () => {
- const el = containerRef.current;
- if (!el) return;
- const atAnchor =
- newEntriesRef.current === 'top'
- ? el.scrollTop < 10
- : el.scrollHeight - el.scrollTop - el.clientHeight < 10;
- setAutoScroll(atAnchor);
- };
-
const filteredEntries = entries.filter(e => {
// Workspace scope first — it is the one filter that changes what the log
// *means* rather than narrowing what it shows, and it also scopes the
@@ -305,144 +291,173 @@ const EventLogPanel = () => {
const domains = [...new Set(entries.map(e => e.domain))].sort();
+ // Newest first regardless of the stream's `new_entries` order: page 1 is
+ // always "latest", so following the live tail is just staying on page 1.
+ const orderedEntries =
+ newEntriesRef.current === 'top' ? filteredEntries : [...filteredEntries].reverse();
+ const pageCount = Math.max(1, Math.ceil(orderedEntries.length / pageSize));
+ const currentPage = Math.min(page, pageCount);
+ const pageRows = orderedEntries.slice((currentPage - 1) * pageSize, currentPage * pageSize);
+
+ const columns: DataTableColumn<EventEntry>[] = [
+ {
+ id: 'time',
+ header: t('settings.developerMenu.eventLog.column.time'),
+ className: 'w-px whitespace-nowrap font-mono text-[11px] text-content-muted',
+ cell: entry => entry.timestamp,
+ },
+ {
+ id: 'domain',
+ header: t('settings.developerMenu.eventLog.column.domain'),
+ className: 'w-px whitespace-nowrap',
+ cell: entry => (
+ <Badge variant={DOMAIN_BADGE_VARIANT[entry.domain] ?? 'neutral'}>
+ {DOMAIN_BADGE_KEYS[entry.domain]
+ ? t(DOMAIN_BADGE_KEYS[entry.domain])
+ : entry.domain.toUpperCase()}
+ </Badge>
+ ),
+ },
+ {
+ id: 'agent',
+ header: t('settings.developerMenu.eventLog.column.agent'),
+ className: 'w-px whitespace-nowrap font-mono text-[11px] text-content-muted',
+ cell: entry => entry.agent,
+ },
+ {
+ id: 'event',
+ header: t('settings.developerMenu.eventLog.column.event'),
+ // `max-w-0 w-full` lets the cell truncate instead of widening the table.
+ className: 'w-full max-w-0',
+ cell: entry => (
+ <div className="min-w-0 space-y-0.5">
+ <p className="truncate text-xs text-content" title={entry.event}>
+ {entry.event}
+ </p>
+ {entry.detail && (
+ <p className="truncate text-[11px] text-content-muted" title={entry.detail}>
+ {entry.detail}
+ </p>
+ )}
+ </div>
+ ),
+ },
+ ];
+
return (
+ // Non-scrolling page body: the table card fills it and only rows scroll.
<SettingsPanel
testId="event-log-panel"
scrollable={false}
bodyClassName="flex h-full min-h-0 flex-col gap-4"
description={t('settings.developerMenu.eventLog.desc')}>
- {/* Status bar */}
- <div className="flex flex-wrap items-center gap-2">
- <SettingsSelect
- value={scope}
- onChange={e => setScope(e.target.value === 'all' ? 'all' : 'active')}
- aria-label={t('settings.developerMenu.eventLog.workspaceScope')}
- inputSize="sm">
- <option value="active">
- {t('settings.developerMenu.eventLog.workspaceScopeActive')}
- </option>
- <option value="all">{t('settings.developerMenu.eventLog.workspaceScopeAll')}</option>
- </SettingsSelect>
- <SettingsSelect
- value={filterType}
- onChange={e => setFilterType(e.target.value)}
- aria-label={t('settings.developerMenu.eventLog.allTypes')}
- inputSize="sm">
- <option value="">{t('settings.developerMenu.eventLog.allTypes')}</option>
- {domains.map(d => (
- <option key={d} value={d}>
- {d}
- </option>
- ))}
- </SettingsSelect>
- <SettingsTextField
- className="w-40"
- placeholder={t('settings.developerMenu.eventLog.filterAgent')}
- value={filterText}
- onChange={e => setFilterText(e.target.value)}
- aria-label={t('settings.developerMenu.eventLog.filterAgent')}
- inputSize="sm"
- />
- <Button
- type="button"
- variant="secondary"
- size="xs"
- onClick={exportLog}
- disabled={filteredEntries.length === 0}>
- {t('settings.developerMenu.eventLog.download')}
- </Button>
- <span className="text-xs text-content-muted">
- {filteredEntries.length} {t('settings.developerMenu.eventLog.events')} &middot;{' '}
- <span className={isLive ? 'text-sage-600 dark:text-sage-300' : 'text-content-muted'}>
- {isLive
- ? t('settings.developerMenu.eventLog.live')
- : t('settings.developerMenu.eventLog.disconnected')}
+ <DataTable<EventEntry>
+ testId="event-log-scroll"
+ title={t('settings.developerMenu.eventLog.title')}
+ description={
+ <span className="inline-flex items-center gap-2">
+ <Badge variant={isLive ? 'success' : 'neutral'} data-testid="event-log-status">
+ {isLive
+ ? t('settings.developerMenu.eventLog.live')
+ : t('settings.developerMenu.eventLog.disconnected')}
+ </Badge>
+ <span>
+ {filteredEntries.length} {t('settings.developerMenu.eventLog.events')}
+ </span>
</span>
- </span>
- </div>
-
- {/* Jump to latest */}
- {!autoScroll && (
- <Button
- type="button"
- variant="tertiary"
- size="xs"
- onClick={() => {
- setAutoScroll(true);
- const el = containerRef.current;
- if (el) {
- el.scrollTop = newEntriesRef.current === 'top' ? 0 : el.scrollHeight;
- }
- }}>
- {t('settings.developerMenu.eventLog.jumpToLatest')}
- </Button>
- )}
-
- {/* Event stream.
- This is a live region, not a document, so it claims the height rather
- than taking a narrow measure: it was a `max-h-[60vh]` box that sized
- to its content, so with no events the whole panel was a filter bar,
- one grey sentence, and 700px of nothing -- indistinguishable from a
- page that failed to load. Bounded and framed, the same emptiness reads
- as a log that is connected and has not received anything yet, which is
- what it is. */}
- <section className="flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-line">
- <div
- ref={containerRef}
- onScroll={handleScroll}
- data-testid="event-log-scroll"
- className="min-h-0 flex-1 space-y-1 overflow-y-auto p-2">
- {filteredEntries.length === 0 && (
- <div className="flex h-full flex-col items-center justify-center gap-1 text-center">
- <p className="text-sm text-content-secondary">
- {isLive
- ? t('settings.developerMenu.eventLog.waiting')
- : t('settings.developerMenu.eventLog.notConnected')}
- </p>
- <p className="max-w-[44ch] text-xs text-content-faint">
- {isLive
- ? t('settings.developerMenu.eventLog.waitingHint')
- : t('settings.developerMenu.eventLog.notConnectedHint')}
- </p>
- </div>
- )}
- {filteredEntries.map(entry => {
- const variant = DOMAIN_BADGE_VARIANT[entry.domain] ?? 'neutral';
- return (
- <div
- key={entry.id}
- className="rounded-xl border border-line bg-surface-muted px-3 py-2 flex items-start gap-2">
- <span className="text-[10px] text-content-muted font-mono shrink-0 pt-0.5">
- {entry.timestamp}
- </span>
- <Badge variant={variant} className="shrink-0">
- {DOMAIN_BADGE_KEYS[entry.domain]
- ? t(DOMAIN_BADGE_KEYS[entry.domain])
- : entry.domain.toUpperCase()}
- </Badge>
- {entry.agent && (
- <span className="text-[10px] text-content-muted shrink-0 font-mono">
- {entry.agent}
- </span>
- )}
- {/* `min-w-0` is load-bearing: a flex item with `truncate` cannot
- shrink below min-content without it, so this span would hold its
- full width and the detail span beside it (which does set
- `min-w-0`) would absorb every pixel of overflow and render as a
- few characters — defeating the column it was added for. */}
- <span className="text-xs text-content truncate min-w-0">{entry.event}</span>
- {entry.detail && (
- <span
- className="text-[10px] text-content-muted truncate min-w-0 pt-0.5"
- title={entry.detail}>
- {entry.detail}
- </span>
- )}
- </div>
- );
- })}
- </div>
- </section>
+ }
+ actions={
+ <>
+ {currentPage > 1 && (
+ <Button
+ type="button"
+ variant="tertiary"
+ size="sm"
+ leadingIcon={<ArrowUpToLine className="h-3.5 w-3.5" aria-hidden />}
+ onClick={() => setPage(1)}>
+ {t('settings.developerMenu.eventLog.jumpToLatest')}
+ </Button>
+ )}
+ <Button
+ type="button"
+ variant="secondary"
+ size="sm"
+ leadingIcon={<Download className="h-3.5 w-3.5" aria-hidden />}
+ onClick={exportLog}
+ disabled={filteredEntries.length === 0}>
+ {t('settings.developerMenu.eventLog.download')}
+ </Button>
+ </>
+ }
+ toolbarStart={
+ <>
+ <SettingsSelect
+ value={scope}
+ onChange={e => {
+ setScope(e.target.value === 'all' ? 'all' : 'active');
+ setPage(1);
+ }}
+ aria-label={t('settings.developerMenu.eventLog.workspaceScope')}
+ inputSize="sm">
+ <option value="active">
+ {t('settings.developerMenu.eventLog.workspaceScopeActive')}
+ </option>
+ <option value="all">{t('settings.developerMenu.eventLog.workspaceScopeAll')}</option>
+ </SettingsSelect>
+ <SettingsSelect
+ value={filterType}
+ onChange={e => {
+ setFilterType(e.target.value);
+ setPage(1);
+ }}
+ aria-label={t('settings.developerMenu.eventLog.allTypes')}
+ inputSize="sm">
+ <option value="">{t('settings.developerMenu.eventLog.allTypes')}</option>
+ {domains.map(d => (
+ <option key={d} value={d}>
+ {d}
+ </option>
+ ))}
+ </SettingsSelect>
+ </>
+ }
+ search={{
+ value: filterText,
+ onChange: value => {
+ setFilterText(value);
+ setPage(1);
+ },
+ placeholder: t('settings.developerMenu.eventLog.filterAgent'),
+ ariaLabel: t('settings.developerMenu.eventLog.filterAgent'),
+ }}
+ columns={columns}
+ rows={pageRows}
+ rowKey={entry => String(entry.id)}
+ pagination={{
+ page: currentPage,
+ pageSize,
+ total: orderedEntries.length,
+ pageSizeOptions: [25, 50, 100, 200],
+ onPageChange: setPage,
+ onPageSizeChange: setPageSize,
+ testId: 'event-log-pagination',
+ }}
+ empty={
+ <div className="flex flex-col items-center gap-1 text-center">
+ <p className="text-sm text-content-secondary">
+ {isLive
+ ? t('settings.developerMenu.eventLog.waiting')
+ : t('settings.developerMenu.eventLog.notConnected')}
+ </p>
+ <p className="max-w-[44ch] text-xs text-content-faint">
+ {isLive
+ ? t('settings.developerMenu.eventLog.waitingHint')
+ : t('settings.developerMenu.eventLog.notConnectedHint')}
+ </p>
+ </div>
+ }
+ ariaLabel={t('settings.developerMenu.eventLog.title')}
+ />
</SettingsPanel>
);
};
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index c88138643c..f6b7b84fd0 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -177,6 +177,9 @@ const en: TranslationMap = {
'sync.status.success': 'Success',
'sync.status.failed': 'Failed',
'sync.status.partial': 'Fetched, memory ingest failed',
+ 'sync.status.partialShort': 'Partial',
+ 'sync.statusColumn': 'Status',
+ 'sync.searchPlaceholder': 'Search sources…',
'sync.nowSyncing.title': 'Now syncing',
'sync.nowSyncing.empty': 'Nothing is syncing right now.',
'common.error': 'Error',
@@ -6125,6 +6128,10 @@ const en: TranslationMap = {
'settings.developerMenu.eventLog.notConnectedHint': 'Reconnect to the core to resume the stream.',
'settings.developerMenu.eventLog.notConnected': 'Not connected to core',
'settings.developerMenu.eventLog.jumpToLatest': 'Jump to latest',
+ 'settings.developerMenu.eventLog.column.time': 'Time',
+ 'settings.developerMenu.eventLog.column.domain': 'Type',
+ 'settings.developerMenu.eventLog.column.agent': 'Agent',
+ 'settings.developerMenu.eventLog.column.event': 'Event',
'settings.developerMenu.eventLog.badge.tool': 'TOOL',
'settings.developerMenu.eventLog.badge.agent': 'AGENT',
'settings.developerMenu.eventLog.badge.info': 'INFO',