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(a11y): announce conditional error UI and stop signalling Banner tone by color alone (#7266)

[._.]/ Adam Eivy4aeabd8b975f
diff --git a/client/src/a11yConventions.test.js b/client/src/a11yConventions.test.js
index 152d00e403..1f34fde912 100644
--- a/client/src/a11yConventions.test.js
+++ b/client/src/a11yConventions.test.js
@@ -1967,6 +1967,155 @@ function* imagesWithoutAlt(src) {
}
}
+// ─────────────────────────────────────────────────────────────────────────────
+// Conditional error renders must announce themselves (#7266).
+//
+// The shape is always the same: an async action fails, a flag flips, and red
+// text appears somewhere below the form while focus stays on the button that
+// started it. An inert <div> announces nothing, so a screen-reader user's
+// mental model after a failed save is "it worked" (WCAG 4.1.3 Status Messages).
+// The answer is either <Banner>, which now supplies role="alert"/"status"
+// itself, or an explicit role on the element.
+
+// Which host elements this rule is about: the ones that carry the failure text.
+// A conditionally-rendered <a>/<button> is a control the user reaches by
+// tabbing, and a component tag owns its own semantics — both are out of remit.
+const ERROR_TEXT_HOST_TAGS = new Set(['div', 'p', 'span', 'section', 'article']);
+
+// role="alert"/"status" carry implicit live semantics; aria-live is the
+// explicit spelling. Any of the three satisfies the rule.
+const LIVE_REGION_ATTRIBUTE = /(?:^|\s)(?:aria-live\s*=|role\s*=\s*(?:["'{]\s*)?["']?(?:alert|status|log|progressbar)\b)/;
+const hasLiveRegion = (tag) => LIVE_REGION_ATTRIBUTE.test(tag);
+
+// The expression immediately guarding the element at `index`, or null when the
+// element is not the direct result of a `{… && <tag>}` render. Only whitespace
+// and grouping parens may sit between the `&&` and the `<`: a tag that opened
+// after the guard is a child of some other element, not the guarded node.
+const guardExpressionBefore = (src, index) => {
+ let i = index - 1;
+ while (i >= 0 && /[\s(]/.test(src[i])) i -= 1;
+ if (i < 1 || src[i] !== '&' || src[i - 1] !== '&') return null;
+ const end = i - 1;
+ let start = end;
+ // Walk back to the `{` that opened the JSX expression container. A closing
+ // brace or a statement terminator means this `&&` is not a JSX guard at all.
+ // `>` deliberately does NOT stop the walk — inside a guard it is a comparison
+ // (`missing.length > 0 &&`) or an arrow tail far more often than a tag
+ // boundary, and stopping on it blinded the rule to every such guard.
+ while (start > 0 && !'{};'.includes(src[start - 1])) start -= 1;
+ if (start === 0 || src[start - 1] !== '{') return null;
+ const expression = src.slice(start, end).trim();
+ // What `>` was there to catch: JSX TEXT containing a bare `&&`, where the walk
+ // crosses the enclosing element's own opening tag. A guard expression holds no
+ // `<` (`a < b` in one is rare enough to lose), so its presence means the walk
+ // left the expression container.
+ return expression.includes('<') ? null : expression;
+};
+
+// Does this guard name an error? The last path segment is the one that names
+// the value — `status.error`, `fork?.error`, `s.result?.error` — so a
+// `preferredTone` or an `err.details` nested inside an already-live section is
+// not dragged in by a substring match on the whole expression.
+const ERROR_NAMED_SEGMENT = /(?:error|^errs?$)/i;
+const guardsOnError = (expression) => {
+ // `{a && b && <div>}` guards on the LAST operand — the earlier ones are
+ // preconditions that say nothing about what the element renders — and
+ // `{cond ? x : y && <div>}` on the last ternary arm. Peel both before asking
+ // what the guard names.
+ // `?(?!\.)` so the ternary peel does not eat optional chaining — splitting
+ // `errorContext?.missing?.length > 0` on a bare `?` leaves `.length > 0`, and
+ // the guard stops naming the error it is guarding on.
+ const operand = expression.split('&&').pop().split(/\?(?!\.)|:/).pop().trim();
+ // A NEGATED error guard renders the SUCCESS path — `{!loadError && <Viewer/>}`
+ // is the model, not the failure message — and announcing the normal content
+ // of a page as a status message is its own defect.
+ if (operand.startsWith('!') && !operand.startsWith('!=')) return false;
+ const segments = operand.split(/[.[\]()]/).map((part) => part.trim()).filter(Boolean);
+ const namesError = (text) => Boolean(text) && ERROR_NAMED_SEGMENT.test(text);
+ // A comparison is not a truthiness check, and reading only its tail turns
+ // `status !== 'error'` — a SUCCESS guard — into an error render.
+ const comparison = operand.match(/(!|=)==?/);
+ if (comparison) {
+ // `x !== y` renders when the two differ: the success path, or a detail
+ // beside an error already on screen. Either way, not the error itself.
+ if (comparison[1] === '!') return false;
+ const right = operand.slice(comparison.index + comparison[0].length).trim();
+ // `error === null` is the success branch spelled the other way round.
+ if (/^(?:null|undefined|false|''|""|0)$/.test(right)) return false;
+ return namesError(right) || namesError(segments[0]) || namesError(segments.at(-1));
+ }
+ // The tail names the value (`status.error`, `fork?.error`), but a standard
+ // Error is read through its properties, so the ROOT names it too
+ // (`error.message`). Everything between is a container, not the name.
+ return namesError(segments.at(-1)) || namesError(segments[0]);
+};
+
+// Does a live region already cover this element — one it sits inside, or one it
+// renders? Either way the text is announced exactly once, which is the point;
+// only an element with none anywhere on its path is silent.
+const announcesTag = (node) => node.tag && (hasLiveRegion(node.tag) || node.name === 'Banner');
+
+const isCoveredByLiveRegion = (node, nodes) => {
+ for (let parent = node.parent; parent; parent = parent.parent) {
+ if (announcesTag(parent)) return true;
+ }
+ return nodes.some((other) => announcesTag(other) && isDescendantOf(other, node));
+};
+
+const isDescendantOf = (node, ancestor) => {
+ for (let parent = node.parent; parent; parent = parent.parent) {
+ if (parent === ancestor) return true;
+ }
+ return false;
+};
+
+// The conditional renders this rule deliberately does not ask to announce,
+// keyed by the guard EXPRESSION rather than a line number so an edit above them
+// cannot silently retire the entry (or resurrect a stale one).
+const JUSTIFIED_SILENT_ERROR_RENDERS = new Map([
+ // Wraps <AppOperationBanner>, which declares role="status" itself. A one-file
+ // walk cannot see across the import, and a second role here would nest two
+ // live regions around the same text.
+ ['src/components/apps/tabs/RepositorySourcePanel.jsx', new Set(['(isOperating || restarting || operationError || operationCompleted)'])],
+ // Not a status message: `expandedSections.errors` is a disclosure toggle over
+ // a static list of historical error CATEGORIES. It appears because the user
+ // opened it, so announcing it would duplicate the button they just pressed.
+ ['src/components/cos/tabs/LearningTab.jsx', new Set([
+ 'expandedSections.errors',
+ // Both of these render INSIDE that disclosure: a static analytics list of
+ // historical error categories and samples, already on screen when the user
+ // opens the section. Nothing appears in response to anything.
+ 'error.affectedTypes?.length > 0',
+ 'err.details',
+ ])],
+ // A truncation qualifier — "(results may be truncated)" — inside the <p> that
+ // already reports the count. It is a clause of that sentence, not a message,
+ // and announced on its own it says nothing.
+ ['src/components/apps/tabs/DatadogTab.jsx', new Set(['errors.length >= 100'])],
+]);
+
+// Two substring-cheap prechecks before the walk: a file that never writes
+// `&& <div` cannot hold the shape at all, and lexing one into the tag index
+// costs a pass over its whole text.
+const MAY_GUARD_ERROR_RENDER = /&&\s*\(?\s*<(?:div|p|span|section|article)[\s>/]/;
+
+function* silentErrorRenders(src, file) {
+ if (!MAY_GUARD_ERROR_RENDER.test(src) || !/err/i.test(src)) return;
+ // Materialized only once a candidate is actually found: the coverage check
+ // needs every node, and the files that reach it are a small minority.
+ let nodes = null;
+ for (const node of forEachOpeningTag(src)) {
+ if (!ERROR_TEXT_HOST_TAGS.has(node.name)) continue;
+ if (hasLiveRegion(node.tag)) continue;
+ const expression = guardExpressionBefore(src, node.index);
+ if (!expression || !guardsOnError(expression)) continue;
+ nodes ??= [...forEachOpeningTag(src)];
+ if (isCoveredByLiveRegion(node, nodes)) continue;
+ if (JUSTIFIED_SILENT_ERROR_RENDERS.get(file)?.has(expression)) continue;
+ yield node;
+ }
+}
+
describe('a11y conventions', () => {
// Modal.jsx IS the shared implementation; Drawer and Layout use the same
// backdrop treatment for a slide-in panel / mobile nav scrim, both of which
@@ -3904,4 +4053,83 @@ function B() { const sensors = useSensors(useSensor(PointerSensor)); return <Dnd
}
expect(offenders, `Menu-family role without arrow-key focus management — a role="menu" promises ArrowUp/ArrowDown roving focus, Home/End and Escape-to-trigger that a hand-rolled popover doesn't implement (WCAG 4.1.2). Drop the role (the ShellProviderLauncher.jsx precedent: a named group of plain controls needs none) or route the popover through components/ui/OverflowMenu.jsx:\n${offenders.join('\n')}`).toEqual([]);
});
+
+ it('gives every conditional error render a live region (#7266)', () => {
+ // Probe first — the tree is green by construction (this change swept it),
+ // so nothing left in it pins what the walk rejects, and a silent change of
+ // shape would turn the rule into a vacuous pass over zero matches.
+ const probe = (src) => [...silentErrorRenders(src, 'probe.jsx')].map(({ index }) => lineOf(src, index));
+ expect(probe('{error && <div>{error}</div>}')).toEqual([1]);
+ expect(probe('{saveError && (\n <p className="x">{saveError}</p>\n)}')).toEqual([2]);
+ // Every accepted answer silences it: role, aria-live, or the shared Banner.
+ expect(probe('{error && <div role="alert">{error}</div>}')).toEqual([]);
+ expect(probe('{error && <div role="status">{error}</div>}')).toEqual([]);
+ expect(probe('{error && <div aria-live="polite">{error}</div>}')).toEqual([]);
+ expect(probe('{error && <Banner tone="error">{error}</Banner>}')).toEqual([]);
+ // …and a live region anywhere on the path covers what is inside it, in
+ // either direction: an ancestor that announces, or a wrapper that delegates
+ // to a Banner it renders.
+ expect(probe('<div role="alert">{error && <span>{error}</span>}</div>')).toEqual([]);
+ expect(probe('{error && <div><Banner tone="error">{error}</Banner></div>}')).toEqual([]);
+
+ // A NEGATED guard renders the success path, not the failure — announcing a
+ // page's normal content as a status message is its own defect.
+ expect(probe('{!loadError && <div>{model.name}</div>}')).toEqual([]);
+ expect(probe('{ready && !error && <div>done</div>}')).toEqual([]);
+ // A guard that names no error is out of remit, however close it reads…
+ expect(probe('{preferredTone && <div>{preferredTone}</div>}')).toEqual([]);
+ // A standard Error is read through its properties, so the guard names it at
+ // the ROOT of the path rather than at the tail.
+ expect(probe('{error.message && <div>{error.message}</div>}')).toEqual([1]);
+ expect(probe('{err.details && <div>{err.details}</div>}')).toEqual([1]);
+ // Deliberately NOT the middle of a path: `insights.recentUnknownErrors.length`
+ // names a COUNT on an analytics record, and reading every segment turns a
+ // panel that was always on screen into a status message.
+ expect(probe('{insights.recentUnknownErrors.length > 0 && <div>samples</div>}')).toEqual([]);
+ // A comparison is not a truthiness check. `=== 'error'` IS the error state;
+ // `!==` renders when two values differ — the success path, or a detail
+ // beside an error already on screen — and `=== null` is success spelled
+ // backwards.
+ expect(probe("{state.status === 'error' && <div>failed</div>}")).toEqual([1]);
+ expect(probe("{lastRun.errorCode === 'HF_AUTH' && <div>sign in</div>}")).toEqual([1]);
+ expect(probe("{status !== 'error' && <div>{model.name}</div>}")).toEqual([]);
+ expect(probe('{error === null && <div>done</div>}')).toEqual([]);
+ // A guard holding a comparison must survive the walk back to its `{` — the
+ // `>` in it is not a tag boundary.
+ expect(probe('{errorContext?.missing?.length > 0 && <p>Unresolved</p>}')).toEqual([1]);
+ // …but JSX TEXT holding a bare `&&` is not a guard, and the walk must not
+ // cross the enclosing tag to pretend it is.
+ expect(probe('<div className="x">retry && <span>{error}</span></div>')).toEqual([]);
+ // …and only the LAST operand is the guard; an error precondition on a
+ // render of something else is not an error message.
+ expect(probe('{error && retryCount && <div>{retryCount}</div>}')).toEqual([]);
+ expect(probe('{loading && error && <div>{error}</div>}')).toEqual([1]);
+ // Controls are reached by tabbing and own their own semantics — a
+ // conditionally-rendered <button>/<a>/component is a different question.
+ expect(probe('{error && <button onClick={retry}>Retry</button>}')).toEqual([]);
+ expect(probe('{error && <ErrorCard error={error} />}')).toEqual([]);
+ // A `&&` that is not a JSX guard must not drag the next element in.
+ expect(probe('const shown = a && b;\n<div>{x}</div>')).toEqual([]);
+ // A JSX example written in a comment is masked before the walk.
+ expect(probe(maskComments('{/* {error && <div>{error}</div>} */}'))).toEqual([]);
+
+ // Prove the walk still sees the shape on a real file — an allowlisted entry
+ // is only meaningful while the matcher would otherwise have flagged it.
+ for (const [file, expressions] of JUSTIFIED_SILENT_ERROR_RENDERS) {
+ const src = maskedSourceOf(file);
+ const flagged = [...silentErrorRenders(src, `${file}.unallowlisted`)]
+ .map(({ index }) => guardExpressionBefore(src, index));
+ for (const expression of expressions) {
+ expect(flagged, `${file} no longer renders \`${expression}\` — retire the allowlist entry`).toContain(expression);
+ }
+ }
+
+ const offenders = [];
+ for (const file of trackedJsxFiles()) {
+ const src = maskedSourceOf(file);
+ for (const node of silentErrorRenders(src, file)) {
+ offenders.push(`${file}:${lineOf(src, node.index)}`);
+ }
+ }
+ expect(offenders, `Conditionally-rendered error text that announces nothing — render <Banner tone="error"> (it supplies role="alert" itself), or add role="alert" for an error the user's own action produced and role="status" for a passive load failure (WCAG 4.1.3):\n${offenders.join('\n')}`).toEqual([]); });
});
diff --git a/client/src/components/BackupWidget.jsx b/client/src/components/BackupWidget.jsx
index e62cc49bb9..9110e232ef 100644
--- a/client/src/components/BackupWidget.jsx
+++ b/client/src/components/BackupWidget.jsx
@@ -452,7 +452,7 @@ const BackupWidget = memo(function BackupWidget() {
{/* Error message */}
{status?.status === 'error' && status.error && (
- <div className="mb-4 p-3 rounded-lg bg-port-error/10 border border-port-error/20 flex items-start gap-2">
+ <div role="status" className="mb-4 p-3 rounded-lg bg-port-error/10 border border-port-error/20 flex items-start gap-2">
<XCircle size={14} className="text-port-error shrink-0 mt-0.5" />
<p className="text-xs text-port-error">{status.error}</p>
</div>
diff --git a/client/src/components/agents/tabs/ActivityTab.jsx b/client/src/components/agents/tabs/ActivityTab.jsx
index 7b8fd988b9..4883c6e3ff 100644
--- a/client/src/components/agents/tabs/ActivityTab.jsx
+++ b/client/src/components/agents/tabs/ActivityTab.jsx
@@ -125,7 +125,7 @@ export default function ActivityTab({ agentId }) {
</div>
)}
{activity.error && (
- <div className="text-sm text-port-error">
+ <div role="status" className="text-sm text-port-error">
{activity.error.slice(0, 50)}
{activity.error.length > 50 && '...'}
</div>
diff --git a/client/src/components/apps/ActivityLog.jsx b/client/src/components/apps/ActivityLog.jsx
index e395924e7c..5f0e9360e0 100644
--- a/client/src/components/apps/ActivityLog.jsx
+++ b/client/src/components/apps/ActivityLog.jsx
@@ -34,7 +34,7 @@ export default function ActivityLog({ steps, error, completed }) {
);
})}
{error && (
- <div className="flex items-start gap-2 px-2 py-1 rounded bg-port-error/10">
+ <div role="status" className="flex items-start gap-2 px-2 py-1 rounded bg-port-error/10">
<X size={14} className="text-port-error shrink-0 mt-0.5" />
<span className="text-xs text-port-error">{error}</span>
</div>
diff --git a/client/src/components/apps/DeployPanel.jsx b/client/src/components/apps/DeployPanel.jsx
index 10da57d70c..aaa36aded5 100644
--- a/client/src/components/apps/DeployPanel.jsx
+++ b/client/src/components/apps/DeployPanel.jsx
@@ -165,7 +165,7 @@ export default function DeployPanel({ appId, appName }) {
{line.text}
</div>
))}
- {error && <div className="text-port-error mt-2 whitespace-pre-wrap break-words">Error: {error}</div>}
+ {error && <div role="alert" className="text-port-error mt-2 whitespace-pre-wrap break-words">Error: {error}</div>}
</div>
{result && (
diff --git a/client/src/components/apps/EditAppDrawer.jsx b/client/src/components/apps/EditAppDrawer.jsx
index 8695d08fa0..887ed03255 100644
--- a/client/src/components/apps/EditAppDrawer.jsx
+++ b/client/src/components/apps/EditAppDrawer.jsx
@@ -335,7 +335,7 @@ export default function EditAppDrawer({ app, onClose, onSave }) {
closeOnBackdrop={false}
>
{error && (
- <div className="mb-4 p-3 bg-port-error/20 border border-port-error rounded-lg text-port-error text-sm">
+ <div role="alert" className="mb-4 p-3 bg-port-error/20 border border-port-error rounded-lg text-port-error text-sm">
{error}
</div>
)}
diff --git a/client/src/components/apps/JiraConfigPanel.jsx b/client/src/components/apps/JiraConfigPanel.jsx
index bdf3a22b2d..0c421f3f6d 100644
--- a/client/src/components/apps/JiraConfigPanel.jsx
+++ b/client/src/components/apps/JiraConfigPanel.jsx
@@ -208,7 +208,7 @@ export default function JiraConfigPanel({ app, onSaved }) {
return (
<form onSubmit={handleSubmit} className="space-y-3 max-w-3xl">
{error && (
- <div className="p-3 bg-port-error/20 border border-port-error rounded-lg text-port-error text-sm">
+ <div role="alert" className="p-3 bg-port-error/20 border border-port-error rounded-lg text-port-error text-sm">
{error}
</div>
)}
diff --git a/client/src/components/apps/ReferenceReposPanel.jsx b/client/src/components/apps/ReferenceReposPanel.jsx
index 22112c0f01..5a8eb4af1c 100644
--- a/client/src/components/apps/ReferenceReposPanel.jsx
+++ b/client/src/components/apps/ReferenceReposPanel.jsx
@@ -219,7 +219,7 @@ export default function ReferenceReposPanel({ appId, appName }) {
)}
{fetchError && (
- <div className="bg-port-error/10 border border-port-error/40 text-port-error text-xs rounded p-2 inline-flex items-center gap-2">
+ <div role="status" className="bg-port-error/10 border border-port-error/40 text-port-error text-xs rounded p-2 inline-flex items-center gap-2">
<AlertCircle size={12} /> Failed to refresh references: {fetchError}. Showing last known data.
</div>
)}
diff --git a/client/src/components/apps/SlashDoRunDrawer.jsx b/client/src/components/apps/SlashDoRunDrawer.jsx
index c18b7a3202..a2b2f27e18 100644
--- a/client/src/components/apps/SlashDoRunDrawer.jsx
+++ b/client/src/components/apps/SlashDoRunDrawer.jsx
@@ -194,7 +194,7 @@ function SlashDoRunDrawerBody({ open, command, label, appId, appName, onClose, o
)}
</section>
- {submitError && <p className="text-xs text-port-error">{submitError}</p>}
+ {submitError && <p role="alert" className="text-xs text-port-error">{submitError}</p>}
<div className="flex items-center justify-end gap-2 pt-2">
<button
diff --git a/client/src/components/apps/WorkItemPicker.jsx b/client/src/components/apps/WorkItemPicker.jsx
index bc839f2acf..081e07c975 100644
--- a/client/src/components/apps/WorkItemPicker.jsx
+++ b/client/src/components/apps/WorkItemPicker.jsx
@@ -175,7 +175,7 @@ export default function WorkItemPicker({ appId, target, onChange }) {
</div>
)}
- {error && <p className="text-xs text-port-error">{error}</p>}
+ {error && <p role="status" className="text-xs text-port-error">{error}</p>}
{!error && !loading && work && items.length === 0 && (
<p className="text-xs text-port-warning">{emptyMessage(work)}</p>
)}
diff --git a/client/src/components/apps/tabs/RepositorySourcePanel.jsx b/client/src/components/apps/tabs/RepositorySourcePanel.jsx
index 32173a9818..bd2d306db8 100644
--- a/client/src/components/apps/tabs/RepositorySourcePanel.jsx
+++ b/client/src/components/apps/tabs/RepositorySourcePanel.jsx
@@ -132,13 +132,13 @@ function RepositoryCard({ source }) {
)}
{unsyncable && <p className="text-xs text-gray-500">{unsyncable}</p>}
{source.remoteError && (
- <p className="flex items-start gap-1.5 text-xs text-port-warning">
+ <p role="status" className="flex items-start gap-1.5 text-xs text-port-warning">
<AlertTriangle size={13} className="mt-0.5 shrink-0" />
{source.remoteError}; the displayed remote revision may be stale.
</p>
)}
{fork?.error && (
- <p className="flex items-start gap-1.5 text-xs text-port-warning">
+ <p role="status" className="flex items-start gap-1.5 text-xs text-port-warning">
<AlertTriangle size={13} className="mt-0.5 shrink-0" />
{fork.error}; fork freshness is unknown.
</p>
diff --git a/client/src/components/apps/tabs/UpdateTab.jsx b/client/src/components/apps/tabs/UpdateTab.jsx
index 6543b33ea0..7b7e63aef1 100644
--- a/client/src/components/apps/tabs/UpdateTab.jsx
+++ b/client/src/components/apps/tabs/UpdateTab.jsx
@@ -293,7 +293,7 @@ export default function UpdateTab() {
</div>
)}
{forkSyncError && (
- <div className="mt-2 text-xs text-port-error whitespace-pre-wrap">{forkSyncError}</div>
+ <div role="alert" className="mt-2 text-xs text-port-error whitespace-pre-wrap">{forkSyncError}</div>
)}
</div>
</div>
diff --git a/client/src/components/brain/tabs/InboxTab.jsx b/client/src/components/brain/tabs/InboxTab.jsx
index 30892d0d8e..7e61abdb56 100644
--- a/client/src/components/brain/tabs/InboxTab.jsx
+++ b/client/src/components/brain/tabs/InboxTab.jsx
@@ -623,7 +623,7 @@ export default function InboxTab({ onRefresh, settings }) {
{/* Error entries */}
{errorEntries.length > 0 && (
- <div className="mb-4">
+ <div role="status" className="mb-4">
<div className="text-port-error font-medium mb-2 flex items-center gap-2">
<AlertCircle size={16} />
Errors ({errorEntries.length})
diff --git a/client/src/components/brain/tabs/LinksTab.jsx b/client/src/components/brain/tabs/LinksTab.jsx
index ca2988627e..fd4c5090ce 100644
--- a/client/src/components/brain/tabs/LinksTab.jsx
+++ b/client/src/components/brain/tabs/LinksTab.jsx
@@ -867,7 +867,7 @@ export default function LinksTab({ onRefresh }) {
{/* Clone error */}
{link.cloneError && (
- <span className="text-xs text-port-error truncate max-w-[200px]" title={link.cloneError}>
+ <span role="status" className="text-xs text-port-error truncate max-w-[200px]" title={link.cloneError}>
{link.cloneError}
</span>
)}
diff --git a/client/src/components/character/GoalsCard.jsx b/client/src/components/character/GoalsCard.jsx
index 74dcdaf308..97bc8c0168 100644
--- a/client/src/components/character/GoalsCard.jsx
+++ b/client/src/components/character/GoalsCard.jsx
@@ -130,7 +130,7 @@ export default function GoalsCard() {
{state.status === 'loading' && <BrailleSpinner text="Loading goals" />}
{state.status === 'error' && (
- <p className="text-sm text-gray-500">
+ <p role="status" className="text-sm text-gray-500">
Your goals could not be loaded right now.{' '}
<Link to={GOALS_LIST_PATH} className="text-port-accent hover:underline">Open Goals</Link>
</p>
diff --git a/client/src/components/cos/PersistentMindRuntimePanel.jsx b/client/src/components/cos/PersistentMindRuntimePanel.jsx
index 042a60bc1c..bb83eb6ee0 100644
--- a/client/src/components/cos/PersistentMindRuntimePanel.jsx
+++ b/client/src/components/cos/PersistentMindRuntimePanel.jsx
@@ -87,7 +87,7 @@ export default function PersistentMindRuntimePanel({ runtime, error, loading, on
</div>
{(loading || error) && (
- <p className={`md:col-span-3 text-xs ${error ? 'text-port-warning' : 'text-port-text-muted'}`}>
+ <p role="status" className={`md:col-span-3 text-xs ${error ? 'text-port-warning' : 'text-port-text-muted'}`}>
{error ? `Live telemetry delayed: ${error}. Showing the last successful snapshot when available.` : 'Refreshing live telemetry…'}
</p>
)}
diff --git a/client/src/components/cos/PersistentMindTaskModelAllowlistControls.jsx b/client/src/components/cos/PersistentMindTaskModelAllowlistControls.jsx
index 87361e0109..304275f75c 100644
--- a/client/src/components/cos/PersistentMindTaskModelAllowlistControls.jsx
+++ b/client/src/components/cos/PersistentMindTaskModelAllowlistControls.jsx
@@ -124,7 +124,7 @@ export default function PersistentMindTaskModelAllowlistControls({
Add model
</button>
</div>
- {error && <p className="mt-3 rounded border border-port-warning/30 bg-port-warning/10 px-3 py-2 text-xs text-port-warning">{error}</p>}
+ {error && <p role="alert" className="mt-3 rounded border border-port-warning/30 bg-port-warning/10 px-3 py-2 text-xs text-port-warning">{error}</p>}
{policyInvalid && <p className="mt-3 rounded border border-port-warning/30 bg-port-warning/10 px-3 py-2 text-xs text-port-warning">The saved policy is invalid, so task model selection is currently blocked. Add a valid model pair to repair it.</p>}
{!policyInvalid && entries.length === 0 ? (
<p className="mt-3 text-xs text-port-text-muted">No restriction configured — all enabled coding-provider models remain available.</p>
diff --git a/client/src/components/cos/PersistentMindVisibilityPanel.jsx b/client/src/components/cos/PersistentMindVisibilityPanel.jsx
index 7f15ccde3d..0a167a8553 100644
--- a/client/src/components/cos/PersistentMindVisibilityPanel.jsx
+++ b/client/src/components/cos/PersistentMindVisibilityPanel.jsx
@@ -176,7 +176,7 @@ export default function PersistentMindVisibilityPanel({ visibility, error, loadi
)}
{error && (
- <div className="mt-3 border-t border-port-border pt-3 text-xs text-port-warning">
+ <div role="status" className="mt-3 border-t border-port-border pt-3 text-xs text-port-warning">
<p>Visibility refresh delayed: {error}. The last successful snapshot remains in use.</p>
</div>
)}
diff --git a/client/src/components/cos/ReviewerPicker.jsx b/client/src/components/cos/ReviewerPicker.jsx
index 3cf7685b96..4ae1f67dc0 100644
--- a/client/src/components/cos/ReviewerPicker.jsx
+++ b/client/src/components/cos/ReviewerPicker.jsx
@@ -895,7 +895,7 @@ export default function ReviewerPicker({
Add
</button>
</div>
- {usernameError && <span className="text-xs text-port-error">{usernameError}</span>}
+ {usernameError && <span role="alert" className="text-xs text-port-error">{usernameError}</span>}
</div>
{showRunFlags && selected.length >= 2 && (
diff --git a/client/src/components/cos/tabs/AgentCard.jsx b/client/src/components/cos/tabs/AgentCard.jsx
index bad8bc2dfb..71bac22a0f 100644
--- a/client/src/components/cos/tabs/AgentCard.jsx
+++ b/client/src/components/cos/tabs/AgentCard.jsx
@@ -1198,7 +1198,7 @@ export default function AgentCard({ agent, onPause, onKill, onDelete, onResume,
</div>
)}
{promptError && (
- <div className="text-port-error text-sm">{promptError}</div>
+ <div role="status" className="text-port-error text-sm">{promptError}</div>
)}
{!loadingPrompt && !promptError && promptContent != null && (
<pre className="text-xs text-gray-300 font-mono whitespace-pre-wrap break-words">{promptContent}</pre>
diff --git a/client/src/components/cos/tabs/ConfigTab.jsx b/client/src/components/cos/tabs/ConfigTab.jsx
index defe035291..649cabb331 100644
--- a/client/src/components/cos/tabs/ConfigTab.jsx
+++ b/client/src/components/cos/tabs/ConfigTab.jsx
@@ -210,7 +210,7 @@ function PersistentMindStatus({ mind, loaded, error }) {
</div>
</div>
{(error || state?.lastError || state?.pauseReason) && (
- <p className="mt-3 rounded-md border border-port-warning/30 bg-port-warning/10 px-3 py-2 text-xs text-port-warning">
+ <p role="status" className="mt-3 rounded-md border border-port-warning/30 bg-port-warning/10 px-3 py-2 text-xs text-port-warning">
{error || state.lastError || state.pauseReason}
</p>
)}
diff --git a/client/src/components/cos/tabs/MindTab.jsx b/client/src/components/cos/tabs/MindTab.jsx
index 451fd3f8e6..b59a87af05 100644
--- a/client/src/components/cos/tabs/MindTab.jsx
+++ b/client/src/components/cos/tabs/MindTab.jsx
@@ -907,7 +907,7 @@ export default function MindTab() {
</div>
</section>
- {(runtimeError || visibilityError) && <p className="rounded-xl border border-port-warning/40 bg-port-warning/10 p-3 text-xs text-port-warning">Some live status is delayed. The last successful snapshot remains visible.</p>}
+ {(runtimeError || visibilityError) && <p role="status" className="rounded-xl border border-port-warning/40 bg-port-warning/10 p-3 text-xs text-port-warning">Some live status is delayed. The last successful snapshot remains visible.</p>}
</aside>
</div>
diff --git a/client/src/components/cos/tabs/RunsTab.jsx b/client/src/components/cos/tabs/RunsTab.jsx
index 33f7cbcc30..b267d2d5e2 100644
--- a/client/src/components/cos/tabs/RunsTab.jsx
+++ b/client/src/components/cos/tabs/RunsTab.jsx
@@ -482,7 +482,7 @@ export default function RunsTab() {
</Banner>
{/* Show additional error details if available and different from error */}
{run.errorDetails && run.errorDetails !== run.error && (
- <div className="mt-2 bg-port-error/5 border border-port-error/20 rounded-lg p-3">
+ <div role="status" className="mt-2 bg-port-error/5 border border-port-error/20 rounded-lg p-3">
<div className="text-xs text-gray-500 mb-1">Additional Details</div>
<pre className="text-xs text-port-error/80 font-mono whitespace-pre-wrap break-all">
{run.errorDetails}
diff --git a/client/src/components/cos/tabs/WorkflowTab.jsx b/client/src/components/cos/tabs/WorkflowTab.jsx
index 4386196474..c8cc9a1c19 100644
--- a/client/src/components/cos/tabs/WorkflowTab.jsx
+++ b/client/src/components/cos/tabs/WorkflowTab.jsx
@@ -356,7 +356,7 @@ export default function WorkflowTab({ apps, providers, providersLoaded }) {
</div>
</header>
- {error && <div className="flex items-center gap-2 rounded border border-port-error/40 bg-port-error/10 p-3 text-sm text-port-error"><AlertTriangle className="h-4 w-4" />{error}</div>}
+ {error && <div role="status" className="flex items-center gap-2 rounded border border-port-error/40 bg-port-error/10 p-3 text-sm text-port-error"><AlertTriangle className="h-4 w-4" />{error}</div>}
{loading && !graph && <div className="py-12 text-center text-sm text-gray-500">Building schedule timeline…</div>}
{graph && model && (
diff --git a/client/src/components/creative-director/PlanTab.jsx b/client/src/components/creative-director/PlanTab.jsx
index bdd796ba7a..6bed2f929d 100644
--- a/client/src/components/creative-director/PlanTab.jsx
+++ b/client/src/components/creative-director/PlanTab.jsx
@@ -308,7 +308,7 @@ export default function PlanTab({ project, onProjectUpdate }) {
<div className="text-xs text-port-warning mt-1 break-words">{s.result.reason}</div>
)}
{s.result?.error && (
- <div className="text-xs text-port-error mt-1 break-words">{s.result.error}</div>
+ <div role="status" className="text-xs text-port-error mt-1 break-words">{s.result.error}</div>
)}
{link && (
<Link to={link.to} className="inline-flex items-center gap-1 text-xs text-port-accent mt-1">
diff --git a/client/src/components/creative-director/RunsTab.jsx b/client/src/components/creative-director/RunsTab.jsx
index 1cae1b22ed..8409fb90f7 100644
--- a/client/src/components/creative-director/RunsTab.jsx
+++ b/client/src/components/creative-director/RunsTab.jsx
@@ -37,13 +37,13 @@ export default function RunsTab({ project }) {
Agent: <Link to={`/cos/agents?id=${encodeURIComponent(r.agentId)}`} className="text-port-accent font-mono">{r.agentId.slice(0, 8)}…</Link>
</div>
)}
- {r.error && <div className="text-xs text-port-error mt-1">{r.error}</div>}
+ {r.error && <div role="status" className="text-xs text-port-error mt-1">{r.error}</div>}
{/* failureReason is what recovery + orphan-settle write (e.g. "interrupted
by restart", "agent process terminated unexpectedly (orphaned)") — a
failed run with no `error` used to render blank, so surface it too so a
failed run always says WHY (issue #2705). */}
{r.failureReason && r.failureReason !== r.error && (
- <div className="text-xs text-port-error mt-1">{r.failureReason}</div>
+ <div role="status" className="text-xs text-port-error mt-1">{r.failureReason}</div>
)}
</div>
))}
diff --git a/client/src/components/eidoverse/EidoverseWorldDrawer.jsx b/client/src/components/eidoverse/EidoverseWorldDrawer.jsx
index 924b3a62ad..4570bd29c7 100644
--- a/client/src/components/eidoverse/EidoverseWorldDrawer.jsx
+++ b/client/src/components/eidoverse/EidoverseWorldDrawer.jsx
@@ -449,9 +449,9 @@ export default function EidoverseWorldDrawer({
V{design.lastAppliedVersion ?? '—'} → V{design.pendingVersion ?? design.selectedVersion}
</span>
</div>
- {reconciliation.error && <p className="mt-3 text-sm text-port-error">{reconciliation.error}</p>}
+ {reconciliation.error && <p role="alert" className="mt-3 text-sm text-port-error">{reconciliation.error}</p>}
{reconciliation.errorContext?.missing?.length > 0 && (
- <p className="mt-2 text-xs text-port-error">Unresolved slots: {reconciliation.errorContext.missing.join(', ')}</p>
+ <p role="alert" className="mt-2 text-xs text-port-error">Unresolved slots: {reconciliation.errorContext.missing.join(', ')}</p>
)}
{reconciliation.errorContext?.remediation === '/apps' && (
<Link className="mt-2 inline-block text-xs text-white underline" to="/apps">Update Eidoverse from Managed Apps</Link>
diff --git a/client/src/components/instances/BrainParityPanel.jsx b/client/src/components/instances/BrainParityPanel.jsx
index c11642c4b9..cca00037e4 100644
--- a/client/src/components/instances/BrainParityPanel.jsx
+++ b/client/src/components/instances/BrainParityPanel.jsx
@@ -135,7 +135,7 @@ export default function BrainParityPanel({ peer, report: storedReport }) {
{expanded && (
<div className="mt-2 space-y-2 text-xs">
- {error && <p className="text-port-warning">{error}</p>}
+ {error && <p role="status" className="text-port-warning">{error}</p>}
{!report && !error && (
<p className="text-gray-500">
diff --git a/client/src/components/instances/TailcatServePanel.jsx b/client/src/components/instances/TailcatServePanel.jsx
index c15110bc0f..9b98968ff7 100644
--- a/client/src/components/instances/TailcatServePanel.jsx
+++ b/client/src/components/instances/TailcatServePanel.jsx
@@ -95,7 +95,7 @@ export default function TailcatServePanel({ onChange, compact = false }) {
<TailcatAddress address={status?.tcAddress} preview={status?.tcAddressRedacted} disabled={busy} />
{status?.lastError && status?.status !== 'active' && (
- <p className="text-[11px] text-port-error mt-2 leading-snug break-words">
+ <p role="status" className="text-[11px] text-port-error mt-2 leading-snug break-words">
{status.lastError}
{status.lastErrorAt && <span className="text-gray-500"> · {timeAgo(status.lastErrorAt)}</span>}
</p>
diff --git a/client/src/components/loraTraining/TrainingPanel.jsx b/client/src/components/loraTraining/TrainingPanel.jsx
index aff8621b8a..5f2519ce82 100644
--- a/client/src/components/loraTraining/TrainingPanel.jsx
+++ b/client/src/components/loraTraining/TrainingPanel.jsx
@@ -241,7 +241,7 @@ export default function TrainingPanel({ dataset, readiness, triggerSaving, onRun
</div>
)}
{lastRun?.status === 'failed' && lastRun.errorCode === 'HF_AUTH' && (
- <div className="rounded-lg border border-port-warning/40 bg-port-warning/10 px-3 py-3 text-xs text-port-warning space-y-2">
+ <div role="status" className="rounded-lg border border-port-warning/40 bg-port-warning/10 px-3 py-3 text-xs text-port-warning space-y-2">
<div className="font-semibold text-sm">Model access required</div>
<div className="text-port-warning/90">
The training base model is gated on HuggingFace. Accept its license with the account
diff --git a/client/src/components/meatspace/post/PostSessionLauncher.jsx b/client/src/components/meatspace/post/PostSessionLauncher.jsx
index 7137e004a8..06bc990da9 100644
--- a/client/src/components/meatspace/post/PostSessionLauncher.jsx
+++ b/client/src/components/meatspace/post/PostSessionLauncher.jsx
@@ -844,7 +844,7 @@ export default function PostSessionLauncher({
)}
{quickDurationSaveState === 'saving' && <div>Saving budget...</div>}
{quickDurationSaveState === 'saved' && <div>Budget saved.</div>}
- {quickDurationSaveState === 'error' && <div className="text-port-error">Budget could not be saved; reverted.</div>}
+ {quickDurationSaveState === 'error' && <div role="alert" className="text-port-error">Budget could not be saved; reverted.</div>}
</div>
</div>
)}
@@ -891,7 +891,7 @@ export default function PostSessionLauncher({
<p className="text-xs text-gray-500">
Versioned two-drill battery with alternating forms for comparable progress.
</p>
- {benchmarkError && <p className="text-xs text-port-error">{benchmarkError}</p>}
+ {benchmarkError && <p role="alert" className="text-xs text-port-error">{benchmarkError}</p>}
</div>
)}
diff --git a/client/src/components/media/MediaJobsQueue.jsx b/client/src/components/media/MediaJobsQueue.jsx
index c0167024aa..b3284ddd0a 100644
--- a/client/src/components/media/MediaJobsQueue.jsx
+++ b/client/src/components/media/MediaJobsQueue.jsx
@@ -584,7 +584,7 @@ function JobRow({ job, onCancel, onRetry, onRunNow, onDelete }) {
</div>
</div>
{job.status === 'failed' && job.error && (
- <div className="text-xs text-port-error mt-2 truncate" title={job.error}>{job.error}</div>
+ <div role="status" className="text-xs text-port-error mt-2 truncate" title={job.error}>{job.error}</div>
)}
{job.status === 'running' && (
<div className="mt-2 space-y-1">
diff --git a/client/src/components/media/MediaLightbox.jsx b/client/src/components/media/MediaLightbox.jsx
index d0c61d8f32..bf660655c8 100644
--- a/client/src/components/media/MediaLightbox.jsx
+++ b/client/src/components/media/MediaLightbox.jsx
@@ -623,7 +623,7 @@ function SettingsPane({
<div className="flex items-center gap-2 text-[10px] text-gray-500">
{promptStatus === 'saving' && <span>Saving…</span>}
{promptStatus === 'saved' && <span className="text-port-success">Saved</span>}
- {promptStatus === 'error' && <span className="text-port-error">Save failed</span>}
+ {promptStatus === 'error' && <span role="alert" className="text-port-error">Save failed</span>}
<span>{promptDraft.length}/8000</span>
</div>
</div>
diff --git a/client/src/components/media/RigPanel.jsx b/client/src/components/media/RigPanel.jsx
index 8dc120c878..1698b62239 100644
--- a/client/src/components/media/RigPanel.jsx
+++ b/client/src/components/media/RigPanel.jsx
@@ -142,7 +142,7 @@ export default function RigPanel({ record, onRecordChange }) {
)}
{rig?.status === 'failed' && rig.error && (
- <div className="mt-2 flex items-start gap-1.5 rounded-md border border-port-error/30 bg-port-error/10 px-3 py-2 text-xs text-port-error">
+ <div role="status" className="mt-2 flex items-start gap-1.5 rounded-md border border-port-error/30 bg-port-error/10 px-3 py-2 text-xs text-port-error">
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
<span>{rig.error}</span>
</div>
@@ -220,7 +220,7 @@ export default function RigPanel({ record, onRecordChange }) {
)}
{retarget?.status === 'failed' && retarget.error && (
- <div className="mt-2 flex items-start gap-1.5 rounded-md border border-port-error/30 bg-port-error/10 px-3 py-2 text-xs text-port-error">
+ <div role="status" className="mt-2 flex items-start gap-1.5 rounded-md border border-port-error/30 bg-port-error/10 px-3 py-2 text-xs text-port-error">
<AlertTriangle className="mt-0.5 h-3.5 w-3.5 shrink-0" />
<span>{retarget.error}</span>
</div>
diff --git a/client/src/components/media/VideoUpscaleDrawer.jsx b/client/src/components/media/VideoUpscaleDrawer.jsx
index d6a08dad53..c50e12d12e 100644
--- a/client/src/components/media/VideoUpscaleDrawer.jsx
+++ b/client/src/components/media/VideoUpscaleDrawer.jsx
@@ -194,7 +194,7 @@ export default function VideoUpscaleDrawer({ item, onClose, onUpscaled }) {
<span className="block text-sm text-white">LTX-2.5 generative (synthesizes detail)</span>
<span className="block text-[11px] text-gray-500">2× via a GPU model — adds detail rather than resizing pixels.</span>
{planLoading && <span className="block text-[11px] text-gray-500 mt-1">Checking readiness…</span>}
- {planError && <span className="block text-[11px] text-port-error mt-1">{planError}</span>}
+ {planError && <span role="status" className="block text-[11px] text-port-error mt-1">{planError}</span>}
{generativeDisabledReason && (
<span id="upscale-method-ltx-reason" className="block text-[11px] text-port-warning mt-1">
{generativeDisabledReason}
diff --git a/client/src/components/models/ModelComparison.jsx b/client/src/components/models/ModelComparison.jsx
index eedcd44f40..efad4477bd 100644
--- a/client/src/components/models/ModelComparison.jsx
+++ b/client/src/components/models/ModelComparison.jsx
@@ -703,7 +703,7 @@ export default function ModelComparison() {
/>
</div>
{syncStatus && <p className="text-xs text-port-accent-text">{syncStatus}</p>}
- {syncError && <p className="text-xs text-port-error">{syncError}</p>}
+ {syncError && <p role="alert" className="text-xs text-port-error">{syncError}</p>}
<div className="flex justify-end gap-2 pt-2">
<button
type="button"
diff --git a/client/src/components/providers/ProviderCard.jsx b/client/src/components/providers/ProviderCard.jsx
index a9946d8be1..7068335227 100644
--- a/client/src/components/providers/ProviderCard.jsx
+++ b/client/src/components/providers/ProviderCard.jsx
@@ -636,7 +636,7 @@ function CodexSubscriptionPanel({
)}
{typeof account?.checkedAt === 'number' && <p className="text-gray-500">Last usage refresh: {new Date(account.checkedAt).toLocaleString()}</p>}
{catalogCount !== null && <p className="text-gray-500">Subscription catalog: {catalogCount} model{catalogCount === 1 ? '' : 's'} available.</p>}
- {modelError && <p className="text-port-warning">Using the last known model catalog while a refresh is unavailable.</p>}
+ {modelError && <p role="status" className="text-port-warning">Using the last known model catalog while a refresh is unavailable.</p>}
{verificationUrl && (
<div className="rounded bg-port-card px-2.5 py-2 text-gray-300 space-y-1">
<p>Headless sign-in: open the verification page and enter this code.</p>
diff --git a/client/src/components/settings/ImageGenTab.jsx b/client/src/components/settings/ImageGenTab.jsx
index 721ce8c37b..e2d9553de0 100644
--- a/client/src/components/settings/ImageGenTab.jsx
+++ b/client/src/components/settings/ImageGenTab.jsx
@@ -1193,7 +1193,7 @@ export function ImageGenTab() {
<datalist id={agyModelsListId}>
{agyModels.map((modelId) => <option key={modelId} value={modelId} />)}
</datalist>
- {agyModelsError && <p className="text-xs text-port-warning mt-1">{agyModelsError}. You can still enter a custom model id.</p>}
+ {agyModelsError && <p role="status" className="text-xs text-port-warning mt-1">{agyModelsError}. You can still enter a custom model id.</p>}
{/* This is the model `agy --model` runs the SESSION on — the agent that
calls the built-in generate_image tool. Agy exposes no knob for the
underlying image model (generate_image takes Prompt / ImageName /
diff --git a/client/src/components/settings/LocalLlmLibraryView.jsx b/client/src/components/settings/LocalLlmLibraryView.jsx
index c7d4cefa99..5d1ff32818 100644
--- a/client/src/components/settings/LocalLlmLibraryView.jsx
+++ b/client/src/components/settings/LocalLlmLibraryView.jsx
@@ -454,7 +454,7 @@ export default function LocalLlmLibraryView() {
</div>
)}
{selectedData?.available && selectedData?.modelsError && (
- <p className="text-xs text-port-warning">
+ <p role="status" className="text-xs text-port-warning">
Couldn't list {labelFor(selected)} models (showing what's available): {selectedData.modelsError}
</p>
)}
@@ -520,7 +520,7 @@ export default function LocalLlmLibraryView() {
</div>
)}
{catalogError && (
- <p className="text-xs text-port-warning">{catalogError}</p>
+ <p role="status" className="text-xs text-port-warning">{catalogError}</p>
)}
{Number.isFinite(systemMemoryGb) && catalog.some((m) => Array.isArray(m.variants) && m.variants.length > 1) && (
<p className="text-[11px] text-gray-500">
diff --git a/client/src/components/settings/LocalSetupPanel.jsx b/client/src/components/settings/LocalSetupPanel.jsx
index 84603f4150..c842615faf 100644
--- a/client/src/components/settings/LocalSetupPanel.jsx
+++ b/client/src/components/settings/LocalSetupPanel.jsx
@@ -281,7 +281,7 @@ export default function LocalSetupPanel({ pythonPath, onPythonPathChange, onPack
</pre>
)}
{installError && (
- <div className="mt-2 flex flex-wrap items-center gap-2">
+ <div role="alert" className="mt-2 flex flex-wrap items-center gap-2">
<span className="text-xs text-port-error">Install failed — see the log above.</span>
<QueueInstallInvestigationButton
label="PortOS local Python packages"
diff --git a/client/src/components/settings/MtplxCheckpoints.jsx b/client/src/components/settings/MtplxCheckpoints.jsx
index b742b57ebc..d08f6c6939 100644
--- a/client/src/components/settings/MtplxCheckpoints.jsx
+++ b/client/src/components/settings/MtplxCheckpoints.jsx
@@ -205,7 +205,7 @@ export default function MtplxCheckpoints({
</button>
</form>
- {searchError && <p className="text-xs text-port-warning">{searchError}</p>}
+ {searchError && <p role="alert" className="text-xs text-port-warning">{searchError}</p>}
{results !== null && results.length === 0 && !searchError && (
<p className="text-xs text-gray-500">No MTPLX-branded checkpoints matched that search.</p>
diff --git a/client/src/components/settings/MtplxServerCard.jsx b/client/src/components/settings/MtplxServerCard.jsx
index 72806e865e..24e864f885 100644
--- a/client/src/components/settings/MtplxServerCard.jsx
+++ b/client/src/components/settings/MtplxServerCard.jsx
@@ -176,7 +176,7 @@ export default function MtplxServerCard({
</div>
)}
{status?.cacheError && (
- <p className="text-xs text-gray-500">Couldn't read MTPLX's model cache ({status.cacheError}) — an on-demand start will fall through to MTPLX's own default checkpoint.</p>
+ <p role="status" className="text-xs text-gray-500">Couldn't read MTPLX's model cache ({status.cacheError}) — an on-demand start will fall through to MTPLX's own default checkpoint.</p>
)}
<p className="text-[11px] text-gray-500">
MTPLX starts on demand when a request needs it. You can also start it now with the
diff --git a/client/src/components/settings/SlotstreamServerCard.jsx b/client/src/components/settings/SlotstreamServerCard.jsx
index d2d4b694a9..00dc50e0ef 100644
--- a/client/src/components/settings/SlotstreamServerCard.jsx
+++ b/client/src/components/settings/SlotstreamServerCard.jsx
@@ -219,7 +219,7 @@ export default function SlotstreamServerCard({
</div>
)}
{status?.cacheError && (
- <p className="text-xs text-gray-500">Couldn&apos;t read Slotstream&apos;s model cache ({status.cacheError}).</p>
+ <p role="status" className="text-xs text-gray-500">Couldn&apos;t read Slotstream&apos;s model cache ({status.cacheError}).</p>
)}
<p className="text-[11px] text-gray-500">
Slotstream starts on demand when a request needs it. You can also start it now with a cached checkpoint; its idle window (set under Local Runtime Servers) stops it again. Neither path downloads weights.
diff --git a/client/src/components/songs/MidiVisualization.jsx b/client/src/components/songs/MidiVisualization.jsx
index d924be5b31..64ac5e7c57 100644
--- a/client/src/components/songs/MidiVisualization.jsx
+++ b/client/src/components/songs/MidiVisualization.jsx
@@ -124,7 +124,7 @@ export default function MidiVisualization({ url, filename, model }) {
// Placeholder for the roll that is about to mount here, so it
// carries the roll's own ROLL_BG rather than a theme token —
// otherwise the panel changes color as the canvas swaps in.
- <div
+ <div role="status"
className={`flex items-center justify-center gap-2 rounded-lg text-xs ${status === 'error' ? 'text-port-error' : 'text-gray-400'}`}
style={{ height: COMPACT_H, backgroundColor: ROLL_BG }}
>
diff --git a/client/src/components/songs/SingToScore.jsx b/client/src/components/songs/SingToScore.jsx
index 40dd2368c0..4a435301f5 100644
--- a/client/src/components/songs/SingToScore.jsx
+++ b/client/src/components/songs/SingToScore.jsx
@@ -89,7 +89,7 @@ export default function SingToScore({ value = '', tempo = null, musicKey = 'C',
: 'Records a melody and transcribes it at the song tempo. Review the staff below before inserting.'}
</p>
- {error && <p className="mt-2 text-xs text-port-error">{error}</p>}
+ {error && <p role="alert" className="mt-2 text-xs text-port-error">{error}</p>}
<MicProcessingHint processing={micProcessing} />
{/* Transcribed result — live preview + insert controls. */}
diff --git a/client/src/components/songs/SingToVerify.jsx b/client/src/components/songs/SingToVerify.jsx
index 713e837429..b5b5fcc0c2 100644
--- a/client/src/components/songs/SingToVerify.jsx
+++ b/client/src/components/songs/SingToVerify.jsx
@@ -120,7 +120,7 @@ export default function SingToVerify({ value = '', tempo = null, onChange }) {
</div>
</div>
- {error && <p className="mt-2 text-xs text-port-error">{error}</p>}
+ {error && <p role="alert" className="mt-2 text-xs text-port-error">{error}</p>}
<MicProcessingHint processing={micProcessing} />
{rows.length > 0 && !recording && (
diff --git a/client/src/components/sprites/AssetInspector.jsx b/client/src/components/sprites/AssetInspector.jsx
index f6939d6a0f..cff8802afa 100644
--- a/client/src/components/sprites/AssetInspector.jsx
+++ b/client/src/components/sprites/AssetInspector.jsx
@@ -183,7 +183,7 @@ export default function AssetInspector({ recordId, asset, onClose, onDeleted = n
{isRuntimeVersionFile && ' The whole runtime version — atlas sprite sheet and its sidecar manifest — is removed together.'}
{' '}This can’t be undone.
</p>
- {deleteError && <p className="text-xs text-port-error break-all">{deleteError}</p>}
+ {deleteError && <p role="alert" className="text-xs text-port-error break-all">{deleteError}</p>}
<div className="flex items-center gap-2">
<button
type="button"
diff --git a/client/src/components/sprites/PublishWorkflow.jsx b/client/src/components/sprites/PublishWorkflow.jsx
index 5790e63bca..51827c8faf 100644
--- a/client/src/components/sprites/PublishWorkflow.jsx
+++ b/client/src/components/sprites/PublishWorkflow.jsx
@@ -492,7 +492,7 @@ export default function PublishWorkflow({
/>
</FormField>
</div>
- {contractError && <p className="text-[11px] text-port-error">{contractError}</p>}
+ {contractError && <p role="alert" className="text-[11px] text-port-error">{contractError}</p>}
{atlasSummary && (
<p className="text-[11px] text-gray-500">
Current atlas grid: <span className="text-gray-300">{atlasSummary}</span>
diff --git a/client/src/components/sprites/SpriteCatalog.jsx b/client/src/components/sprites/SpriteCatalog.jsx
index 510ebff68c..e8edbc428a 100644
--- a/client/src/components/sprites/SpriteCatalog.jsx
+++ b/client/src/components/sprites/SpriteCatalog.jsx
@@ -50,7 +50,7 @@ function CatalogCard({ record, thumbPath, onOpen, onRenamed, onDeleted }) {
disabled={busy}
className="w-full bg-port-card border border-port-border rounded px-2 py-1 text-sm text-white"
/>
- {error && <p className="text-xs text-port-error break-words">{error}</p>}
+ {error && <p role="alert" className="text-xs text-port-error break-words">{error}</p>}
<div className="flex items-center gap-2">
<button
type="button"
@@ -80,7 +80,7 @@ function CatalogCard({ record, thumbPath, onOpen, onRenamed, onDeleted }) {
Delete <span className="font-semibold break-words">{record.name}</span>? It leaves your
library; the generated files stay on disk and its id stays reserved. This can’t be undone here.
</p>
- {error && <p className="text-xs text-port-error break-words">{error}</p>}
+ {error && <p role="alert" className="text-xs text-port-error break-words">{error}</p>}
<ConfirmButtonPair
confirmText="Delete"
busyText="Deleting…"
diff --git a/client/src/components/sprites/SpriteDetailHeader.jsx b/client/src/components/sprites/SpriteDetailHeader.jsx
index b9bbcd8ce2..91f7d768ee 100644
--- a/client/src/components/sprites/SpriteDetailHeader.jsx
+++ b/client/src/components/sprites/SpriteDetailHeader.jsx
@@ -54,7 +54,7 @@ export default function SpriteDetailHeader({ record, onRenamed, onDeleted }) {
Cancel
</button>
</div>
- {error && <p className="text-xs text-port-error break-words">{error}</p>}
+ {error && <p role="alert" className="text-xs text-port-error break-words">{error}</p>}
</div>
) : (
<div className="flex-1 min-w-0 flex items-center gap-1.5">
@@ -98,7 +98,7 @@ export default function SpriteDetailHeader({ record, onRenamed, onDeleted }) {
Delete <span className="font-semibold break-words">{record.name}</span>? It leaves your
library; the generated files stay on disk and its id stays reserved. This can’t be undone here.
</p>
- {error && <p className="text-xs text-port-error break-words">{error}</p>}
+ {error && <p role="alert" className="text-xs text-port-error break-words">{error}</p>}
<ConfirmButtonPair
confirmText="Delete"
busyText="Deleting…"
diff --git a/client/src/components/sprites/TrackWorkflow.jsx b/client/src/components/sprites/TrackWorkflow.jsx
index d90ccafa8b..720e738ec9 100644
--- a/client/src/components/sprites/TrackWorkflow.jsx
+++ b/client/src/components/sprites/TrackWorkflow.jsx
@@ -192,7 +192,7 @@ export default function TrackWorkflow({
{reopening ? 'Reopening…' : 'Reopen for replacement'}
</button>
)}
- {run?.postprocessError && <p className="text-[10px] text-red-300">{run.postprocessError}</p>}
+ {run?.postprocessError && <p role="status" className="text-[10px] text-red-300">{run.postprocessError}</p>}
</article>
);
})}
diff --git a/client/src/components/sprites/WalkWorkflow.jsx b/client/src/components/sprites/WalkWorkflow.jsx
index 96f1ec769e..1382be55d5 100644
--- a/client/src/components/sprites/WalkWorkflow.jsx
+++ b/client/src/components/sprites/WalkWorkflow.jsx
@@ -377,7 +377,7 @@ function DirectionCard({
/>
)}
{run.status === 'error' && (
- <p className="text-[10px] text-port-error break-words">{run.postprocessError || 'postprocess failed'}</p>
+ <p role="status" className="text-[10px] text-port-error break-words">{run.postprocessError || 'postprocess failed'}</p>
)}
{/* Gated on the in-flight target write (it repacks against the set
target, so firing it before a target PATCH lands would use the
diff --git a/client/src/components/sync/SyncDetailDrawer.jsx b/client/src/components/sync/SyncDetailDrawer.jsx
index f541d92b05..f724d0308b 100644
--- a/client/src/components/sync/SyncDetailDrawer.jsx
+++ b/client/src/components/sync/SyncDetailDrawer.jsx
@@ -398,7 +398,7 @@ export default function SyncDetailDrawer({ kind, recordId, onClose }) {
)}
{!loading && error && (
- <p className="text-port-error text-sm">Failed to load sync status.</p>
+ <p role="status" className="text-port-error text-sm">Failed to load sync status.</p>
)}
{/* noSyncingPeers is also true when peers EXIST but this category's
diff --git a/client/src/components/ui/Banner.jsx b/client/src/components/ui/Banner.jsx
index 51fd7439af..58677205ec 100644
--- a/client/src/components/ui/Banner.jsx
+++ b/client/src/components/ui/Banner.jsx
@@ -34,6 +34,20 @@ const ALIGNMENTS = {
center: 'items-center',
};
+// For a screen reader the tone was carried by nothing at all: the icon is
+// optional and aria-hidden by default, so an error banner and a success banner
+// with the same copy read identically. A visually-hidden word in front of the
+// body gives the tone a TEXT form, without a visual diff at any call site.
+// NB: that is a text alternative, not a visual one — the sighted half of WCAG
+// 1.4.1 still rests on passing an `icon`, which this deliberately does not
+// force on 124 existing call sites.
+const TONE_WORDS = {
+ warning: 'Warning',
+ error: 'Error',
+ success: 'Success',
+ info: 'Note',
+};
+
export default function Banner({
tone = 'warning',
icon: Icon,
@@ -43,6 +57,10 @@ export default function Banner({
// the text doesn't; the icon then renders as a bare exposed <svg>, so the
// caller is responsible for labeling it (e.g. an aria-label) at the call site.
iconAriaHidden = true,
+ // A visually-hidden tone word ("Error: ", "Success: ") prefixes the body so
+ // the tone reaches a screen reader. Pass false for the rare banner whose own
+ // copy already opens with the tone word.
+ srLabel = true,
size = 'sm',
align = 'start',
title,
@@ -52,6 +70,7 @@ export default function Banner({
...rest
}) {
const t = TONES[tone] || TONES.warning;
+ const toneWord = TONE_WORDS[tone] || TONE_WORDS.warning;
const s = SIZES[size] || SIZES.sm;
const alignClass = ALIGNMENTS[align] || ALIGNMENTS.start;
const radius = size === 'lg' || size === 'md' ? 'rounded-lg' : 'rounded';
@@ -62,6 +81,10 @@ export default function Banner({
return (
<div
+ // Rely on the implicit live semantics of alert/status — a redundant
+ // aria-live alongside them is what double-announces in some readers.
+ // Placed BEFORE {...rest} so a call site that passes its own role wins.
+ role={tone === 'error' ? 'alert' : 'status'}
className={`${s.padding} ${s.text} border ${radius} ${t.wrapper} flex ${alignClass} ${s.gap} ${className}`.trim()}
{...rest}
>
@@ -73,6 +96,7 @@ export default function Banner({
/>
) : null}
<div className="flex-1 min-w-0">
+ {srLabel ? <span className="sr-only">{toneWord}: </span> : null}
{title ? <div className="font-medium">{title}</div> : null}
{children}
</div>
diff --git a/client/src/components/ui/Banner.test.jsx b/client/src/components/ui/Banner.test.jsx
index c857f6391e..05f98a2df2 100644
--- a/client/src/components/ui/Banner.test.jsx
+++ b/client/src/components/ui/Banner.test.jsx
@@ -88,4 +88,59 @@ describe('Banner', () => {
svg = container.querySelector('svg');
expect(svg.getAttribute('class')).not.toContain('mt-0.5');
});
+ // A Banner is almost always rendered conditionally after an async action, so
+ // an inert <div> announces nothing when it appears (WCAG 4.1.3).
+ it.each([
+ ['error', 'alert'],
+ ['warning', 'status'],
+ ['success', 'status'],
+ ['info', 'status'],
+ ])('renders tone=%s inside a %s live region', (tone, role) => {
+ render(<Banner tone={tone}>x</Banner>);
+ expect(screen.getByRole(role).textContent).toContain('x');
+ });
+
+ it('falls back to the status role for an unknown tone, matching the warning class fallback', () => {
+ render(<Banner tone="bogus">x</Banner>);
+ expect(screen.getByRole('status').textContent).toContain('x');
+ });
+
+ it('lets a call site override the role it passes through', () => {
+ render(<Banner tone="error" role="note">x</Banner>);
+ expect(screen.queryByRole('alert')).toBeNull();
+ expect(screen.getByRole('note')).toBeTruthy();
+ });
+
+ // Tone is otherwise hue-only: an icon-less error and success banner with the
+ // same copy are identical to a colorblind user and to a screen reader.
+ it.each([
+ ['error', 'Error'],
+ ['warning', 'Warning'],
+ ['success', 'Success'],
+ ['info', 'Note'],
+ ])('prefixes tone=%s with the visually-hidden word "%s"', (tone, word) => {
+ const { container } = render(<Banner tone={tone}>Backup failed</Banner>);
+ // Accessible text, not a class assertion — what a reader actually hears.
+ expect(container.textContent).toBe(`${word}: Backup failed`);
+ expect(screen.getByText(`${word}:`, { exact: false }).className).toContain('sr-only');
+ });
+
+ it('omits the tone word when srLabel={false}', () => {
+ const { container } = render(<Banner tone="error" srLabel={false}>Error: already said it</Banner>);
+ expect(container.textContent).toBe('Error: already said it');
+ expect(container.querySelector('.sr-only')).toBeNull();
+ });
+
+ // The sr-only span and the role are purely additive — the visual rendering
+ // must be byte-identical to what the component emitted before they existed,
+ // so these pin the WHOLE class string rather than a contains() fragment.
+ it.each([
+ [{ tone: 'warning', size: 'sm', align: 'start' }, 'px-3 py-2 text-xs border rounded border-port-warning/30 bg-port-warning/10 text-port-warning flex items-start gap-2'],
+ [{ tone: 'error', size: 'md', align: 'center' }, 'px-4 py-3 text-sm border rounded-lg border-port-error/30 bg-port-error/10 text-port-error flex items-center gap-2'],
+ [{ tone: 'success', size: 'lg', align: 'start' }, 'p-4 text-sm border rounded-lg border-port-success/30 bg-port-success/10 text-port-success flex items-start gap-3'],
+ [{ tone: 'info', size: 'sm', align: 'center' }, 'px-3 py-2 text-xs border rounded border-port-accent/30 bg-port-accent/10 text-port-accent flex items-center gap-2'],
+ ])('renders %o with an unchanged class string', (props, expected) => {
+ const { container } = render(<Banner {...props}>x</Banner>);
+ expect(container.querySelector('div.flex').className).toBe(expected);
+ });
});
diff --git a/client/src/components/videoGen/AudioPanel.jsx b/client/src/components/videoGen/AudioPanel.jsx
index 236e29085d..c9981cf85e 100644
--- a/client/src/components/videoGen/AudioPanel.jsx
+++ b/client/src/components/videoGen/AudioPanel.jsx
@@ -93,7 +93,7 @@ export default function AudioPanel({
: `Video duration follows the selected audio and snaps up to ${numFrames} frames on the model's temporal grid${maxDurationSeconds != null ? ` (up to ${maxDurationSeconds.toFixed(1)}s)` : ''}.`))
: `Audio length should match ${(numFrames / fps).toFixed(1)}s (frames ÷ fps). Longer clips are trimmed to fit; shorter clips fail.`}
</p>
- {durationError && <p className="text-[11px] text-port-error leading-snug">{durationError}</p>}
+ {durationError && <p role="alert" className="text-[11px] text-port-error leading-snug">{durationError}</p>}
{!hasCompatibleModel && (
<p className="text-[11px] text-port-warning">No audio-to-video model is available on this instance.</p>
)}
diff --git a/client/src/components/videoGen/KeyframePanel.jsx b/client/src/components/videoGen/KeyframePanel.jsx
index 906bc21260..6807ff4a31 100644
--- a/client/src/components/videoGen/KeyframePanel.jsx
+++ b/client/src/components/videoGen/KeyframePanel.jsx
@@ -89,7 +89,7 @@ export default function KeyframePanel({
</button>
<span className="text-[10px] text-gray-500">{keyframes.length}/8</span>
</div>
- {keyframesError && <p className="text-[10px] text-port-error leading-snug">{keyframesError}</p>}
+ {keyframesError && <p role="alert" className="text-[10px] text-port-error leading-snug">{keyframesError}</p>}
<p className="text-[10px] text-gray-500 leading-snug">
Keyframes pull from your gallery only. Indices must be strictly ascending and below numFrames ({numFrames}).
</p>
diff --git a/client/src/components/writers-room/SceneCard.jsx b/client/src/components/writers-room/SceneCard.jsx
index 84b3f56f62..9a78b83981 100644
--- a/client/src/components/writers-room/SceneCard.jsx
+++ b/client/src/components/writers-room/SceneCard.jsx
@@ -358,7 +358,7 @@ const SceneCard = forwardRef(function SceneCard({
</div>
)}
{view === 'error' && (
- <div className="text-port-error text-[11px] px-3 text-center break-words">
+ <div role="alert" className="text-port-error text-[11px] px-3 text-center break-words">
{error || 'Generation failed'}
</div>
)}
diff --git a/client/src/pages/ApiExplorer.jsx b/client/src/pages/ApiExplorer.jsx
index 9d692d9a48..35a4b97de6 100644
--- a/client/src/pages/ApiExplorer.jsx
+++ b/client/src/pages/ApiExplorer.jsx
@@ -224,7 +224,7 @@ function RestReferenceView() {
</div>
</div>
<div className="min-h-0 flex-1 overflow-auto bg-port-bg">
- {error && <div className="p-6 text-port-error">OpenAPI spec unavailable: {error}</div>}
+ {error && <div role="status" className="p-6 text-port-error">OpenAPI spec unavailable: {error}</div>}
{!error && !spec && <div className="p-6"><BrailleSpinner text="Loading REST reference" /></div>}
{!error && spec && (
<div className="p-3 sm:p-4 space-y-4 max-w-[1500px] mx-auto">
diff --git a/client/src/pages/CatalogIngest.jsx b/client/src/pages/CatalogIngest.jsx
index 94e3d244f4..a445a90d06 100644
--- a/client/src/pages/CatalogIngest.jsx
+++ b/client/src/pages/CatalogIngest.jsx
@@ -643,7 +643,7 @@ export default function CatalogIngest() {
{Number.isFinite(s.count) && s.count > 0 && (
<span className="text-xs text-gray-500">({s.count})</span>
)}
- {s.error && <span className="text-xs text-port-error">— {s.error}</span>}
+ {s.error && <span role="status" className="text-xs text-port-error">— {s.error}</span>}
</li>
))}
</ul>
diff --git a/client/src/pages/CreateApp.jsx b/client/src/pages/CreateApp.jsx
index d0741625f2..52ead9f75e 100644
--- a/client/src/pages/CreateApp.jsx
+++ b/client/src/pages/CreateApp.jsx
@@ -612,7 +612,7 @@ export default function CreateApp() {
{/* Error Display */}
{error && (
- <div className="p-4 bg-port-error/20 border border-port-error rounded-lg text-port-error">
+ <div role="alert" className="p-4 bg-port-error/20 border border-port-error rounded-lg text-port-error">
{error}
</div>
)}
diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx
index efb055731e..5ac55905e8 100644
--- a/client/src/pages/Dashboard.jsx
+++ b/client/src/pages/Dashboard.jsx
@@ -503,12 +503,12 @@ export default function Dashboard() {
<FirstRunCard />
{dataError && (
- <div className="p-4 bg-port-error/20 border border-port-error rounded-lg text-port-error">
+ <div role="status" className="p-4 bg-port-error/20 border border-port-error rounded-lg text-port-error">
{dataError}
</div>
)}
{layoutsError && (
- <div className="p-4 bg-port-error/20 border border-port-error rounded-lg text-port-error">
+ <div role="status" className="p-4 bg-port-error/20 border border-port-error rounded-lg text-port-error">
Layouts: {layoutsError}
</div>
)}
diff --git a/client/src/pages/DataDog.jsx b/client/src/pages/DataDog.jsx
index 9134baaeea..87389e3510 100644
--- a/client/src/pages/DataDog.jsx
+++ b/client/src/pages/DataDog.jsx
@@ -246,7 +246,7 @@ export default function DataDog() {
</h2>
{saveError && (
- <div className="mb-4 p-3 bg-port-error/20 border border-port-error/40 rounded">
+ <div role="alert" className="mb-4 p-3 bg-port-error/20 border border-port-error/40 rounded">
<p className="text-port-error font-medium">Error saving DataDog instance</p>
<p className="text-port-error/80 text-sm mt-1">{saveError}</p>
</div>
diff --git a/client/src/pages/ImageGen.jsx b/client/src/pages/ImageGen.jsx
index 6be1c4c8d5..d477787462 100644
--- a/client/src/pages/ImageGen.jsx
+++ b/client/src/pages/ImageGen.jsx
@@ -1443,7 +1443,7 @@ export default function ImageGen() {
)}
{progressPct != null && <span className="text-xs text-port-accent">{progressPct}%</span>}
{(generating || error) && (
- <span className={`text-xs truncate ${error ? 'text-port-error' : 'text-gray-400'}`}>
+ <span role="status" className={`text-xs truncate ${error ? 'text-port-error' : 'text-gray-400'}`}>
{error ? String(error).split('\n')[0] : (stage ? (STAGE_LABELS[stage.name] || stage.name) : statusMsg) || 'Working...'}
</span>
)}
@@ -1564,7 +1564,7 @@ export default function ImageGen() {
cloudModelDefaultLabel={savedAgyModel || AGY_IMAGEGEN_DEFAULT_MODEL}
/>
{isAgyMode && agy.error && (
- <p className="text-xs text-port-warning">
+ <p role="status" className="text-xs text-port-warning">
{agy.error} — renders will use the model saved in Settings → Image Gen.
</p>
)}
@@ -1662,7 +1662,7 @@ export default function ImageGen() {
</details>
{error && (
- <div className="rounded-lg border border-port-error/40 bg-port-error/10 px-3 py-3 text-xs text-port-error space-y-2">
+ <div role="alert" className="rounded-lg border border-port-error/40 bg-port-error/10 px-3 py-3 text-xs text-port-error space-y-2">
<div className="font-semibold text-sm">
{ERROR_HEADINGS[errorMeta?.kind] || 'Generation failed'}
</div>
diff --git a/client/src/pages/Jira.jsx b/client/src/pages/Jira.jsx
index 0a7e491758..3edb77313c 100644
--- a/client/src/pages/Jira.jsx
+++ b/client/src/pages/Jira.jsx
@@ -251,7 +251,7 @@ export default function Jira() {
</h2>
{saveError && (
- <div className="mb-4 p-3 bg-port-error/20 border border-port-error/40 rounded">
+ <div role="alert" className="mb-4 p-3 bg-port-error/20 border border-port-error/40 rounded">
<p className="text-port-error font-medium">Error saving JIRA instance</p>
<p className="text-port-error/80 text-sm mt-1">{saveError}</p>
</div>
diff --git a/client/src/pages/LocalLlmPlayground.jsx b/client/src/pages/LocalLlmPlayground.jsx
index 63a7f936c9..061c4bf574 100644
--- a/client/src/pages/LocalLlmPlayground.jsx
+++ b/client/src/pages/LocalLlmPlayground.jsx
@@ -162,7 +162,7 @@ function ResultPanel({ result }) {
</div>
{result.error && (
- <p className="text-sm text-port-error whitespace-pre-wrap">{result.error}</p>
+ <p role="alert" className="text-sm text-port-error whitespace-pre-wrap">{result.error}</p>
)}
{result.text && (
<div className="space-y-1">
diff --git a/client/src/pages/Login.jsx b/client/src/pages/Login.jsx
index 2677d0b981..2ac3631fbf 100644
--- a/client/src/pages/Login.jsx
+++ b/client/src/pages/Login.jsx
@@ -90,7 +90,7 @@ export default function Login() {
/>
</div>
{error && (
- <div className="text-sm text-port-error">{error}</div>
+ <div role="alert" className="text-sm text-port-error">{error}</div>
)}
<button
type="submit"
diff --git a/client/src/pages/Media3DDetail.jsx b/client/src/pages/Media3DDetail.jsx
index 187af6e434..9e0eee1f0e 100644
--- a/client/src/pages/Media3DDetail.jsx
+++ b/client/src/pages/Media3DDetail.jsx
@@ -272,7 +272,7 @@ export default function Media3DDetail() {
)}
{record.status === 'failed' && record.error && (
- <div className="mb-4 flex items-start gap-1.5 rounded-lg border border-port-error/30 bg-port-error/10 px-3 py-2 text-sm text-port-error">
+ <div role="status" className="mb-4 flex items-start gap-1.5 rounded-lg border border-port-error/30 bg-port-error/10 px-3 py-2 text-sm text-port-error">
<AlertTriangle className="mt-0.5 h-4 w-4 shrink-0" /> {record.error}
</div>
)}
diff --git a/client/src/pages/MediaModels.jsx b/client/src/pages/MediaModels.jsx
index 88fc8ffa1a..a5c66c4296 100644
--- a/client/src/pages/MediaModels.jsx
+++ b/client/src/pages/MediaModels.jsx
@@ -533,7 +533,7 @@ export default function MediaModels() {
</button>
</div>
{addError && (
- <p className="text-xs text-port-error flex items-start gap-1">
+ <p role="alert" className="text-xs text-port-error flex items-start gap-1">
<AlertTriangle className="w-3 h-3 mt-0.5 shrink-0" /> {addError}
</p>
)}
diff --git a/client/src/pages/OpenClaw.jsx b/client/src/pages/OpenClaw.jsx
index 29e4d7a83f..58ce31d7bb 100644
--- a/client/src/pages/OpenClaw.jsx
+++ b/client/src/pages/OpenClaw.jsx
@@ -508,14 +508,14 @@ export default function OpenClaw() {
</div>
{pageError && (
- <div className="mx-4 mt-4 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-200">
+ <div role="alert" className="mx-4 mt-4 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-200">
<AlertCircle size={16} className="mt-0.5 shrink-0" />
<span>{pageError}</span>
</div>
)}
{messagesError && (
- <div className="mx-4 mt-4 flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-100">
+ <div role="status" className="mx-4 mt-4 flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-100">
<AlertCircle size={16} className="mt-0.5 shrink-0" />
<span>{messagesError}</span>
</div>
diff --git a/client/src/pages/Review.jsx b/client/src/pages/Review.jsx
index 4badd47054..4a81fce02d 100644
--- a/client/src/pages/Review.jsx
+++ b/client/src/pages/Review.jsx
@@ -400,7 +400,7 @@ export default function Review() {
</div>
)}
{queueSourceErrors.length > 0 && (
- <p className="text-xs text-gray-600">
+ <p role="status" className="text-xs text-gray-600">
Couldn&apos;t load: {queueSourceErrors.map(([, s]) => s.label).join(', ')}.
</p>
)}
diff --git a/client/src/pages/RunnerPage.jsx b/client/src/pages/RunnerPage.jsx
index 6582c7fff1..225e7d6e7e 100644
--- a/client/src/pages/RunnerPage.jsx
+++ b/client/src/pages/RunnerPage.jsx
@@ -285,7 +285,7 @@ ${prompt.trim()}`;
</div>
</div>
{continueContext.success === false && continueContext.error && (
- <div>
+ <div role="status">
<div className="text-xs text-port-error uppercase tracking-wide mb-1">Error</div>
<div className="text-port-error/80 bg-port-error/10 rounded px-2 py-1 font-mono text-xs max-h-20 overflow-auto">
{continueContext.error}
diff --git a/client/src/pages/StackerNews.jsx b/client/src/pages/StackerNews.jsx
index fefbcbd2ab..ece1934fe1 100644
--- a/client/src/pages/StackerNews.jsx
+++ b/client/src/pages/StackerNews.jsx
@@ -542,7 +542,7 @@ export default function StackerNews() {
if (loading) return <PageSkeleton header="bar" label="Loading Stacker News" tabs={TABS.length} cards={3} />;
const notFound = accountId && !selected;
- return <div className="flex h-full min-h-0 flex-col"><PageHeader icon={Newspaper} title="Stacker News" subtitle="Review-gated multi-account community stewardship" actions={accountSwitcher} /><TabPills tabs={TABS} activeTab={activeTab} onChange={(nextTab) => selected ? navigate(accountPath(selected.id, nextTab)) : navigate('/stacker-news')} ariaLabel="Stacker News sections" /><main className="flex-1 overflow-auto p-4">{error && <div className="mb-3 rounded border border-port-error p-3 text-sm text-port-error">{error}</div>}{notice && <div className="mb-3 rounded border border-port-border p-3 text-sm text-gray-200">{notice}</div>}{notFound && <div className="mb-3 rounded border border-port-error p-4 text-sm text-port-error">This Stacker News account was not found. <button className="underline" onClick={() => navigate('/stacker-news')}>Return to accounts.</button></div>}{activeTab === 'review' && selected && renderReview()}{activeTab === 'territory' && selected && renderTerritory()}{activeTab === 'drafts' && selected && renderDrafts()}{activeTab === 'activity' && selected && <section className="rounded border border-port-border bg-port-card p-4"><h2 className="font-semibold text-white">Action ledger for {scope}</h2><div className="mt-3 space-y-2">{visibleActions.map((action) => <div key={action.id} className="rounded border border-port-border p-3 text-sm text-gray-300"><div>{action.kind.replaceAll('_', ' ')} · {action.state}</div>{action.error && <div className="mt-1 text-port-error">{action.error}</div>}{action.result?.handoffOpened && <div className="mt-1 text-gray-400">Fixed browser handoff opened.</div>}</div>)}{!visibleActions.length && <p className="text-sm text-gray-500">No actions recorded for {scope}.</p>}</div></section>}{activeTab === 'accounts' && renderAccounts()}</main>{accountDrawer}</div>;
+ return <div className="flex h-full min-h-0 flex-col"><PageHeader icon={Newspaper} title="Stacker News" subtitle="Review-gated multi-account community stewardship" actions={accountSwitcher} /><TabPills tabs={TABS} activeTab={activeTab} onChange={(nextTab) => selected ? navigate(accountPath(selected.id, nextTab)) : navigate('/stacker-news')} ariaLabel="Stacker News sections" /><main className="flex-1 overflow-auto p-4">{error && <div role="status" className="mb-3 rounded border border-port-error p-3 text-sm text-port-error">{error}</div>}{notice && <div className="mb-3 rounded border border-port-border p-3 text-sm text-gray-200">{notice}</div>}{notFound && <div className="mb-3 rounded border border-port-error p-4 text-sm text-port-error">This Stacker News account was not found. <button className="underline" onClick={() => navigate('/stacker-news')}>Return to accounts.</button></div>}{activeTab === 'review' && selected && renderReview()}{activeTab === 'territory' && selected && renderTerritory()}{activeTab === 'drafts' && selected && renderDrafts()}{activeTab === 'activity' && selected && <section className="rounded border border-port-border bg-port-card p-4"><h2 className="font-semibold text-white">Action ledger for {scope}</h2><div className="mt-3 space-y-2">{visibleActions.map((action) => <div key={action.id} className="rounded border border-port-border p-3 text-sm text-gray-300"><div>{action.kind.replaceAll('_', ' ')} · {action.state}</div>{action.error && <div role="status" className="mt-1 text-port-error">{action.error}</div>}{action.result?.handoffOpened && <div className="mt-1 text-gray-400">Fixed browser handoff opened.</div>}</div>)}{!visibleActions.length && <p className="text-sm text-gray-500">No actions recorded for {scope}.</p>}</div></section>}{activeTab === 'accounts' && renderAccounts()}</main>{accountDrawer}</div>;
}
function Field({ id, label, children }) {
@@ -581,7 +581,7 @@ function AccountDrawer({ mode, username, activeTab, onTabChange, onClose, formEr
closeOnBackdrop={false}
closeLabel="Close account settings"
>
- {formError && <div className="mb-3 rounded border border-port-error p-3 text-sm text-port-error">{formError}</div>}
+ {formError && <div role="alert" className="mb-3 rounded border border-port-error p-3 text-sm text-port-error">{formError}</div>}
<form className="space-y-3" onSubmit={onSubmit}>
{activeTab === 'identity' && <>
<Field id={`${prefix}-label`} label="Local label"><input id={`${prefix}-label`} required className={fieldClass} value={form.label} onChange={(event) => update('label', event.target.value)} /></Field>
diff --git a/client/src/pages/Templates.jsx b/client/src/pages/Templates.jsx
index fd775bf2d9..8e9e6789b6 100644
--- a/client/src/pages/Templates.jsx
+++ b/client/src/pages/Templates.jsx
@@ -141,7 +141,7 @@ export default function Templates() {
</div>
{error && (
- <div className="p-3 bg-port-error/20 border border-port-error rounded-lg text-port-error text-sm">
+ <div role="alert" className="p-3 bg-port-error/20 border border-port-error rounded-lg text-port-error text-sm">
{error}
</div>
)}
diff --git a/client/src/pages/ThreejsModelDetail.jsx b/client/src/pages/ThreejsModelDetail.jsx
index c2155133f8..e82032bfe9 100644
--- a/client/src/pages/ThreejsModelDetail.jsx
+++ b/client/src/pages/ThreejsModelDetail.jsx
@@ -575,7 +575,7 @@ export default function ThreejsModelDetail() {
)}
{record.error && (
- <div className="rounded-lg border border-port-error/30 bg-port-error/10 px-3 py-2 text-sm text-port-error">
+ <div role="status" className="rounded-lg border border-port-error/30 bg-port-error/10 px-3 py-2 text-sm text-port-error">
{record.error}
</div>
)}
diff --git a/client/src/pages/UsagePage.jsx b/client/src/pages/UsagePage.jsx
index 580a315e9d..790f5dc68a 100644
--- a/client/src/pages/UsagePage.jsx
+++ b/client/src/pages/UsagePage.jsx
@@ -152,7 +152,7 @@ function ProviderQuotaCard({ quota, onRefresh, refreshing, disabled }) {
meter, so the note rides along — otherwise the one state where the
reading's age matters most is the one state that hides it. */}
{quota.supported && !quota.pending && quota.error && (
- <div className="flex items-start gap-1.5 sm:gap-2 text-xs sm:text-sm text-gray-400 py-1">
+ <div role="status" className="flex items-start gap-1.5 sm:gap-2 text-xs sm:text-sm text-gray-400 py-1">
<AlertTriangle size={15} className="text-port-warning mt-0.5 shrink-0" />
<span>
{quota.error}
diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsx
index 9efa6ec357..a41ca46efe 100644
--- a/client/src/pages/VideoGen.jsx
+++ b/client/src/pages/VideoGen.jsx
@@ -1380,7 +1380,7 @@ export default function VideoGen() {
)}
{progressPct != null && <span className="text-xs text-port-accent">{progressPct}%</span>}
{(generating || error) && (
- <span className={`text-xs truncate ${error ? 'text-port-error' : 'text-gray-400'}`}>
+ <span role="status" className={`text-xs truncate ${error ? 'text-port-error' : 'text-gray-400'}`}>
{error || statusMsg || 'Working...'}
</span>
)}
@@ -1667,7 +1667,7 @@ export default function VideoGen() {
/>
)}
{activeWeightError && (
- <div className="mt-2 rounded-lg border border-port-error/40 bg-port-error/10 px-3 py-2 text-[11px] text-port-error">
+ <div role="status" className="mt-2 rounded-lg border border-port-error/40 bg-port-error/10 px-3 py-2 text-[11px] text-port-error">
<p>{activeWeightError.message}</p>
<div className="mt-1 flex flex-wrap gap-2">
<button type="button" onClick={openSettings} className="underline hover:text-white">
@@ -1687,7 +1687,7 @@ export default function VideoGen() {
</div>
)}
{modelDownload.statusError && (
- <div className="mt-2 rounded-lg border border-port-warning/40 bg-port-warning/10 px-3 py-2 text-[11px] text-port-warning flex flex-wrap items-center justify-between gap-2">
+ <div role="status" className="mt-2 rounded-lg border border-port-warning/40 bg-port-warning/10 px-3 py-2 text-[11px] text-port-warning flex flex-wrap items-center justify-between gap-2">
<span>{modelDownload.statusError}</span>
<button type="button" onClick={modelDownload.refresh} className="underline hover:text-white">
Retry cache check
diff --git a/client/src/pages/X.jsx b/client/src/pages/X.jsx
index b67e508a1a..2b7f32dc78 100644
--- a/client/src/pages/X.jsx
+++ b/client/src/pages/X.jsx
@@ -262,9 +262,9 @@ export default function XPage() {
const renderAccounts = () => <section className="rounded border border-port-border bg-port-card p-4"><div className="flex flex-wrap items-start justify-between gap-3"><div><h2 className="font-semibold text-white">X accounts</h2><p className="mt-1 text-sm text-gray-400">Browser-only diagnostics and review-gated compose handoffs. No X credentials are stored.</p></div><button type="button" className={buttonClass} onClick={() => { setAccountForm(emptyAccount); openAccountForm('new'); }}><Plus size={15} className="mr-1 inline" />Add account</button></div>{!accounts.length ? <div className="mt-4 rounded border border-port-border p-4 text-sm text-gray-400">Add an X account to begin. Sync is manual, so nothing contacts X at boot.</div> : <div className="mt-4 grid gap-3 md:grid-cols-2">{accounts.map((account) => <article key={account.id} className="rounded border border-port-border p-4"><div className="flex items-start justify-between gap-2"><div><h3 className="font-semibold text-white">{account.label}</h3><p className="text-sm text-gray-400">@{account.username}</p></div><StatusBadge value={account.enabled}>{account.enabled ? 'Enabled' : 'Disabled'}</StatusBadge></div><p className="mt-3 text-xs text-gray-500">{account.lastSyncAt ? `Last diagnostic ${formatDate(account.lastSyncAt)}` : 'No diagnostic yet'}</p><div className="mt-3 flex flex-wrap gap-2"><button type="button" className={secondaryButton} onClick={() => openEditAccount(account)}>Edit</button><button type="button" className={secondaryButton} onClick={() => navigate(accountPath(account.id, 'health'))}>Open</button>{deleteAccountId === account.id ? <><button type="button" className="rounded border border-port-error px-3 py-2 text-sm text-port-error disabled:opacity-50" disabled={Boolean(busy)} onClick={() => removeAccount(account.id)}>Delete</button><button type="button" className={secondaryButton} onClick={() => setDeleteAccountId(null)}>Cancel</button></> : <button type="button" className={secondaryButton} onClick={() => setDeleteAccountId(account.id)}>Remove</button>}</div></article>)}</div>}</section>;
- const accountDrawer = <Drawer open={accountDrawerOpen} onClose={closeAccountForm} title={accountFormMode === 'edit' ? 'Edit X account' : 'Add X account'} subtitle="Read-only diagnostics with human-reviewed drafts" size="md"><form className="space-y-4" onSubmit={saveAccount}><label className="block text-sm text-gray-300" htmlFor="x-account-label">Local label<input id="x-account-label" className={`${fieldClass} mt-1`} required value={accountForm.label} onChange={(event) => updateAccountForm('label', event.target.value)} /></label><label className="block text-sm text-gray-300" htmlFor="x-account-username">X username<input id="x-account-username" className={`${fieldClass} mt-1`} required placeholder="example_user" value={accountForm.username} onChange={(event) => updateAccountForm('username', event.target.value)} /><span className="mt-1 block text-xs text-gray-500">Enter the handle without or with @. PortOS normalizes it.</span></label><label className="block text-sm text-gray-300" htmlFor="x-account-notes">Notes<textarea id="x-account-notes" className={`${fieldClass} mt-1`} rows="4" value={accountForm.notes} onChange={(event) => updateAccountForm('notes', event.target.value)} /></label><label className="flex items-center gap-2 text-sm text-gray-300" htmlFor="x-account-enabled"><input id="x-account-enabled" type="checkbox" checked={accountForm.enabled} onChange={(event) => updateAccountForm('enabled', event.target.checked)} /> Allow diagnostics and compose handoffs</label><div className="rounded border border-port-border bg-port-bg p-3 text-xs text-gray-400">The managed browser reads public X pages. PortOS does not store your X password or API token, does not run background posting, and only opens an approved draft for final manual submission.</div>{accountFormError && <p className="text-sm text-port-error">{accountFormError}</p>}<div className="flex justify-end gap-2"><button type="button" className={secondaryButton} onClick={closeAccountForm}>Cancel</button><button className={buttonClass} disabled={Boolean(busy) || !accountForm.label.trim() || !accountForm.username.trim()}>{accountFormMode === 'edit' ? 'Save account' : 'Add account'}</button></div></form></Drawer>;
+ const accountDrawer = <Drawer open={accountDrawerOpen} onClose={closeAccountForm} title={accountFormMode === 'edit' ? 'Edit X account' : 'Add X account'} subtitle="Read-only diagnostics with human-reviewed drafts" size="md"><form className="space-y-4" onSubmit={saveAccount}><label className="block text-sm text-gray-300" htmlFor="x-account-label">Local label<input id="x-account-label" className={`${fieldClass} mt-1`} required value={accountForm.label} onChange={(event) => updateAccountForm('label', event.target.value)} /></label><label className="block text-sm text-gray-300" htmlFor="x-account-username">X username<input id="x-account-username" className={`${fieldClass} mt-1`} required placeholder="example_user" value={accountForm.username} onChange={(event) => updateAccountForm('username', event.target.value)} /><span className="mt-1 block text-xs text-gray-500">Enter the handle without or with @. PortOS normalizes it.</span></label><label className="block text-sm text-gray-300" htmlFor="x-account-notes">Notes<textarea id="x-account-notes" className={`${fieldClass} mt-1`} rows="4" value={accountForm.notes} onChange={(event) => updateAccountForm('notes', event.target.value)} /></label><label className="flex items-center gap-2 text-sm text-gray-300" htmlFor="x-account-enabled"><input id="x-account-enabled" type="checkbox" checked={accountForm.enabled} onChange={(event) => updateAccountForm('enabled', event.target.checked)} /> Allow diagnostics and compose handoffs</label><div className="rounded border border-port-border bg-port-bg p-3 text-xs text-gray-400">The managed browser reads public X pages. PortOS does not store your X password or API token, does not run background posting, and only opens an approved draft for final manual submission.</div>{accountFormError && <p role="alert" className="text-sm text-port-error">{accountFormError}</p>}<div className="flex justify-end gap-2"><button type="button" className={secondaryButton} onClick={closeAccountForm}>Cancel</button><button className={buttonClass} disabled={Boolean(busy) || !accountForm.label.trim() || !accountForm.username.trim()}>{accountFormMode === 'edit' ? 'Save account' : 'Add account'}</button></div></form></Drawer>;
const notFound = Boolean(accountId && !selected);
if (loading) return <PageSkeleton header="bar" label="Loading X" tabs={TABS.length} cards={3} />;
- return <div className="flex h-full min-h-0 flex-col"><PageHeader icon={AtSign} title="X" subtitle="Account health, reach diagnostics, and review-gated drafts" actions={accountSwitcher} /><TabPills tabs={TABS} activeTab={activeTab} onChange={(nextTab) => selected ? navigate(accountPath(selected.id, nextTab)) : navigate('/x')} ariaLabel="X sections" /><main className="flex-1 overflow-auto p-4">{error && <div className="mb-3 rounded border border-port-error p-3 text-sm text-port-error">{error}</div>}{notice && <div className="mb-3 rounded border border-port-border p-3 text-sm text-gray-200">{notice}</div>}{notFound && <div className="mb-3 rounded border border-port-error p-4 text-sm text-port-error">This X account was not found. <button type="button" className="underline" onClick={() => navigate('/x')}>Return to accounts.</button></div>}{activeTab === 'health' && selected && renderHealth()}{activeTab === 'posts' && selected && renderPosts()}{activeTab === 'drafts' && selected && renderDrafts()}{activeTab === 'accounts' && renderAccounts()}{accountDrawer}</main></div>;
+ return <div className="flex h-full min-h-0 flex-col"><PageHeader icon={AtSign} title="X" subtitle="Account health, reach diagnostics, and review-gated drafts" actions={accountSwitcher} /><TabPills tabs={TABS} activeTab={activeTab} onChange={(nextTab) => selected ? navigate(accountPath(selected.id, nextTab)) : navigate('/x')} ariaLabel="X sections" /><main className="flex-1 overflow-auto p-4">{error && <div role="status" className="mb-3 rounded border border-port-error p-3 text-sm text-port-error">{error}</div>}{notice && <div className="mb-3 rounded border border-port-border p-3 text-sm text-gray-200">{notice}</div>}{notFound && <div className="mb-3 rounded border border-port-error p-4 text-sm text-port-error">This X account was not found. <button type="button" className="underline" onClick={() => navigate('/x')}>Return to accounts.</button></div>}{activeTab === 'health' && selected && renderHealth()}{activeTab === 'posts' && selected && renderPosts()}{activeTab === 'drafts' && selected && renderDrafts()}{activeTab === 'accounts' && renderAccounts()}{accountDrawer}</main></div>;
}