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: add dismiss button and mobile viewport cap for maintenance notifications

[._.]/ Adam Eivy728d8543194f
diff --git a/client/src/components/cos/tabs/schedule/MaintenanceRunStatus.jsx b/client/src/components/cos/tabs/schedule/MaintenanceRunStatus.jsx
index 0d4ddfb608..12b2690658 100644
--- a/client/src/components/cos/tabs/schedule/MaintenanceRunStatus.jsx
+++ b/client/src/components/cos/tabs/schedule/MaintenanceRunStatus.jsx
@@ -1,3 +1,4 @@
+import { X } from 'lucide-react';
import { formatCount } from '../../../../utils/formatters';
import MaintenanceStepChecklist from './MaintenanceStepChecklist';
@@ -24,12 +25,24 @@ export function maintenanceRunProgress(run = {}) {
}
/** Shared live progress content for the schedule card and corner notification. */
-export default function MaintenanceRunStatus({ run, showSteps = false, renderStepSettings }) {
+export default function MaintenanceRunStatus({ run, showSteps = false, renderStepSettings, onDismiss }) {
const { current, done, total, step } = maintenanceRunProgress(run);
return <div className={`space-y-1 text-xs min-w-0 ${showSteps ? 'w-full' : ''}`} role="status">
- <p>{run.status} · {current}/{total} steps{run.status === 'running' && step ? ` · ${step}` : ''}</p>
+ <div className="flex items-center justify-between gap-2">
+ <p className="min-w-0 flex-1">{run.status} · {current}/{total} steps{run.status === 'running' && step ? ` · ${step}` : ''}</p>
+ {onDismiss && (
+ <button
+ type="button"
+ onClick={onDismiss}
+ aria-label="Dismiss notification"
+ className="min-h-[44px] min-w-[44px] -my-2 -mr-2 inline-flex items-center justify-center rounded text-gray-400 hover:text-white transition-colors"
+ >
+ <X size={14} />
+ </button>
+ )}
+ </div>
<progress aria-label="Maintenance steps completed" value={done} max={total || 1} className="w-full h-1 accent-port-accent" />
- {run.auditDepth === 'deep' && Object.entries(run.deepAudits || {}).map(([id, audit]) => <div key={id} className="space-y-1">
+ {run.auditDepth === 'deep' && Object.entries(run.deepAudits || {}).map(([id, audit]) => <div key={id} className="space-y-1 max-h-36 overflow-y-auto pr-1">
<p>Deep discovery: {audit.discoveryComplete ? 'complete' : 'partial'} · {formatCount(audit.reviewedUnits)}/{formatCount(audit.totalUnits)} units reviewed · {formatCount(audit.satisfiedPasses)}/{formatCount(audit.requiredPasses)} pass requirements</p>
<p>{formatCount(audit.blockedUnits)} blocked · {formatCount(audit.pendingCandidates)} candidates awaiting triage · Delivery: {audit.deliveryComplete ? 'complete' : 'pending'} · {formatCount(audit.pendingRemediations)} remediations pending</p>
{audit.revision && <p>Source revision: <code>{audit.revision.slice(0, 12)}</code></p>}
@@ -40,7 +53,7 @@ export default function MaintenanceRunStatus({ run, showSteps = false, renderSte
{run.active.status || 'queued'}
{run.active.agentId && <a className="underline" href={`/cos/agents/${encodeURIComponent(run.active.agentId)}`} target="_blank" rel="noopener noreferrer">Open agent in new tab</a>}
</p>}
- {run.reason && <details><summary className="cursor-pointer">Run details</summary><p className="break-all">{run.reason}</p></details>}
+ {run.reason && <details><summary className="cursor-pointer">Run details</summary><p className="break-all max-h-36 overflow-y-auto">{run.reason}</p></details>}
{showSteps && <MaintenanceStepChecklist steps={run.steps} completed={run.completed} activeStepId={run.active?.stepId} renderStepSettings={renderStepSettings} />}
</div>;
}
diff --git a/client/src/components/ui/Toast.jsx b/client/src/components/ui/Toast.jsx
index 1dd26ab558..3c56dd40a9 100644
--- a/client/src/components/ui/Toast.jsx
+++ b/client/src/components/ui/Toast.jsx
@@ -397,7 +397,7 @@ function ToastItem({ t, toastOptions }) {
// focus; both land in one batch, so the hold never blips false.
onFocus={() => setFocusWithin(true)}
onBlur={() => setFocusWithin(false)}
- className="pointer-events-auto flex items-start gap-2 shadow-lg text-sm max-w-[calc(100vw-2rem)] sm:max-w-[520px] bg-port-card border border-port-border">
+ className="pointer-events-auto flex items-start gap-2 shadow-lg text-sm max-w-[calc(100vw-2rem)] sm:max-w-[520px] max-h-[min(75vh,520px)] overflow-y-auto bg-port-card border border-port-border">
{iconNode && <span className={`shrink-0 ${iconClass} ${iconBoxClass}`} aria-hidden="true">{iconNode}</span>}
<div className="flex-1 min-w-0">
{typeof t.content === 'function' ? t.content({ id: t.id }) : <span>{t.content}</span>}
diff --git a/client/src/components/ui/Toast.test.jsx b/client/src/components/ui/Toast.test.jsx
index 26a3d96565..9753f59607 100644
--- a/client/src/components/ui/Toast.test.jsx
+++ b/client/src/components/ui/Toast.test.jsx
@@ -46,6 +46,14 @@ describe('Toaster accessibility', () => {
expect(status).not.toHaveAttribute('aria-live');
});
+ it('bounds toast viewport height and allows scrolling so it never overloads mobile screens', () => {
+ render(<Toaster />);
+ act(() => { toast('A notification with potential long content'); });
+ const status = screen.getByRole('status');
+ expect(status.className).toContain('max-h-[min(75vh,520px)]');
+ expect(status.className).toContain('overflow-y-auto');
+ });
+
it('announces an error toast assertively (role="alert") without a redundant aria-live', () => {
render(<Toaster />);
act(() => { toast.error('Boom'); });
diff --git a/client/src/hooks/useOnDemandTaskToast.js b/client/src/hooks/useOnDemandTaskToast.js
index 8d23dd726a..62bc4def50 100644
--- a/client/src/hooks/useOnDemandTaskToast.js
+++ b/client/src/hooks/useOnDemandTaskToast.js
@@ -60,8 +60,10 @@ export function useOnDemandTaskToast() {
maintenanceStates.set(run.id, signature);
if (maintenanceStates.size > 100) maintenanceStates.delete(maintenanceStates.keys().next().value);
if (run.status !== 'running') toast.dismiss(`maintenance-${run.id}`);
- toast(() => createElement(MaintenanceRunStatus, { run }), {
- id: run.status === 'running' ? `maintenance-${run.id}` : `maintenance-${run.id}-${run.updatedAt}`, label, duration: run.status === 'running' ? Infinity : 8000,
+ const toastId = run.status === 'running' ? `maintenance-${run.id}` : `maintenance-${run.id}-${run.updatedAt}`;
+ const onDismiss = () => toast.dismiss(toastId);
+ toast(() => createElement(MaintenanceRunStatus, { run, onDismiss }), {
+ id: toastId, label, duration: run.status === 'running' ? Infinity : 8000,
});
};
socket.on('cos:maintenance:updated', handleMaintenance);
diff --git a/client/src/hooks/useOnDemandTaskToast.test.jsx b/client/src/hooks/useOnDemandTaskToast.test.jsx
index ed2975c1a8..63016109c4 100644
--- a/client/src/hooks/useOnDemandTaskToast.test.jsx
+++ b/client/src/hooks/useOnDemandTaskToast.test.jsx
@@ -13,7 +13,8 @@ vi.mock('../services/socket', () => ({
}));
const toastSpy = vi.fn();
-vi.mock('../components/ui/Toast', () => ({ default: Object.assign((...a) => toastSpy(...a), { dismiss: vi.fn() }) }));
+const dismissSpy = vi.fn();
+vi.mock('../components/ui/Toast', () => ({ default: Object.assign((...a) => toastSpy(...a), { dismiss: (...a) => dismissSpy(...a) }) }));
const { useOnDemandTaskToast } = await import('./useOnDemandTaskToast.js');
const fire = (payload) => handlers.get('cos:schedule:on-demand-empty')?.(payload);
@@ -276,6 +277,12 @@ it('updates one maintenance notification with an agent link and expires terminal
expect(toastSpy).toHaveBeenCalledTimes(1);
expect(toastSpy.mock.calls[0][1]).toMatchObject({ id: 'maintenance-maint-example', duration: Infinity });
expect(toastSpy.mock.calls[0][0]().props.run.active.agentId).toBe('agent-example');
+ // onDismiss dismisses the toast
+ expect(typeof toastSpy.mock.calls[0][0]().props.onDismiss).toBe('function');
+ dismissSpy.mockClear();
+ toastSpy.mock.calls[0][0]().props.onDismiss();
+ expect(dismissSpy).toHaveBeenCalledWith('maintenance-maint-example');
+
update({ ...run, status: 'completed', active: null, completed: { 'step-1': 'done' }, updatedAt: 'finished' });
expect(toastSpy.mock.calls[1][1]).toMatchObject({ duration: 8000, label: 'Maintenance · 1/1 · completed' });
unmount();