Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: give System Health alerts a remediation link and hoist drill-ins above the fold (#3790)

[._.]/ Adam Eivy80e990451fe2
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index dae75c4024..04c9cf751c 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -73,3 +73,4 @@
While collapsing that catalog, one more thing surfaced: an overridable default's switch reported the *effective* rsync outcome rather than the user's own override, so a re-included path that a custom exclude pattern still shadowed rendered as switched off — and clicking it dropped the override while appearing to do nothing. The switch now reports the override, and the existing "(still excluded via Additional Exclude Paths)" note keeps carrying the effective state.
- **The "install out of sync" and "update available" notices no longer sit on top of the screen you're using.** Both were raised as permanent corner toasts, and on a phone the card landed squarely on the bottom of the viewport — covering the Ask composer and its Send button, the Add Peer form on Instances, and the process list on System Health. Since neither notice ever times out, that was the resting state of the app after any `git pull`: you had to find the small Dismiss link before the screen worked again, and the toast came back on the next poll. They are now inline banners in the app chrome, directly under the header and in normal document flow, so they push the page down instead of covering it, and dismissing the out-of-sync notice sticks for the commit you dismissed it on — a later pull raises it again.
- **The Timeline's seven backfill importers no longer outrank the day you came to look at.** Every one-time "Import … history" panel — Gmail, Spotify, Google location, Discord, WhatsApp, browser, YouTube — rendered permanently at full width between the date picker and the content, taking the whole top half of a 1440x900 viewport (and effectively the entire screen on a phone) before the activity chart or a single event appeared. They now live behind one "Import history (7)" toggle beside the date, and lay out two-per-row once expanded, so the chart and the day's events start at the top of the content area. A day with nothing recorded offers a "Backfill from an export" button in its empty state, which opens the same set — the setup path stays one click away instead of one screen tall.
+- **System Health alerts now name the page that fixes them.** Every warning banner was a bare statement — "Disk usage at or above 90%" with no control, no link, and nothing to press. Each alert now carries its own remediation link chosen from the warning's type: disk goes to the disk usage breakdown, memory/CPU/process/crash-loop alerts to the process list, an app-status alert to Apps, a Postgres alert to Database settings. The three drill-in links also moved out of the bottom process card and up under the alerts, because at phone widths every control on the route sat below the fold — a glance at the page reduced to "something is wrong" with no next step on screen.
diff --git a/client/src/pages/SystemHealthPage.jsx b/client/src/pages/SystemHealthPage.jsx
index 29a741d1f0..cfa260eaf8 100644
--- a/client/src/pages/SystemHealthPage.jsx
+++ b/client/src/pages/SystemHealthPage.jsx
@@ -13,6 +13,30 @@ const HEALTH_STYLE = {
critical: { color: 'text-port-error', bg: 'bg-port-error/10', icon: XCircle, label: 'Critical' }
};
+// Every alert names its own next step. The server tags each warning with a
+// `type` (server/routes/systemHealth.js), so the banner can carry the link that
+// actually resolves it instead of leaving the user to hunt for the right page.
+// `forge` is intentionally absent — its message already embeds gh's own remedy
+// text and there is no in-app page that fixes it.
+const REMEDIATION = {
+ disk: { to: '/data', label: 'Disk usage breakdown' },
+ memory: { to: '/devtools/processes', label: 'All processes' },
+ cpu: { to: '/devtools/processes', label: 'All processes' },
+ process: { to: '/devtools/processes', label: 'All processes' },
+ restarts: { to: '/devtools/processes', label: 'All processes' },
+ apps: { to: '/apps', label: 'Apps' },
+ database: { to: '/settings/database', label: 'Database settings' },
+};
+
+// Drill-in links shown directly under the alerts so at least one next step is
+// above the fold at phone widths (375px), where the metric cards alone push
+// every control off-screen.
+const DRILL_INS = [
+ { to: '/data', label: 'Disk usage breakdown' },
+ { to: '/devtools/processes', label: 'All processes' },
+ { to: '/apps', label: 'Apps' },
+];
+
function pctTone(pct, warn, critical) {
if (pct >= critical) return 'text-port-error';
if (pct >= warn) return 'text-port-warning';
@@ -114,12 +138,28 @@ export default function SystemHealthPage() {
{health.warnings.length > 0 && (
<section className="space-y-2">
- {health.warnings.map((w, i) => (
- <Banner key={i} tone="warning" size="md" icon={AlertTriangle} align="center">{w.message}</Banner>
- ))}
+ {health.warnings.map((w, i) => {
+ const remedy = REMEDIATION[w.type];
+ return (
+ <Banner key={`${w.type}-${i}`} tone="warning" size="md" icon={AlertTriangle} align="start">
+ <div>{w.message}</div>
+ {remedy && (
+ <Link to={remedy.to} className="inline-block mt-1 font-medium underline underline-offset-2 hover:no-underline">
+ {remedy.label} →
+ </Link>
+ )}
+ </Banner>
+ );
+ })}
</section>
)}
+ <nav aria-label="System drill-downs" className="flex flex-wrap items-center gap-x-4 gap-y-1 text-xs">
+ {DRILL_INS.map(link => (
+ <Link key={link.to} to={link.to} className="text-port-accent hover:text-port-accent/80">{link.label} →</Link>
+ ))}
+ </nav>
+
<section className="grid grid-cols-1 md:grid-cols-3 gap-3">
<ResourceCard
icon={HardDrive}
@@ -171,10 +211,8 @@ export default function SystemHealthPage() {
) : (
<p className="text-gray-500 text-sm">No PM2 processes reporting.</p>
)}
- <div className="mt-3 flex items-center gap-3 text-xs">
+ <div className="mt-3 text-xs">
<Link to="/devtools/processes" className="text-port-accent hover:text-port-accent/80">All processes →</Link>
- <Link to="/apps" className="text-port-accent hover:text-port-accent/80">Apps →</Link>
- <Link to="/data" className="text-port-accent hover:text-port-accent/80">Disk usage breakdown →</Link>
</div>
</section>
diff --git a/client/src/pages/SystemHealthPage.test.jsx b/client/src/pages/SystemHealthPage.test.jsx
new file mode 100644
index 0000000000..288d42c323
--- /dev/null
+++ b/client/src/pages/SystemHealthPage.test.jsx
@@ -0,0 +1,89 @@
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { render, screen, waitFor, within } from '@testing-library/react';
+import { MemoryRouter } from 'react-router';
+
+const HEALTH = {
+ overallHealth: 'warning',
+ warnings: [],
+ thresholds: { memoryWarn: 85, memoryCritical: 95, diskWarn: 90, diskCritical: 98 },
+ system: {
+ uptimeFormatted: '3h 12m',
+ memory: { usagePercent: 40, usedFormatted: '12 GB', totalFormatted: '32 GB' },
+ cpu: { usagePercent: 20, cores: 8, loadAvg1m: 1.2 },
+ disk: { usagePercent: 92, usedFormatted: '900 GB', totalFormatted: '1 TB' },
+ },
+ topProcesses: [],
+};
+
+const withWarnings = warnings => ({ ...HEALTH, warnings });
+
+vi.mock('../services/api', () => ({
+ getSystemHealth: vi.fn(),
+ updateHealthThresholds: vi.fn(() => Promise.resolve({})),
+}));
+
+vi.mock('../components/ui/Toast', () => ({
+ default: { success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), custom: vi.fn() }
+}));
+
+import * as api from '../services/api';
+import SystemHealthPage from './SystemHealthPage';
+
+const renderPage = () => render(
+ <MemoryRouter>
+ <SystemHealthPage />
+ </MemoryRouter>
+);
+
+describe('SystemHealthPage remediation links', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('links a disk alert to the disk usage breakdown', async () => {
+ api.getSystemHealth.mockResolvedValue(withWarnings([
+ { type: 'disk', message: 'Disk usage at or above 90%' },
+ ]));
+ renderPage();
+
+ const banner = (await screen.findByText('Disk usage at or above 90%')).parentElement;
+ // The alert itself carries the link, not just the drill-in nav below it.
+ expect(within(banner).getByRole('link', { name: /Disk usage breakdown/ })).toHaveAttribute('href', '/data');
+ });
+
+ it('links memory, process and app alerts to their own remediation page', async () => {
+ api.getSystemHealth.mockResolvedValue(withWarnings([
+ { type: 'memory', message: 'Memory usage at or above 85%' },
+ { type: 'apps', message: 'App status unavailable for 2 app(s) — PM2 read failed' },
+ { type: 'database', message: 'PostgreSQL disconnected' },
+ ]));
+ renderPage();
+
+ await screen.findByText('Memory usage at or above 85%');
+ expect(screen.getByRole('link', { name: /Database settings/ })).toHaveAttribute('href', '/settings/database');
+ expect(screen.getAllByRole('link', { name: /All processes/ }).length).toBeGreaterThan(0);
+ expect(screen.getAllByRole('link', { name: /^Apps/ }).length).toBeGreaterThan(0);
+ });
+
+ it('leaves an alert with no in-app remedy as a plain statement', async () => {
+ api.getSystemHealth.mockResolvedValue(withWarnings([
+ { type: 'forge', message: 'GitHub CLI unusable (unauthenticated)' },
+ ]));
+ renderPage();
+
+ await screen.findByText('GitHub CLI unusable (unauthenticated)');
+ const nav = screen.getByRole('navigation', { name: 'System drill-downs' });
+ // Only the drill-in nav's three links exist — the forge alert adds none.
+ expect(within(nav).getAllByRole('link')).toHaveLength(3);
+ expect(screen.getAllByRole('link')).toHaveLength(4);
+ });
+
+ it('renders the drill-in links above the metric cards', async () => {
+ api.getSystemHealth.mockResolvedValue(withWarnings([]));
+ renderPage();
+
+ const nav = await screen.findByRole('navigation', { name: 'System drill-downs' });
+ const cards = screen.getByText('Memory').closest('section');
+ await waitFor(() => expect(nav.compareDocumentPosition(cards) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy());
+ });
+});