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

feat([banner-icon-aria-hidden]): hide decorative Banner icon from screen readers

[._.]/ Adam Eivy37502ed53a6a
diff --git a/client/src/components/brain/tabs/ImportTab.jsx b/client/src/components/brain/tabs/ImportTab.jsx
index 352c9f8d64..31927c3abc 100644
--- a/client/src/components/brain/tabs/ImportTab.jsx
+++ b/client/src/components/brain/tabs/ImportTab.jsx
@@ -12,6 +12,7 @@ import {Upload,
Sparkles} from 'lucide-react';
import * as api from '../../../services/api';
import toast from '../../ui/Toast';
+import Banner from '../../ui/Banner';
import BrailleSpinner from '../../BrailleSpinner';
import { formatBytes, formatDateShort } from '../../../utils/formatters';
@@ -198,13 +199,19 @@ function ChatGPTWizard({ onExit, navigate }) {
<Header onExit={onExit} />
<Stepper steps={STEPS} activeIdx={stepIdx} />
{error && (
- <div className="mb-4 p-3 rounded border border-port-error/30 bg-port-error/10 text-sm text-port-error flex items-start gap-2">
- <AlertCircle size={16} className="mt-0.5 flex-shrink-0" aria-hidden="true" />
- <span>{error}</span>
- <button className="ml-auto text-gray-400 hover:text-white" onClick={() => setError(null)} aria-label="Dismiss">
- <X size={14} />
- </button>
- </div>
+ <Banner
+ tone="error"
+ size="md"
+ icon={AlertCircle}
+ className="mb-4"
+ actions={
+ <button className="text-gray-400 hover:text-white" onClick={() => setError(null)} aria-label="Dismiss">
+ <X size={14} />
+ </button>
+ }
+ >
+ {error}
+ </Banner>
)}
{step.id === 'instructions' && <StepInstructions onNext={goNext} />}
diff --git a/client/src/components/ui/Banner.jsx b/client/src/components/ui/Banner.jsx
index f925f7b2c3..bc8bdb0450 100644
--- a/client/src/components/ui/Banner.jsx
+++ b/client/src/components/ui/Banner.jsx
@@ -37,6 +37,11 @@ const ALIGNMENTS = {
export default function Banner({
tone = 'warning',
icon: Icon,
+ // Banner icons are decorative by default — the tone color and body text
+ // already convey the meaning, so screen readers should skip the icon. Pass
+ // `iconAriaHidden={false}` for the rare case where the icon carries meaning
+ // the text doesn't (then give it an aria-label via the icon itself).
+ iconAriaHidden = true,
size = 'sm',
align = 'start',
title,
@@ -60,7 +65,11 @@ export default function Banner({
{...rest}
>
{Icon ? (
- <Icon size={s.iconSize} className={`shrink-0 ${iconNudge} ${t.iconColor}`.trim()} />
+ <Icon
+ size={s.iconSize}
+ className={`shrink-0 ${iconNudge} ${t.iconColor}`.trim()}
+ aria-hidden={iconAriaHidden ? 'true' : undefined}
+ />
) : null}
<div className="flex-1 min-w-0">
{title ? <div className="font-medium">{title}</div> : null}
diff --git a/client/src/components/ui/Banner.test.jsx b/client/src/components/ui/Banner.test.jsx
index bc0ee5ed14..c857f6391e 100644
--- a/client/src/components/ui/Banner.test.jsx
+++ b/client/src/components/ui/Banner.test.jsx
@@ -41,6 +41,18 @@ describe('Banner', () => {
expect(svg.getAttribute('class')).toContain('text-port-accent');
});
+ it('marks the icon aria-hidden by default so screen readers skip the decorative glyph', () => {
+ const { container } = render(<Banner icon={AlertTriangle}>x</Banner>);
+ const svg = container.querySelector('svg');
+ expect(svg.getAttribute('aria-hidden')).toBe('true');
+ });
+
+ it('exposes the icon to assistive tech when iconAriaHidden={false}', () => {
+ const { container } = render(<Banner icon={AlertTriangle} iconAriaHidden={false}>x</Banner>);
+ const svg = container.querySelector('svg');
+ expect(svg.getAttribute('aria-hidden')).toBeNull();
+ });
+
it('renders a bold title above the children when supplied', () => {
render(<Banner title="Heads up">details below</Banner>);
const titleEl = screen.getByText('Heads up');