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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: make Settings General and Backup task-first (#7858)
[._.]/ Adam Eivy63ddfb9867a2
diff --git a/client/src/components/settings/BackupTab.jsx b/client/src/components/settings/BackupTab.jsxindex 114dc7d2be..3005d159d0 100644--- a/client/src/components/settings/BackupTab.jsx+++ b/client/src/components/settings/BackupTab.jsx@@ -1,13 +1,16 @@import { useState, useEffect, useId, useRef } from 'react';-import { Save, Plus, X, Play, ShieldOff, ChevronDown, ChevronRight } from 'lucide-react';+import { AlertTriangle, Archive, CalendarClock, CheckCircle2, Database, Play, Plus, Save, ShieldOff, X, ChevronDown, ChevronRight } from 'lucide-react';import toast from '../ui/Toast';import BrailleSpinner from '../BrailleSpinner';import ToggleSwitch from '../ToggleSwitch';import FolderPicker from '../FolderPicker';import { useBackupRun } from '../../hooks/useBackupRun';import Modal from '../ui/Modal';+import Banner from '../ui/Banner';+import CollapsibleSection from '../ui/CollapsibleSection';import { getSettings, updateSettings, getBackupStatus, getBackupSnapshots, restoreDatabase } from '../../services/api';import { formatBytes } from '../../utils/formatters';+import { describeCron } from '../../utils/cronHelpers';import CronSchedulePicker from '../CronSchedulePicker';import { anchorUserExclude, anchorUserExcludes, isSafeExcludePattern } from '../../lib/backupExcludes';@@ -36,6 +39,8 @@ export function BackupTab() {const additionalExcludeId = useId();const defaultExcludesPanelId = useId();const effectiveExcludesPanelId = useId();+ const exclusionsPanelId = useId();+ const snapshotsPanelId = useId();const [loading, setLoading] = useState(true);// A settings response that never resolved is NOT 'the defaults' — the schedule// fields stay null and the form is replaced by an error panel, so an unreachable@@ -62,6 +67,8 @@ export function BackupTab() {const [backupStatus, setBackupStatus] = useState('never');const [snapshots, setSnapshots] = useState([]);const [showAllSnapshots, setShowAllSnapshots] = useState(false);+ const [showExclusions, setShowExclusions] = useState(false);+ const [showSnapshots, setShowSnapshots] = useState(false);const [restoreTarget, setRestoreTarget] = useState(null); // source-bound request pending confirmconst [restorePreview, setRestorePreview] = useState(null); // dry-run resultconst restorePreviewGenerationRef = useRef(0);@@ -205,6 +212,15 @@ export function BackupTab() {...defaultExcludeRows.filter(d => d.defaultActive).map(d => d.path),...anchorUserExcludes(excludePaths),])];+ const scheduleSummary = enabled+ ? (describeCron(cronExpression) || cronExpression)+ : 'Scheduled backups are off';+ const snapshotSummary = snapshots.length > 0+ ? `${snapshots.length} ${snapshots.length === 1 ? 'snapshot' : 'snapshots'}`+ : 'No snapshots yet';+ const exclusionsSummary = excludePaths.length > 0+ ? `${excludePaths.length} custom · ${effectiveExcludes.length} active patterns`+ : `${effectiveExcludes.length} active patterns`;const renderPgStatus = () => {if (!pgBackup) return <span className="text-gray-500">No backup run yet</span>;@@ -268,205 +284,304 @@ export function BackupTab() {};return (- <div className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-5">+ <section+ aria-labelledby="backup-settings-heading"+ data-testid="backup-settings-workspace"+ className="@container bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-5"+ >+ <h2 id="backup-settings-heading" className="sr-only">Backup operations and configuration</h2>{backupStatus === 'degraded' && (- <div className="bg-port-warning/10 border border-port-warning/40 rounded-lg px-3 py-2 text-sm text-port-warning">- ⚠️ Last backup degraded — files were saved but the database dump failed.{' '}+ <Banner tone="warning" icon={AlertTriangle} title="Last backup degraded" size="md">+ Files were saved but the database dump failed.{' '}{pgBackup?.reason === 'version_mismatch' ? (- <>Your <code>pg_dump</code> is older than the running PostgreSQL server. Install/point at a <code>pg_dump</code> at least as new as the server (e.g. <code>brew install postgresql@17</code>), or set <code>PORTOS_PGDUMP</code> to its path.</>+ <>Your <code>pg_dump</code> is older than the running PostgreSQL server. Install/point at a <code>pg_dump</code> at least as new as the server (for example, <code>brew install postgresql@17</code>), or set <code>PORTOS_PGDUMP</code> to its path.</>) : (<>Check that <code>pg_dump</code> is installed and PostgreSQL is reachable.</>)}- </div>+ </Banner>)}- <div className="space-y-1">- <p className="block text-sm text-gray-400">Database Backup (last run)</p>- <div className="text-sm">{renderPgStatus()}</div>+ <div className="grid grid-cols-1 @min-[52rem]:grid-cols-2 gap-4 items-start">+ <div className="min-w-0 rounded-xl border border-port-border/70 bg-port-bg/30 p-4">+ <div className="flex items-start justify-between gap-3">+ <h3 className="flex items-center gap-2 text-base font-semibold text-white">+ <Database size={17} className="text-port-accent shrink-0" aria-hidden="true" />+ Backup health+ </h3>+ {backupStatus === 'ok' && <CheckCircle2 size={17} className="text-port-success shrink-0" aria-label="Healthy" />}+ </div>+ <p className="mt-1 text-sm text-gray-400">The latest file and database result before you change the next run.</p>+ <div className="mt-4 space-y-1">+ <p className="text-xs uppercase tracking-wide text-gray-500">Database backup</p>+ <div className="text-sm">{renderPgStatus()}</div>+ </div>+ </div>++ <div className="min-w-0 rounded-xl border border-port-border/70 bg-port-bg/30 p-4">+ <h3 className="flex items-center gap-2 text-base font-semibold text-white">+ <CalendarClock size={17} className="text-port-accent shrink-0" aria-hidden="true" />+ Saved schedule+ </h3>+ <p className="mt-1 text-sm text-gray-300 break-words">{scheduleSummary}</p>+ <p className="mt-2 text-xs text-gray-500 break-all">+ {savedDestPath ? `Destination: ${savedDestPath}` : 'No saved destination — scheduled and manual runs are unavailable.'}+ </p>+ <p className="mt-2 text-xs text-gray-500">Run Backup Now uses these saved values, not an unsaved draft.</p>+ </div></div>- <div className="space-y-1">- <label htmlFor={destPathId} className="block text-sm text-gray-400">Destination Path</label>- <div className="flex gap-2 items-stretch">- <input- id={destPathId}- type="text"- value={destPath}- onChange={e => setDestPath(e.target.value)}- className="flex-1 min-w-0 bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-port-accent"- placeholder="/path/to/backups"- />- <FolderPicker value={destPath} onChange={setDestPath} />+ <div className="border-t border-port-border pt-5 space-y-4">+ <div>+ <h3 className="flex items-center gap-2 text-base font-semibold text-white">Destination and schedule</h3>+ <p className="mt-1 text-sm text-gray-400">Choose where snapshots go and when scheduled backups run.</p>+ </div>+ <div className="grid grid-cols-1 @min-[52rem]:grid-cols-[minmax(0,1fr)_minmax(0,24rem)] gap-4 items-start">+ <div className="space-y-1 min-w-0">+ <label htmlFor={destPathId} className="block text-sm text-gray-400">Destination Path</label>+ <div className="flex flex-wrap gap-2 items-stretch">+ <input+ id={destPathId}+ type="text"+ value={destPath}+ onChange={e => setDestPath(e.target.value)}+ className="flex-1 min-w-[12rem] bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-port-accent"+ placeholder="/path/to/backups"+ />+ <FolderPicker value={destPath} onChange={setDestPath} />+ </div>+ </div>++ <div className="space-y-4 min-w-0">+ <div className="flex items-center gap-3">+ <span className="text-sm text-gray-400">Enabled</span>+ <button+ type="button"+ role="switch"+ onClick={() => setEnabled(!enabled)}+ aria-label="Scheduled backups"+ aria-checked={enabled}+ className={`relative w-10 h-5 rounded-full transition-colors ${enabled ? 'bg-port-accent' : 'bg-port-border'}`}+ >+ <span className={`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${enabled ? 'translate-x-5' : ''}`} />+ </button>+ </div>+ <div className="space-y-1">+ <span className="block text-sm text-gray-400">Schedule</span>+ <CronSchedulePicker value={cronExpression} onChange={setCronExpression} cronAriaLabel="Schedule (cron)" />+ <p className="text-xs text-gray-500">Default: 2:00 AM daily. Times use the configured timezone.</p>+ </div>+ </div></div></div>- <div className="flex items-center gap-3">- <span className="text-sm text-gray-400">Enabled</span>+ {/* Keep saved-state actions before the detail disclosures. The bar remains+ sticky while the longer exclusion and snapshot regions are open. */}+ <div className="sticky bottom-0 z-20 flex flex-wrap items-center gap-2 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 bg-port-card/95 sm:backdrop-blur border-y border-port-border"><button- type="button"- role="switch"- onClick={() => setEnabled(!enabled)}- aria-label="Scheduled backups"- aria-checked={enabled}- className={`relative w-10 h-5 rounded-full transition-colors ${enabled ? 'bg-port-accent' : 'bg-port-border'}`}+ onClick={handleSave}+ disabled={saving}+ className="inline-flex items-center justify-center gap-2 min-h-[40px] px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50">- <span className={`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white transition-transform ${enabled ? 'translate-x-5' : ''}`} />+ {saving ? <BrailleSpinner /> : <Save size={16} />}+ Save</button>+ <button+ onClick={handleRunNow}+ disabled={!canRun}+ title={runTitle}+ aria-describedby={runDisabledReason ? 'backup-run-disabled-reason' : undefined}+ className="inline-flex items-center justify-center gap-2 min-h-[40px] px-4 py-2 bg-port-border hover:bg-port-border/70 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"+ >+ {running ? <BrailleSpinner /> : <Play size={16} />}+ {running ? 'Running…' : 'Run Backup Now'}+ </button>+ <span+ id="backup-run-disabled-reason"+ className="text-xs text-gray-500"+ aria-live="polite"+ >+ {runDisabledReason || formStatus}+ </span></div>- <div className="space-y-1">- <span className="block text-sm text-gray-400">Schedule</span>- <CronSchedulePicker value={cronExpression} onChange={setCronExpression} cronAriaLabel="Schedule (cron)" />- <p className="text-xs text-gray-500">Default: 2:00 AM daily. Times use the configured timezone.</p>- </div>+ <div className="border-t border-port-border pt-5">+ <CollapsibleSection+ label="Exclusions"+ icon={ShieldOff}+ summary={exclusionsSummary}+ id={exclusionsPanelId}+ open={showExclusions}+ onOpenChange={setShowExclusions}+ size="bar"+ className="space-y-3"+ bodyClassName="space-y-4 pt-2"+ >+ <p className="text-sm text-gray-400">Review what stays out of snapshots. Detailed rules are one click away so the recovery actions remain easy to find.</p>- {defaultExcludeRows.length > 0 && (- <div className="space-y-2">- <button- type="button"- onClick={() => setShowDefaultExcludes(v => !v)}- aria-expanded={showDefaultExcludes}- aria-controls={defaultExcludesPanelId}- className="flex items-center gap-2 w-full text-left text-sm text-gray-400 hover:text-white transition-colors"- >- {showDefaultExcludes ? <ChevronDown size={14} className="shrink-0" /> : <ChevronRight size={14} className="shrink-0" />}- <ShieldOff size={14} className="text-gray-500 shrink-0" />- <span>Default exclusions — {enabledDefaultCount} enabled, {disabledDefaultCount} disabled</span>- </button>- {showDefaultExcludes && (- <div id={defaultExcludesPanelId} className="space-y-2">- <p className="text-xs text-gray-500">Built-in exclusion rules keep snapshots small. Switch on to disable an overridable default rule; fixed rules remain enabled.</p>- <ul className="space-y-1.5 mt-1">- {defaultExcludeRows.map((d, i) => (- <li key={i} className="flex items-start gap-2 text-xs">- {d.overridable ? (- <ToggleSwitch- enabled={!d.defaultActive}- onChange={() => toggleDefaultExclude(d.path)}- size="sm"- ariaLabel={`Disable default exclusion ${d.path}`}- className="mt-0.5"- />- ) : (- <span className="inline-flex items-center justify-center w-12 h-7 shrink-0 text-gray-600" title="Fixed default exclusion — always enabled">- <ShieldOff size={14} />- </span>- )}- <code className="px-1.5 py-0.5 bg-port-bg border rounded shrink-0 text-gray-300 border-port-border">{d.path}</code>- <span className="text-gray-500">- {d.reason}- {!d.defaultActive && <span className="text-gray-400 ml-1">(Default exclusion disabled)</span>}- </span>- </li>- ))}- </ul>+ {defaultExcludeRows.length > 0 && (+ <div className="space-y-2">+ <button+ type="button"+ onClick={() => setShowDefaultExcludes(v => !v)}+ aria-expanded={showDefaultExcludes}+ aria-controls={defaultExcludesPanelId}+ className="flex items-center gap-2 w-full text-left text-sm text-gray-400 hover:text-white transition-colors min-h-[44px]"+ >+ {showDefaultExcludes ? <ChevronDown size={14} className="shrink-0" /> : <ChevronRight size={14} className="shrink-0" />}+ <ShieldOff size={14} className="text-gray-500 shrink-0" />+ <span>Default exclusions — {enabledDefaultCount} enabled, {disabledDefaultCount} disabled</span>+ </button>+ {showDefaultExcludes && (+ <div id={defaultExcludesPanelId} className="space-y-2">+ <p className="text-xs text-gray-500">Built-in exclusion rules keep snapshots small. Switch on to disable an overridable default rule; fixed rules remain enabled.</p>+ <ul className="space-y-1.5 mt-1">+ {defaultExcludeRows.map((d, i) => (+ <li key={i} className="flex items-start gap-2 text-xs">+ {d.overridable ? (+ <ToggleSwitch+ enabled={!d.defaultActive}+ onChange={() => toggleDefaultExclude(d.path)}+ size="sm"+ ariaLabel={`Disable default exclusion ${d.path}`}+ className="mt-0.5"+ />+ ) : (+ <span className="inline-flex items-center justify-center w-12 h-7 shrink-0 text-gray-600" title="Fixed default exclusion — always enabled">+ <ShieldOff size={14} />+ </span>+ )}+ <code className="px-1.5 py-0.5 bg-port-bg border rounded shrink-0 text-gray-300 border-port-border">{d.path}</code>+ <span className="text-gray-500">+ {d.reason}+ {!d.defaultActive && <span className="text-gray-400 ml-1">(Default exclusion disabled)</span>}+ </span>+ </li>+ ))}+ </ul>+ </div>+ )}</div>)}- </div>- )}- <div className="space-y-2">- <label htmlFor={additionalExcludeId} className="block text-sm text-gray-400">Additional Exclude Paths</label>- <p className="text-xs text-gray-500">Custom directories/patterns to skip during backup (relative to data/). Patterns are anchored to the data root, so <code>repos/</code> is stored as <code>/repos/</code> and skips only <code>data/repos/</code>. Start a pattern with <code>**/</code> to match at any depth instead. Additional rules still apply when a default exclusion is disabled. Disabling a default does not guarantee matching files will be backed up.</p>- <div className="flex gap-2">- <input- id={additionalExcludeId}- type="text"- value={newExclude}- onChange={e => setNewExclude(e.target.value)}- onKeyDown={e => e.key === 'Enter' && addExclude()}- className="flex-1 bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-port-accent"- placeholder="/repos/"- />- <button- onClick={addExclude}- disabled={!anchorUserExclude(newExclude)}- aria-label="Add exclude path"- className="inline-flex items-center justify-center min-w-[40px] min-h-[40px] px-3 py-2 bg-port-border hover:bg-port-border/70 text-white rounded-lg transition-colors disabled:opacity-50 shrink-0"- >- <Plus size={16} />- </button>- </div>- {excludePaths.length > 0 && (- <div className="flex flex-wrap gap-2 mt-2">- {excludePaths.map((path, i) => (- <span key={i} className="inline-flex items-center gap-1.5 px-2.5 py-1 bg-port-bg border border-port-border rounded-lg text-sm text-gray-300">- <code className="text-xs">{path}</code>- <button onClick={() => removeExclude(i)} aria-label="Dismiss" className="text-gray-500 hover:text-port-error transition-colors">- <X size={14} />- </button>- </span>- ))}- </div>- )}+ <div className="space-y-2">+ <label htmlFor={additionalExcludeId} className="block text-sm text-gray-400">Additional Exclude Paths</label>+ <p className="text-xs text-gray-500">Custom directories/patterns to skip during backup (relative to data/). Patterns are anchored to the data root, so <code>repos/</code> is stored as <code>/repos/</code> and skips only <code>data/repos/</code>. Start a pattern with <code>**/</code> to match at any depth instead. Additional rules still apply when a default exclusion is disabled. Disabling a default does not guarantee matching files will be backed up.</p>+ <div className="flex flex-wrap gap-2">+ <input+ id={additionalExcludeId}+ type="text"+ value={newExclude}+ onChange={e => setNewExclude(e.target.value)}+ onKeyDown={e => e.key === 'Enter' && addExclude()}+ className="flex-1 min-w-[12rem] bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-port-accent"+ placeholder="/repos/"+ />+ <button+ onClick={addExclude}+ disabled={!anchorUserExclude(newExclude)}+ aria-label="Add exclude path"+ className="inline-flex items-center justify-center min-w-[40px] min-h-[40px] px-3 py-2 bg-port-border hover:bg-port-border/70 text-white rounded-lg transition-colors disabled:opacity-50 shrink-0"+ >+ <Plus size={16} />+ </button>+ </div>+ {excludePaths.length > 0 && (+ <div className="flex flex-wrap gap-2 mt-2">+ {excludePaths.map((path, i) => (+ <span key={i} className="inline-flex items-center gap-1.5 px-2.5 py-1 bg-port-bg border border-port-border rounded-lg text-sm text-gray-300">+ <code className="text-xs break-all">{path}</code>+ <button onClick={() => removeExclude(i)} aria-label="Dismiss" className="text-gray-500 hover:text-port-error transition-colors">+ <X size={14} />+ </button>+ </span>+ ))}+ </div>+ )}- {effectiveExcludes.length > 0 && (- <div className="space-y-2 pt-1">- <button- type="button"- onClick={() => setShowEffectiveExcludes(v => !v)}- aria-expanded={showEffectiveExcludes}- aria-controls={effectiveExcludesPanelId}- className="flex items-center gap-2 w-full text-left text-sm text-gray-400 hover:text-white transition-colors"- >- {showEffectiveExcludes ? <ChevronDown size={14} className="shrink-0" /> : <ChevronRight size={14} className="shrink-0" />}- <span>Effective exclude list — {effectiveExcludes.length} rsync {effectiveExcludes.length === 1 ? 'pattern' : 'patterns'}</span>- </button>- {showEffectiveExcludes && (- <div id={effectiveExcludesPanelId} className="space-y-2">- <p className="text-xs text-gray-500">The exact <code>--exclude</code> filters the next snapshot will use: enabled default rules plus your anchored patterns. Saved changes above are reflected here.</p>- <ul className="flex flex-wrap gap-1.5">- {effectiveExcludes.map((pattern) => (- <li key={pattern}>- <code className="inline-block px-1.5 py-0.5 bg-port-bg border border-port-border rounded text-xs text-gray-300 break-all">{pattern}</code>- </li>- ))}- </ul>+ {effectiveExcludes.length > 0 && (+ <div className="space-y-2 pt-1">+ <button+ type="button"+ onClick={() => setShowEffectiveExcludes(v => !v)}+ aria-expanded={showEffectiveExcludes}+ aria-controls={effectiveExcludesPanelId}+ className="flex items-center gap-2 w-full text-left text-sm text-gray-400 hover:text-white transition-colors min-h-[44px]"+ >+ {showEffectiveExcludes ? <ChevronDown size={14} className="shrink-0" /> : <ChevronRight size={14} className="shrink-0" />}+ <span>Effective exclude list — {effectiveExcludes.length} rsync {effectiveExcludes.length === 1 ? 'pattern' : 'patterns'}</span>+ </button>+ {showEffectiveExcludes && (+ <div id={effectiveExcludesPanelId} className="space-y-2">+ <p className="text-xs text-gray-500">The exact <code>--exclude</code> filters the next snapshot will use: enabled default rules plus your anchored patterns. Saved changes above are reflected here.</p>+ <ul className="flex flex-wrap gap-1.5">+ {effectiveExcludes.map((pattern) => (+ <li key={pattern}>+ <code className="inline-block px-1.5 py-0.5 bg-port-bg border border-port-border rounded text-xs text-gray-300 break-all">{pattern}</code>+ </li>+ ))}+ </ul>+ </div>+ )}</div>)}</div>- )}+ </CollapsibleSection></div>- {snapshots.length > 0 && (- <div className="space-y-2">- <p className="block text-sm text-gray-400">Snapshots</p>- <ul className="space-y-1.5">- {(showAllSnapshots ? snapshots : snapshots.slice(0, 10)).map((snap) => (- <li key={snapshotIdentity(snap)} className="flex items-center justify-between gap-2 text-xs bg-port-bg border border-port-border rounded-lg px-2.5 py-1.5">- <span className="min-w-0">- <span className="block text-gray-300 truncate">{snap.id}</span>- <span className="block text-gray-500 truncate">Source: {snapshotSourceLabel(snap)}</span>- {snap.failed && (- <span className="block text-port-error">Backup failed — download only</span>- )}- {snap.incomplete && (- <span className="block text-gray-500">Still being written…</span>- )}- </span>+ <div className="border-t border-port-border pt-5">+ <CollapsibleSection+ label="Snapshot history"+ icon={Archive}+ summary={snapshotSummary}+ id={snapshotsPanelId}+ open={showSnapshots}+ onOpenChange={setShowSnapshots}+ size="bar"+ className="space-y-3"+ bodyClassName="space-y-2 pt-2"+ >+ {snapshots.length === 0 ? (+ <p className="text-sm text-gray-500">No snapshots have been recorded on this machine yet.</p>+ ) : (+ <>+ <ul className="space-y-1.5">+ {(showAllSnapshots ? snapshots : snapshots.slice(0, 10)).map((snap) => (+ <li key={snapshotIdentity(snap)} className="flex items-center justify-between gap-2 text-xs bg-port-bg border border-port-border rounded-lg px-2.5 py-1.5">+ <span className="min-w-0">+ <span className="block text-gray-300 truncate">{snap.id}</span>+ <span className="block text-gray-500 truncate">Source: {snapshotSourceLabel(snap)}</span>+ {snap.failed && (+ <span className="block text-port-error">Backup failed — download only</span>+ )}+ {snap.incomplete && (+ <span className="block text-gray-500">Still being written…</span>+ )}+ </span>+ <button+ onClick={() => handleRestoreDb(snap)}+ disabled={snap.failed || snap.incomplete}+ title={snap.failed ? 'Failed backup snapshots can only be downloaded for salvage' : undefined}+ className="shrink-0 px-2 py-2 min-h-[40px] bg-port-border hover:bg-port-border/70 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed"+ >+ Restore DB+ </button>+ </li>+ ))}+ </ul>+ {snapshots.length > 10 && (<button- onClick={() => handleRestoreDb(snap)}- disabled={snap.failed || snap.incomplete}- title={snap.failed ? 'Failed backup snapshots can only be downloaded for salvage' : undefined}- className="shrink-0 px-2 py-1 bg-port-border hover:bg-port-border/70 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed"+ type="button"+ onClick={() => setShowAllSnapshots(value => !value)}+ aria-expanded={showAllSnapshots}+ className="text-xs text-port-accent hover:text-port-accent/80 transition-colors min-h-[32px]">- Restore DB+ {showAllSnapshots ? 'Show newest 10 snapshots' : `Show all ${snapshots.length} snapshots`}</button>- </li>- ))}- </ul>- {snapshots.length > 10 && (- <button- type="button"- onClick={() => setShowAllSnapshots(value => !value)}- aria-expanded={showAllSnapshots}- className="text-xs text-port-accent hover:text-port-accent/80 transition-colors min-h-[32px]"- >- {showAllSnapshots ? 'Show newest 10 snapshots' : `Show all ${snapshots.length} snapshots`}- </button>+ )}+ </>)}- </div>- )}+ </CollapsibleSection>+ </div><Modalopen={!!restoreTarget}@@ -490,38 +605,7 @@ export function BackupTab() {</div></Modal>- {/* Sticky action bar — Save and Run Backup Now stay reachable no matter how- far the exclusions/snapshot lists push the page, and the bar carries the- unsaved-changes state so an edit at the top of the tab is never- committed blind. Negative margins bleed it to the card edges. */}- <div className="sticky bottom-0 z-20 flex flex-wrap items-center gap-2 -mx-4 sm:-mx-6 -mb-4 sm:-mb-6 px-4 sm:px-6 py-3 bg-port-card/95 sm:backdrop-blur border-t border-port-border rounded-b-xl">- <button- onClick={handleSave}- disabled={saving}- className="inline-flex items-center justify-center gap-2 min-h-[40px] px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50"- >- {saving ? <BrailleSpinner /> : <Save size={16} />}- Save- </button>- <button- onClick={handleRunNow}- disabled={!canRun}- title={runTitle}- aria-describedby={runDisabledReason ? 'backup-run-disabled-reason' : undefined}- className="inline-flex items-center justify-center gap-2 min-h-[40px] px-4 py-2 bg-port-border hover:bg-port-border/70 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"- >- {running ? <BrailleSpinner /> : <Play size={16} />}- {running ? 'Running…' : 'Run Backup Now'}- </button>- <span- id="backup-run-disabled-reason"- className="text-xs text-gray-500"- aria-live="polite"- >- {runDisabledReason || formStatus}- </span>- </div>- </div>+ </section>);}diff --git a/client/src/components/settings/BackupTab.test.jsx b/client/src/components/settings/BackupTab.test.jsxindex a3a7edf8bb..75f137dbdc 100644--- a/client/src/components/settings/BackupTab.test.jsx+++ b/client/src/components/settings/BackupTab.test.jsx@@ -47,12 +47,42 @@ beforeEach(() => {// Render and wait for the loading spinner to clear (the Save button only// appears post-load).-const renderTab = async () => {+const renderTab = async ({ openExclusions = true, openSnapshots = true } = {}) => {render(<BackupTab />);await waitFor(() => expect(screen.getByRole('button', { name: /^Save$/i })).toBeTruthy());+ if (openExclusions) {+ fireEvent.click(screen.getByRole('button', { name: /^Exclusions/i }));+ }+ if (openSnapshots) {+ fireEvent.click(screen.getByRole('button', { name: /^Snapshot history/i }));+ }};describe('BackupTab', () => {+ describe('task-first workspace', () => {+ it('keeps exclusions and snapshot history behind named disclosures', async () => {+ getBackupSnapshots.mockResolvedValue([{ id: 'snap-hidden' }]);+ await renderTab({ openExclusions: false, openSnapshots: false });++ const exclusions = screen.getByRole('button', { name: /^Exclusions/i });+ const snapshots = screen.getByRole('button', { name: /^Snapshot history/i });+ expect(exclusions).toHaveAttribute('aria-expanded', 'false');+ expect(snapshots).toHaveAttribute('aria-expanded', 'false');+ expect(screen.queryByLabelText(/Additional Exclude Paths/i)).not.toBeInTheDocument();+ expect(screen.queryByText('snap-hidden')).not.toBeInTheDocument();++ const content = screen.getByTestId('backup-settings-workspace').textContent;+ expect(content.indexOf('Backup health')).toBeLessThan(content.indexOf('Run Backup Now'));+ expect(content.indexOf('Run Backup Now')).toBeLessThan(content.indexOf('Exclusions'));+ expect(content.indexOf('Exclusions')).toBeLessThan(content.indexOf('Snapshot history'));++ fireEvent.click(exclusions);+ expect(screen.getByLabelText(/Additional Exclude Paths/i)).toBeInTheDocument();+ fireEvent.click(snapshots);+ expect(await screen.findByText('snap-hidden')).toBeInTheDocument();+ });+ });+describe('settings save flow', () => {it('persists the destination path and toasts success', async () => {updateSettings.mockResolvedValue({});diff --git a/client/src/components/settings/GeneralTab.jsx b/client/src/components/settings/GeneralTab.jsxindex 4cc23af49a..305f269b5c 100644--- a/client/src/components/settings/GeneralTab.jsx+++ b/client/src/components/settings/GeneralTab.jsx@@ -1,5 +1,5 @@import { useState, useEffect, useMemo } from 'react';-import { Save } from 'lucide-react';+import { Clock3, MapPin, Palette, Save } from 'lucide-react';import toast from '../ui/Toast';import FormField from '../ui/FormField';import UnsavedChangesConfirm from '../ui/UnsavedChangesConfirm';@@ -24,10 +24,12 @@ export function GeneralTab() {const [timezone, setTimezone] = useState('');const [savedTimezone, setSavedTimezone] = useState(null);const [saving, setSaving] = useState(false);+ const [timezoneError, setTimezoneError] = useState('');const [lat, setLat] = useState('');const [lon, setLon] = useState('');const [savedLocation, setSavedLocation] = useState(null);const [savingLocation, setSavingLocation] = useState(false);+ const [locationError, setLocationError] = useState('');const detectedTz = Intl.DateTimeFormat().resolvedOptions().timeZone;const allTimezones = useMemo(() => Intl.supportedValuesOf?.('timeZone') ?? [], []);const timezoneDirty = savedTimezone !== null && timezone !== savedTimezone;@@ -73,23 +75,32 @@ export function GeneralTab() {// Both-or-neither: weather needs a full pair, and a half-set pair would// silently mix a custom value with the tool's default coordinate.if (isBlank(lat) !== isBlank(lon)) {- toast.error('Enter both latitude and longitude, or clear both.');+ const message = 'Enter both latitude and longitude, or clear both.';+ setLocationError(message);+ toast.error(message);return;}const parsedLat = parseCoord(lat);const parsedLon = parseCoord(lon);if (Number.isNaN(parsedLat) || Number.isNaN(parsedLon)) {- toast.error('Latitude and longitude must be numbers.');+ const message = 'Latitude and longitude must be numbers.';+ setLocationError(message);+ toast.error(message);return;}if (parsedLat !== null && (parsedLat < -90 || parsedLat > 90)) {- toast.error('Latitude must be between -90 and 90.');+ const message = 'Latitude must be between -90 and 90.';+ setLocationError(message);+ toast.error(message);return;}if (parsedLon !== null && (parsedLon < -180 || parsedLon > 180)) {- toast.error('Longitude must be between -180 and 180.');+ const message = 'Longitude must be between -180 and 180.';+ setLocationError(message);+ toast.error(message);return;}+ setLocationError('');setSavingLocation(true);try {await updateSettings({ location: { lat: parsedLat, lon: parsedLon } }, { silent: true });@@ -100,7 +111,9 @@ export function GeneralTab() {setLon(current => current === submittedLon ? nextLon : current);toast.success(parsedLat === null ? 'Location cleared' : `Location set to ${parsedLat}, ${parsedLon}`);} catch (err) {- toast.error(err.message || 'Failed to save location');+ const message = err.message || 'Failed to save location';+ setLocationError(message);+ toast.error(message);} finally {setSavingLocation(false);}@@ -110,7 +123,9 @@ export function GeneralTab() {const submittedTimezone = timezone;const tzToSave = tz || detectedTz;if (!tzToSave) {- toast.error('Timezone is required.');+ const message = 'Timezone is required.';+ setTimezoneError(message);+ toast.error(message);return;}@@ -125,10 +140,13 @@ export function GeneralTab() {} catch { isValid = false; }}if (!isValid) {- toast.error('Invalid timezone. Please select a valid IANA timezone.');+ const message = 'Invalid timezone. Please select a valid IANA timezone.';+ setTimezoneError(message);+ toast.error(message);return;}+ setTimezoneError('');setSaving(true);try {await updateSettings({ timezone: tzToSave }, { silent: true });@@ -136,7 +154,9 @@ export function GeneralTab() {setTimezone(current => current === submittedTimezone ? tzToSave : current);toast.success(`Timezone set to ${tzToSave}`);} catch (err) {- toast.error(err.message || 'Failed to save timezone');+ const message = err.message || 'Failed to save timezone';+ setTimezoneError(message);+ toast.error(message);} finally {setSaving(false);}@@ -157,7 +177,12 @@ export function GeneralTab() {if (loading) return <BrailleSpinner />;return (- <div className="space-y-6">+ <section+ aria-labelledby="general-settings-heading"+ data-testid="general-settings-workspace"+ className="@container space-y-4"+ >+ <h2 id="general-settings-heading" className="sr-only">General settings</h2><UnsavedChangesConfirmguard={routeGuard}when={hasDiscardableChanges}@@ -165,8 +190,12 @@ export function GeneralTab() {label="Discard unsaved General settings changes"onDiscard={discardAndExit}/>- <div className="bg-port-card border border-port-border rounded-lg p-4 sm:p-6">- <h3 className="text-lg font-semibold text-white mb-4">Timezone</h3>+ <div className="grid grid-cols-1 @min-[52rem]:grid-cols-2 gap-4 items-start">+ <div data-testid="general-timezone-card" className="min-w-0 bg-port-card border border-port-border rounded-xl p-4 sm:p-5">+ <h3 className="flex items-center gap-2 text-base font-semibold text-white mb-2">+ <Clock3 size={17} className="text-port-accent shrink-0" aria-hidden="true" />+ Timezone+ </h3><p className="text-sm text-gray-400 mb-4">Used for job scheduling (cron expressions & scheduled times) and briefing dates.</p>@@ -179,7 +208,10 @@ export function GeneralTab() {id="timezone-input"type="text"value={timezone}- onChange={e => setTimezone(e.target.value)}+ onChange={e => {+ setTimezone(e.target.value);+ if (timezoneError) setTimezoneError('');+ }}disabled={saving}placeholder={detectedTz}className="w-full sm:flex-1 sm:max-w-xs min-w-0 px-3 py-2 bg-port-bg border border-port-border rounded-lg text-white text-sm disabled:opacity-50"@@ -213,6 +245,11 @@ export function GeneralTab() {</button>)}</FormField>+ {timezoneError && (+ <p role="alert" className="mt-3 text-sm text-port-error break-words">+ {timezoneError}+ </p>+ )}{timezone && timezone !== detectedTz && (<p className="text-xs text-gray-500 mt-2 break-all">Browser detected: {detectedTz}@@ -225,8 +262,11 @@ export function GeneralTab() {</datalist></div>- <div className="bg-port-card border border-port-border rounded-lg p-4 sm:p-6">- <h3 className="text-lg font-semibold text-white mb-4">Location</h3>+ <div data-testid="general-location-card" className="min-w-0 bg-port-card border border-port-border rounded-xl p-4 sm:p-5">+ <h3 className="flex items-center gap-2 text-base font-semibold text-white mb-2">+ <MapPin size={17} className="text-port-accent shrink-0" aria-hidden="true" />+ Location+ </h3><p className="text-sm text-gray-400 mb-4">Your home coordinates. Used by the voice assistant's weather command when youask “what's the weather?” without naming a place. Leave both blank to use a default location.@@ -242,7 +282,10 @@ export function GeneralTab() {type="text"inputMode="decimal"value={lat}- onChange={e => setLat(e.target.value)}+ onChange={e => {+ setLat(e.target.value);+ if (locationError) setLocationError('');+ }}disabled={savingLocation}placeholder="37.7749"className="w-full min-w-0 px-3 py-2 bg-port-bg border border-port-border rounded-lg text-white text-sm disabled:opacity-50"@@ -258,7 +301,10 @@ export function GeneralTab() {type="text"inputMode="decimal"value={lon}- onChange={e => setLon(e.target.value)}+ onChange={e => {+ setLon(e.target.value);+ if (locationError) setLocationError('');+ }}disabled={savingLocation}placeholder="-122.4194"className="w-full min-w-0 px-3 py-2 bg-port-bg border border-port-border rounded-lg text-white text-sm disabled:opacity-50"@@ -282,13 +328,23 @@ export function GeneralTab() {</span>)}</div>+ {locationError && (+ <p role="alert" className="mt-3 text-sm text-port-error break-words">+ {locationError}+ </p>+ )}+ </div></div>- <div className="bg-port-card border border-port-border rounded-lg p-4 sm:p-6">- <h3 className="text-lg font-semibold text-white mb-4">Interface Theme</h3>+ <div data-testid="general-theme-card" className="bg-port-card border border-port-border rounded-xl p-4 sm:p-5">+ <h3 className="flex items-center gap-2 text-base font-semibold text-white mb-2">+ <Palette size={17} className="text-port-accent shrink-0" aria-hidden="true" />+ Interface Theme+ </h3>+ <p className="text-sm text-gray-400 mb-4">Applies immediately and does not require a save.</p><ThemePickerPanel /></div>- </div>+ </section>);}diff --git a/client/src/components/settings/GeneralTab.test.jsx b/client/src/components/settings/GeneralTab.test.jsxindex 0c515dcdee..5ece005b1b 100644--- a/client/src/components/settings/GeneralTab.test.jsx+++ b/client/src/components/settings/GeneralTab.test.jsx@@ -67,6 +67,10 @@ describe('GeneralTab unsaved changes', () => {const headings = screen.getAllByRole('heading').map(heading => heading.textContent);expect(headings).toEqual(expect.arrayContaining(['Timezone', 'Interface Theme']));expect(headings.indexOf('Timezone')).toBeLessThan(headings.indexOf('Interface Theme'));+ expect(screen.getByTestId('general-timezone-card').parentElement).toHaveClass(+ 'grid-cols-1',+ '@min-[52rem]:grid-cols-2',+ );});it('guards edits made against the displayed fallback after loading fails', async () => {@@ -279,6 +283,7 @@ describe('GeneralTab unsaved changes', () => {await act(async () => {fireEvent.click(within(timezoneCard()).getByRole('button', { name: 'Save' }));});+ expect(within(timezoneCard()).getByRole('alert')).toHaveTextContent('timezone offline');expect(within(timezoneCard()).getByText('Unsaved changes')).toBeInTheDocument();await navigate(router, '/settings/security');@@ -295,6 +300,7 @@ describe('GeneralTab unsaved changes', () => {await act(async () => {fireEvent.click(within(locationCard()).getByRole('button', { name: 'Save' }));});+ expect(within(locationCard()).getByRole('alert')).toHaveTextContent('location offline');expect(within(locationCard()).getByText('Unsaved changes')).toBeInTheDocument();await navigate(router, '/settings/security');diff --git a/docs/UX_DESIGN_AUDIT.md b/docs/UX_DESIGN_AUDIT.mdindex 688b0813bf..58a93840f8 100644--- a/docs/UX_DESIGN_AUDIT.md+++ b/docs/UX_DESIGN_AUDIT.md@@ -8,7 +8,7 @@ Date: 2026-09-21. Scope: a representative sample to establish reusable patterns,- Performance: live 1,280px-wide browser screenshot/rendered content and checkout component review.- Runtimes: live browser screenshot, checkout component review, and the synthetic validation record in [the Runtimes pilot](validation/7795-runtimes-workspace.md).- CoS Tasks: live browser screenshot and checkout page/task component review.-- Settings General and Backup, Brain Threads and Notes, and the Apps list and detail: current source and rendered-test review only; observations about their rendered behavior remain hypotheses to validate.+- Settings General and Backup, Brain Threads and Notes, and the Apps list and detail: source and rendered-test review only; #7858 now has a synthetic validation record, while complete browser geometry and accessibility certification remain out of scope.- The live application displayed a client/server build mismatch. Its visual evidence and the current checkout are complementary snapshots; no runtime reconciliation or model actions were performed.- These are heuristic findings. No user task timings, complete accessibility audit, or production responsive test pass has been performed.@@ -22,7 +22,7 @@ Date: 2026-09-21. Scope: a representative sample to establish reusable patterns,| Runtimes: `client/src/components/settings/LocalLlmRuntimesView.jsx:716` | Service controls, installation, checkpoint discovery, default backend, and speculative tuning share a long page. Runtime rows have uneven density and control wrapping. | Operations roster with consistent identity/state/action columns; selected runtime configuration and named install/checkpoint workflow. | Independent services, process lifecycle truth, install progress, resource estimates, unavailable-platform states. || CoS: `client/src/pages/ChiefOfStaff.jsx:913`, `components/cos/tabs/TasksTab.jsx:214` | Desktop identity/avatar column reserves 320px; expanded task creation/settings appear before the queue. The live initial viewport emphasizes configuration and persona over task inspection. | Queue-first operations view; compact task composer, detailed execution settings on demand, collapsible persona retained as a preference. | Identity/personality, active progress, task creation defaults, review gates, sortable pending tasks, keyboard interactions. || Apps detail: `client/src/components/apps/AppDetailView.jsx:335` | Header combines identity and many lifecycle actions; density needs state-specific prioritization. Source already contains responsive title/edit grouping and a shared edit drawer. | Preserve these useful patterns; prioritize one contextual lifecycle action and move rare actions to the shared overflow pattern. | Edit next to identity, responsive behavior, status truth, app-specific controls and deep links. |-| Settings: `client/src/pages/Settings.jsx:61` | Same header + wide destination-strip shell as Models; large configuration domains compete for navigation. | Grouped section navigator, bounded form grids, per-task save feedback; retain feature-local settings drawers. | Existing redirects, save semantics, privacy/credential controls. |+| Settings: `client/src/pages/Settings.jsx:61` | Same header + wide destination-strip shell as Models; large configuration domains compete for navigation. | Grouped section navigator, bounded form grids, per-task save feedback; #7858 implements task-first General and Backup composition while retaining feature-local settings drawers. | Existing redirects, save semantics, privacy/credential controls. || Brain: `client/src/pages/Brain.jsx:148` | Many fixed sections share a tab row; the shell must also accommodate both documents and full-bleed tools. | Test a grouped navigator; preserve distinct document and workbench layouts rather than one universal grid. | URL-backed selection, full-bleed scroll ownership, drafts, loading geometry, record privacy. |Paths without a `client/src/` prefix in the evidence column are relative to it. Line numbers are audit anchors and may drift; component names and surrounding render blocks are the durable references.@@ -95,8 +95,8 @@ This is a bounded source-and-test audit after the Runtimes and CoS pilots. `Obse| Surface and evidence | Page family and three primary tasks | Before → after content map | Navigation, scroll, and state contract | Error boundary and follow-up || --- | --- | --- | --- | --- |-| Settings General — `client/src/pages/Settings.jsx`, `client/src/components/settings/GeneralTab.jsx` | Configuration. Set timezone; set or clear location; choose interface theme. | Three independent cards are already bounded by the Settings shell → group timezone and location as the recurring configuration work, with theme as a secondary preference that does not compete with save feedback. | `/settings/general` stays canonical, with the Settings icon from `NAV_PRESENTATION` and legacy tab redirects. The Settings content region owns the normal scroll. Independent saves, dirty indicators, and the unsaved-changes guard remain visible. | Load failure currently toasts and establishes empty baselines; field validation and save failure must keep the affected group dirty and actionable. Follow-up: [#7858](https://github.com/atomantic/PortOS/issues/7858). |-| Settings Backup — `client/src/pages/Settings.jsx`, `client/src/components/settings/BackupTab.jsx` | Operations + Configuration. Inspect backup health; configure schedule/destination/excludes; run or restore a backup. | A long form already contains status, schedule, disclosures, snapshots, and restore controls → put health and the next safe action first, with configuration and recovery detail disclosed below. | `/settings/backup` stays canonical with the Download icon. The Settings content region remains the primary scroll owner; the action bar may stay sticky without covering errors. Saved destination/schedule state, Run Now gating, dry-run restore, and destructive-action confirmation remain unchanged. | `loadFailed` already has an explicit unavailable panel; degraded database status, invalid restore input, and failed restore must remain distinct from an empty snapshot list. Follow-up: [#7858](https://github.com/atomantic/PortOS/issues/7858). |+| Settings General — `client/src/pages/Settings.jsx`, `client/src/components/settings/GeneralTab.jsx` | Configuration. Set timezone; set or clear location; choose interface theme. | Before: three independent cards compete equally for attention → after: timezone and location share a responsive recurring-configuration grid, theme follows as a secondary instant preference, and save errors remain beside their field group. | `/settings/general` stays canonical, with the Settings icon from `NAV_PRESENTATION` and legacy tab redirects. The Settings content region owns the normal scroll. Independent saves, dirty indicators, and the unsaved-changes guard remain visible. | Load failure still establishes an empty baseline and toasts; validation and save failures now also render inline, while the affected group stays dirty. Implemented in #7858; synthetic evidence: [validation/7858-settings-workspace.md](validation/7858-settings-workspace.md). |+| Settings Backup — `client/src/pages/Settings.jsx`, `client/src/components/settings/BackupTab.jsx` | Operations + Configuration. Inspect backup health; configure schedule/destination/excludes; run or restore a backup. | Before: status, schedule, exclusions, snapshots, and recovery controls form one long sequence → after: health and saved schedule lead, destination/schedule and saved-state actions follow, and exclusions plus snapshot history are named disclosures. | `/settings/backup` stays canonical with the Download icon. The Settings content region remains the primary scroll owner; the action bar stays sticky without covering errors. Saved destination/schedule state, Run Now gating, dry-run restore, and destructive-action confirmation remain unchanged. | `loadFailed` remains an explicit unavailable panel; degraded database status, invalid restore input, and failed restore remain distinct from an empty snapshot list. Implemented in #7858; synthetic evidence: [validation/7858-settings-workspace.md](validation/7858-settings-workspace.md). || Brain Threads — `client/src/pages/Brain.jsx`, `client/src/components/brain/tabs/ThreadsTab.jsx` | Collection. Capture an open loop; triage by status/tag/search; edit, link, or complete a selected thread. | The collection and URL-backed drawer are an adopted pattern → retain the full-bleed collection, add an explicit unavailable/retry state, and keep the drawer as the selected record's task surface. | `/brain/threads` remains a direct icon destination using ListTodo and `TabPills mobileCompact`. Threads owns its full-bleed scroll. `status`, `tag`, `q`, `thread`, and `threadTab` remain URL-backed; drafts/save/delete and browser Back remain observable. | List failure currently falls through to the same empty copy as “Nothing tracked yet”; a failed refresh must preserve the distinction and offer retry. Follow-up: [#7859](https://github.com/atomantic/PortOS/issues/7859). || Brain Notes — `client/src/pages/Brain.jsx`, `client/src/components/brain/tabs/NotesTab.jsx` | Document or canvas. Switch vault/folder; search and open a note; edit, create, delete, and save. | A local split pane provides vault/list/editor work → retain independent editor and list scrolling while making vault/note selection URL-shareable and keeping the active note visible on narrow screens. | `/brain/notes` remains a direct FileText destination with `TabPills mobileCompact`. The full-bleed shell owns the workspace; list and editor panes keep their own scroll only because this is a genuine list/detail editor. Note drafts, force-save, and request-lifetime behavior remain. | Vault, scan, and read failures currently become empty or stale state; delete failure can also report success after a swallowed request. Follow-up: [#7859](https://github.com/atomantic/PortOS/issues/7859) captures the deep-link and truthful-state repair. || Apps list — `client/src/pages/Apps.jsx`, `client/src/lib/layoutRoutes.js` | Collection. Inspect health; start/stop/restart or launch; open Manage/archive. | Rows currently mix collection identity/actions with repository, configuration, PM2, and board detail → keep identity, health, primary lifecycle actions, and Manage in the collection; route deep diagnostics to the detail workspace. | `/apps` remains the collection route with archive state in `?view=archived`, existing operation banners, and normal Layout scrolling. Keep lifecycle feedback, overflow confirmation, and feature-aware action availability. | `getApps` failure currently renders `No apps registered`, which is indistinguishable from a genuine empty collection. Follow-up: [#7860](https://github.com/atomantic/PortOS/issues/7860) separates unavailable, empty, and loaded states. |@@ -113,8 +113,19 @@ This is a bounded source-and-test audit after the Runtimes and CoS pilots. `Obse| Issue | Bounded slice | Current status || --- | --- | --- |-| [#7858](https://github.com/atomantic/PortOS/issues/7858) | Settings General and Backup composition, save/error evidence, and responsive validation. | Open; follows this audit. |+| [#7858](https://github.com/atomantic/PortOS/issues/7858) | Settings General and Backup composition, save/error evidence, and responsive validation. | Implemented; synthetic evidence is recorded in [validation/7858-settings-workspace.md](validation/7858-settings-workspace.md). || [#7859](https://github.com/atomantic/PortOS/issues/7859) | Brain Notes deep links plus Threads/Notes unavailable and empty-state truthfulness. | Open; follows this audit. || [#7860](https://github.com/atomantic/PortOS/issues/7860) | Apps collection-first hierarchy plus truthful list/detail unavailable states. | Open; follows this audit. |The [synthetic validation record](validation/7797-settings-brain-apps-audit.md) lists the existing test evidence, remaining viewport checks, and compatibility checklist. These follow-ups are deliberately implementation slices; #7797 is complete when the audit and evidence register are published, not when those later UI changes merge.++## Settings implementation follow-up (#7858)++The implementation keeps the existing Settings shell, section navigator, routes, and feature visibility. It changes content order within the two named tabs:++| Surface | Before | After | Evidence boundary |+| --- | --- | --- | --- |+| General | Timezone, location, and theme were three equal stacked cards. | Timezone and location are adjacent at usable container widths and stack below that threshold; theme is a clearly labeled secondary preference. Validation and request failures stay beside the affected save-backed group. | Rendered interaction tests observe the two independent save baselines, dirty guards, failure paths, and the responsive class contract. Exact geometry still needs a browser pass. |+| Backup | Health, configuration, exclusions, snapshots, and restore lived in one long form with the action bar at the end. | Health and saved schedule lead; destination/schedule editing and the saved-state Save/Run actions come before detail; exclusions and snapshot history are named disclosures. The restore dry-run/confirmation remains inside snapshot history. | Rendered interaction tests observe saved-state Run Now gating, degraded status, restore safety, resolved schedules, and the collapsed/expanded snapshot disclosure. Exact sticky-bar geometry still needs a browser pass. |++The [synthetic validation record](validation/7858-settings-workspace.md) separates observed rendered-test facts from hypotheses that require live browser geometry or a full accessibility audit. It uses only invented settings, paths, backup statuses, and snapshot identifiers.diff --git a/docs/validation/7858-settings-workspace.md b/docs/validation/7858-settings-workspace.mdnew file mode 100644index 0000000000..8e2ba5a4af--- /dev/null+++ b/docs/validation/7858-settings-workspace.md@@ -0,0 +1,47 @@+# Settings General and Backup workspace validation (#7858)++This record validates the task-first composition shipped for the Settings General and Backup tabs. It uses synthetic settings, paths, backup statuses, and snapshot identifiers only. It is not a live-instance report and does not claim a complete visual or accessibility certification.++## Content maps++| Surface | Page family | Before | After | Preserved boundary |+| --- | --- | --- | --- | --- |+| General | Configuration | Timezone, location, and immediate theme were three equal stacked cards. | Timezone and location form the recurring saved-configuration grid; theme follows as a secondary immediate preference. | `/settings/general`, legacy redirects, independent saves, dirty indicators, route guard, and theme behavior. |+| Backup | Operations + Configuration | Status, schedule, exclusions, snapshots, restore, and actions formed one long sequence. | Health and saved schedule lead; destination/schedule and saved-state actions follow; exclusions and snapshot history are named disclosures. | `/settings/backup`, resolved schedules, saved-state Run Now gate, degraded status, restore dry-run/confirmation, and failure states. |++## Observed rendered-test evidence++The focused client run was:++```text+./node_modules/.bin/vitest run src/components/settings/GeneralTab.test.jsx src/components/settings/BackupTab.test.jsx src/pages/Settings.tabs.test.jsx+```++Observed result: 3 test files and 57 tests passed.++- General still renders independent timezone and location saves, reports validation/request failures inline, keeps each group dirty after a failed save, and preserves the unsaved-navigation guard.+- Backup still renders resolved schedule values, keeps Run Backup Now disabled for an unsaved or missing destination, preserves the degraded database status, and keeps the dry-run-before-confirmation restore boundary.+- Snapshot history is collapsed by default behind a named disclosure with `aria-expanded`; opening it exposes synthetic snapshots and the existing restore actions.+- The content order places the health/status and saved schedule summary before the action bar, and the action bar before the exclusions and snapshot details.+- General and Backup retain container-scoped single-column defaults with a two-column layout at the 52rem container threshold; narrow inputs, paths, errors, and action rows use wrapping or break-word/break-all styles.++## Required matrix and evidence status++| Width | Observed in this record | Hypothesis / remaining check |+| --- | --- | --- |+| 1,920px | Responsive layout classes and task order are present in the rendered component contract. | Browser geometry should confirm the two-column grouping uses space without creating a reference wall. |+| 1,440px | Responsive layout classes and task order are present in the rendered component contract. | Browser geometry should confirm the action bar and status remain above useful work. |+| 1,024px | Responsive layout classes provide the wide grouping once the component container reaches 52rem. | Browser geometry should confirm the available Settings content width crosses the intended threshold without clipping. |+| 390px | Single-column default, wrapped controls, minimum touch targets, and break-word/break-all text classes are present. | Browser and keyboard pass should confirm focus order, sticky-bar behavior, and no page-level horizontal overflow. |+| 320px | Single-column default, wrapped controls, minimum touch targets, and break-word/break-all text classes are present. | Browser and keyboard pass should confirm long synthetic paths, validation errors, and restore actions remain reachable. |++## Compatibility checklist++- Existing Settings navigation, routes, redirects, feature gates, and icon presentation are unchanged.+- General save baselines remain independent; a failed save does not falsely clear dirty state.+- Backup schedule values remain server-resolved; editing exclusions does not replace them with client defaults.+- Run Now continues to use saved settings and refuses unsaved drafts.+- Restore continues to dry-run first, then requires explicit confirmation before the destructive request.+- Degraded backup status remains visible and actionable rather than becoming an empty-state interpretation.++The remaining browser geometry and complete accessibility checks are intentionally listed as hypotheses rather than reported as observed facts.