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: enable four low-noise Biome a11y lint rules (#8107)

[._.]/ Adam Eivy36b78c7791c6
diff --git a/client/biome.jsonc b/client/biome.jsonc
index 3b90ca78dd..4b0ae4f5e5 100644
--- a/client/biome.jsonc
+++ b/client/biome.jsonc
@@ -83,7 +83,11 @@
"useAltText": "error",
"useAriaPropsForRole": "error",
"useValidAriaProps": "error",
- "noLabelWithoutControl": "error"
+ "noLabelWithoutControl": "error",
+ "useKeyWithClickEvents": "error",
+ "noNoninteractiveElementToInteractiveRole": "error",
+ "useFocusableInteractive": "error",
+ "noAriaHiddenOnFocusable": "error"
},
"complexity": {
// eslint: no-regex-spaces
diff --git a/client/src/components/CmdKSearch.jsx b/client/src/components/CmdKSearch.jsx
index 3ba7e0ecb6..df488407a2 100644
--- a/client/src/components/CmdKSearch.jsx
+++ b/client/src/components/CmdKSearch.jsx
@@ -15,6 +15,7 @@ import { RECENT_KEY, RECENT_CAP, resolveRecentNavEntries } from '../utils/navWor
import { filterNavByFeatures } from '../lib/navFeatures.js';
import { safeReadJsonStorage } from '../lib/safeStorage.js';
import { escapeRegExp } from '../lib/textUtils.js';
+import { onActivateKeyDown } from '../lib/a11yKeyboard.js';
const ICON_MAP = { Brain, Cpu, Package, History, HeartPulse };
@@ -428,6 +429,12 @@ export default function CmdKSearch() {
}`}
role="option"
aria-selected={isFocused}
+ // Virtually focused via the input's `aria-activedescendant` (WAI-ARIA
+ // combobox pattern) rather than individually tabbable; tabIndex={-1}
+ // still lets it be moved into view and keeps this row keyboard-operable
+ // if it ever receives focus directly.
+ tabIndex={-1}
+ onKeyDown={onActivateKeyDown(() => dispatchCommand(item))}
>
{Icon && <Icon size={14} className="shrink-0 mt-0.5 text-gray-400" />}
<div className="flex-1 min-w-0">
diff --git a/client/src/components/EntityCombobox.jsx b/client/src/components/EntityCombobox.jsx
index 4c94b25f92..7637a53947 100644
--- a/client/src/components/EntityCombobox.jsx
+++ b/client/src/components/EntityCombobox.jsx
@@ -169,21 +169,21 @@ export default function EntityCombobox({
</button>
</div>
{open && (
- <ul
+ <div
ref={listboxRef}
id={listId}
role="listbox"
className="absolute left-0 right-0 top-full mt-1 z-30 max-h-80 overflow-y-auto bg-port-card border border-port-border rounded shadow-lg"
>
{filtered.length === 0 && !showCreateOption && (
- <li className="px-3 py-2 text-xs text-gray-500">
+ <div className="px-3 py-2 text-xs text-gray-500">
{list.length === 0
? (emptyNoItems || `No ${noun}s yet — type a name.`)
: 'No matches'}
- </li>
+ </div>
)}
{filtered.map((u, i) => (
- <li key={u.id}>
+ <div key={u.id}>
<button
type="button"
ref={i === activeIdx ? activeOptionRef : null}
@@ -202,10 +202,10 @@ export default function EntityCombobox({
</div>
{u.id === selectedId && <Check size={14} className="text-port-accent" />}
</button>
- </li>
+ </div>
))}
{showCreateOption && (
- <li>
+ <div>
<button
type="button"
ref={activeIdx === filtered.length ? activeOptionRef : null}
@@ -224,9 +224,9 @@ export default function EntityCombobox({
{busy ? <Loader2 size={14} className="animate-spin" /> : <Plus size={14} />}
{createPrefix} &ldquo;{trimmed}&rdquo;
</button>
- </li>
+ </div>
)}
- </ul>
+ </div>
)}
</div>
);
diff --git a/client/src/components/IngredientPicker.jsx b/client/src/components/IngredientPicker.jsx
index 21ddacbcf6..ac24c60495 100644
--- a/client/src/components/IngredientPicker.jsx
+++ b/client/src/components/IngredientPicker.jsx
@@ -25,7 +25,7 @@ import { Search, Plus, Loader2, X, Sparkles } from 'lucide-react';
import Modal from './ui/Modal';
import { listCatalogIngredients } from '../services/apiCatalog';
import { CATALOG_BADGE_BY_ID, payloadSnippet } from '../lib/catalogTypes';
-import { clickableProps } from '../lib/a11yKeyboard';
+import { clickableProps, onActivateKeyDown } from '../lib/a11yKeyboard';
// Type chip color comes from the shared registry. Snippet uses the registry's
// per-type fallback chain at a slightly longer cap for the picker rows.
@@ -225,6 +225,7 @@ export default function IngredientPicker({
{multi ? (
<div onClick={() => toggleSelected(it.id)}
{...clickableProps(() => toggleSelected(it.id))}
+ onKeyDown={onActivateKeyDown(() => toggleSelected(it.id))}
className={`${rowClass} cursor-pointer`}>
{inner}
</div>
diff --git a/client/src/components/TagPicker.jsx b/client/src/components/TagPicker.jsx
index a011d58941..32eb331889 100644
--- a/client/src/components/TagPicker.jsx
+++ b/client/src/components/TagPicker.jsx
@@ -155,9 +155,9 @@ export default function TagPicker({
/>
</div>
{expanded && (
- <ul id={listId} role="listbox" aria-label="Tag suggestions" className="absolute z-20 mt-1 w-full max-h-48 overflow-y-auto bg-port-card border border-port-border rounded shadow-lg">
+ <div id={listId} role="listbox" aria-label="Tag suggestions" className="absolute z-20 mt-1 w-full max-h-48 overflow-y-auto bg-port-card border border-port-border rounded shadow-lg">
{visibleSuggestions.map((s, index) => (
- <li key={s.id} role="presentation">
+ <div key={s.id}>
<button
type="button"
role="option"
@@ -178,9 +178,9 @@ export default function TagPicker({
)}
{s.label}
</button>
- </li>
+ </div>
))}
- </ul>
+ </div>
)}
</div>
);
diff --git a/client/src/components/agents/tabs/ToolsTab.jsx b/client/src/components/agents/tabs/ToolsTab.jsx
index 7ada3f9e97..18fa1202d5 100644
--- a/client/src/components/agents/tabs/ToolsTab.jsx
+++ b/client/src/components/agents/tabs/ToolsTab.jsx
@@ -4,7 +4,7 @@ import * as api from '../../../services/api';
import BrailleSpinner from '../../BrailleSpinner';
import { useCooldownTick } from '../../../hooks/useCooldownTick';
import { formatCooldown, formatDateTime } from '../../../utils/formatters';
-import { clickableProps } from '../../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard.js';
export default function ToolsTab({ agentId, agent }) {
const [selectedAccountId, setSelectedAccountId] = useState('');
@@ -416,6 +416,7 @@ export default function ToolsTab({ agentId, agent }) {
}`}
onClick={() => handleViewPost(post)}
{...clickableProps(() => handleViewPost(post))}
+ onKeyDown={onActivateKeyDown(() => handleViewPost(post))}
>
<div className="flex items-start justify-between">
<div className="flex-1 min-w-0">
@@ -656,7 +657,12 @@ export default function ToolsTab({ agentId, agent }) {
}`}
>
<div className="flex items-start justify-between">
- <div className="flex-1 min-w-0 cursor-pointer" onClick={() => !isPublished && handleLoadDraft(draft)} {...clickableProps(() => handleLoadDraft(draft), { disabled: isPublished })}>
+ <div
+ className="flex-1 min-w-0 cursor-pointer"
+ onClick={() => !isPublished && handleLoadDraft(draft)}
+ {...clickableProps(() => handleLoadDraft(draft), { disabled: isPublished })}
+ onKeyDown={isPublished ? undefined : onActivateKeyDown(() => handleLoadDraft(draft))}
+ >
<div className="flex items-center gap-2">
<span className={`text-xs px-1.5 py-0.5 rounded ${isPublished ? 'bg-port-success/20 text-port-success' : 'bg-port-accent/20 text-port-accent'}`}>
{isPublished ? 'published' : draft.type}
@@ -720,6 +726,7 @@ export default function ToolsTab({ agentId, agent }) {
}`}
onClick={() => setReplyToId(replyToId === comment.id ? null : comment.id)}
{...clickableProps(() => setReplyToId(replyToId === comment.id ? null : comment.id))}
+ onKeyDown={onActivateKeyDown(() => setReplyToId(replyToId === comment.id ? null : comment.id))}
>
<span className="text-port-accent">{(typeof comment.author === 'object' ? comment.author?.name : comment.author) || 'anon'}</span>
<span className="text-gray-500">: {comment.content?.substring(0, 150)}</span>
diff --git a/client/src/components/brain/tabs/NotesTab.jsx b/client/src/components/brain/tabs/NotesTab.jsx
index ecc49ee451..873b180045 100644
--- a/client/src/components/brain/tabs/NotesTab.jsx
+++ b/client/src/components/brain/tabs/NotesTab.jsx
@@ -26,7 +26,7 @@ import { timeAgo, formatBytes, formatCount } from '../../../utils/formatters';
import { useConfirmDelete } from '../../../hooks/useConfirmDelete';
import { useNoteSave } from '../../../hooks/useNoteSave.js';
import useUrlParams from '../../../hooks/useUrlParams';
-import { clickableProps } from '../../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard.js';
import OfflineNotesNotice from '../../OfflineNotesNotice.jsx';
import ForceSaveNoteRow from '../../ForceSaveNoteRow.jsx';
@@ -612,6 +612,7 @@ export default function NotesTab() {
className="px-1.5 py-0.5 rounded text-xs bg-port-accent/20 text-port-accent cursor-pointer hover:bg-port-accent/30"
onClick={() => { setSearchInput(`#${t.tag}`); handleSearch(`#${t.tag}`); }}
{...clickableProps(() => { setSearchInput(`#${t.tag}`); handleSearch(`#${t.tag}`); })}
+ onKeyDown={onActivateKeyDown(() => { setSearchInput(`#${t.tag}`); handleSearch(`#${t.tag}`); })}
>
#{t.tag} <span className="text-gray-500">{t.count}</span>
</span>
diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsx
index f01568d2e9..69f34ff134 100644
--- a/client/src/components/cos/TaskAddForm.jsx
+++ b/client/src/components/cos/TaskAddForm.jsx
@@ -12,7 +12,7 @@ import { formatBytes } from '../../utils/formatters';
import { effortAwareModelOptions, effortSurvivingModel, isTuiProvider, isCliProvider, isProcessProvider, isCodexProvider, isCodexSubscriptionProvider, isOpencodeLocalProvider, generationControlsFor, providerModeSelectionPolicy, seedModelEffort, resolveProviderModelOptions, MODEL_SOURCE } from '../../utils/providers';
import { isCompositeProviderId } from '../../utils/providerRef';
import { DEFAULT_PR_COMPLETION, DEFAULT_REVIEWERS, DEFAULT_REVIEW_STOP_MODE, PR_COMPLETION_OPTIONS, prCompletionOption } from './constants';
-import { clickableProps } from '../../lib/a11yKeyboard';
+import { clickableProps, onActivateKeyDown } from '../../lib/a11yKeyboard';
import { slashdoLabel } from '../../lib/slashdoCatalog';
import ReviewerPicker from './ReviewerPicker';
import InstancePicker from './InstancePicker';
@@ -1015,6 +1015,7 @@ export default function TaskAddForm({ providers, providersLoaded = true, apps, o
key={template.id}
onClick={() => applyTemplate(template)}
{...clickableProps(() => applyTemplate(template))}
+ onKeyDown={onActivateKeyDown(() => applyTemplate(template))}
className="group relative flex items-center gap-1.5 px-3 py-1.5 bg-port-card border border-port-border rounded-lg text-sm text-gray-300 hover:text-white hover:border-port-accent/50 transition-colors cursor-pointer"
title={template.slashdoCommand ? `${slashdoLabel(template.slashdoCommand)} \u2014 ${template.context || template.description}` : template.description}
>
diff --git a/client/src/components/cos/tabs/RunsTab.jsx b/client/src/components/cos/tabs/RunsTab.jsx
index b267d2d5e2..ffb953bede 100644
--- a/client/src/components/cos/tabs/RunsTab.jsx
+++ b/client/src/components/cos/tabs/RunsTab.jsx
@@ -7,7 +7,7 @@ import BrailleSpinner from '../../BrailleSpinner';
import Banner from '../../ui/Banner';
import ProcessLogModal from '../../ui/ProcessLogModal';
import { writeClipboardSilently } from '../../../lib/clipboard';
-import { clickableProps } from '../../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard.js';
// Map an AI run's source to the PM2 process whose system log holds the full
// context for that run. CoS-agent runs are driven by the `portos-cos` process;
@@ -273,6 +273,7 @@ export default function RunsTab() {
className="p-3 sm:p-4 hover:bg-port-border/20 cursor-pointer group"
onClick={() => toggleExpand(run.id)}
{...clickableProps(() => toggleExpand(run.id))}
+ onKeyDown={onActivateKeyDown(() => toggleExpand(run.id))}
data-testid={`run-row-${run.id}`}
>
<div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">
diff --git a/client/src/components/digital-twin/tabs/OverviewTab.jsx b/client/src/components/digital-twin/tabs/OverviewTab.jsx
index 86a54fd028..dac54da13f 100644
--- a/client/src/components/digital-twin/tabs/OverviewTab.jsx
+++ b/client/src/components/digital-twin/tabs/OverviewTab.jsx
@@ -25,7 +25,7 @@ import {
getHealthLabel
} from '../constants';
import { timeAgo } from '../../../utils/formatters';
-import { clickableProps } from '../../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard.js';
import SoulWizard from '../SoulWizard';
import PersonalityMap from '../PersonalityMap';
import ConfidenceGauge from '../ConfidenceGauge';
@@ -503,6 +503,7 @@ export default function OverviewTab({ status, settings, onRefresh }) {
className={`p-4 rounded-lg border ${config.color} cursor-pointer hover:opacity-80 transition-opacity`}
onClick={() => navigate('/digital-twin/documents')}
{...clickableProps(() => navigate('/digital-twin/documents'))}
+ onKeyDown={onActivateKeyDown(() => navigate('/digital-twin/documents'))}
>
<div className="flex items-center gap-2 mb-2">
<Icon size={16} />
diff --git a/client/src/components/goals/GoalsListView.jsx b/client/src/components/goals/GoalsListView.jsx
index 4c8a0f7c07..f3ffbe8a81 100644
--- a/client/src/components/goals/GoalsListView.jsx
+++ b/client/src/components/goals/GoalsListView.jsx
@@ -14,7 +14,7 @@ import EmptyState from '../EmptyState';
import useProviderModels from '../../hooks/useProviderModels';
import ProviderModelSelector from '../ProviderModelSelector';
import { enabledApiProviderFilter } from '../../utils/providers';
-import { clickableProps } from '../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../lib/a11yKeyboard.js';
// Arrow keys step row-to-row through the tree instead of nudging the drag 25px
// at a time. The dragged goal's own row is skipped: it IS a drop target (every
@@ -83,6 +83,7 @@ function GoalRow({ goal, depth, expandedIds, onToggle, onSelect, selectedId, onA
style={{ paddingLeft: `${depth * 20 + 8}px` }}
onClick={() => onSelect(goal)}
{...clickableProps(() => onSelect(goal))}
+ onKeyDown={onActivateKeyDown(() => onSelect(goal))}
>
{/* dnd-kit's `attributes` make this a focusable role="button", so it
needs a name of its own — otherwise it is announced as an unlabeled
@@ -93,6 +94,7 @@ function GoalRow({ goal, depth, expandedIds, onToggle, onSelect, selectedId, onA
{...attributes}
{...listeners}
onClick={e => e.stopPropagation()}
+ onKeyDown={e => { listeners?.onKeyDown?.(e); e.stopPropagation(); }}
>
<GripVertical className="w-3.5 h-3.5 text-gray-600 hover:text-gray-400" />
</div>
diff --git a/client/src/components/meatspace/post/ElementsSong.jsx b/client/src/components/meatspace/post/ElementsSong.jsx
index 1052b44a9e..e783cb2094 100644
--- a/client/src/components/meatspace/post/ElementsSong.jsx
+++ b/client/src/components/meatspace/post/ElementsSong.jsx
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
import { ChevronLeft, ChevronRight, BookOpen, Zap, Target, Check, X, SkipForward, Loader, Search, Eye, BarChart3, Gauge, Layers, RotateCw, ShieldCheck } from 'lucide-react';
import { submitMemoryPractice, getMemoryMastery, getMemoryItem, attestMemoryMastery } from '../../../services/api';
import { RapidReaderModal } from '../../RapidReader';
-import { clickableProps } from '../../../lib/a11yKeyboard';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard';
import PostCompletionActions from './PostCompletionActions';
// Standard periodic table layout: [row][col] = symbol or null
@@ -402,6 +402,7 @@ function ElementsSongMain({ item, mastery, onSelectMode, onBack, onAttestMastery
onMouseLeave={() => { setHoveredElement(null); setHoverPos(null); }}
onClick={() => setSelectedElement(prev => prev === sym ? null : sym)}
{...clickableProps(() => setSelectedElement(prev => prev === sym ? null : sym))}
+ onKeyDown={onActivateKeyDown(() => setSelectedElement(prev => prev === sym ? null : sym))}
>
{atomicNum && <span className="text-[7px] leading-none opacity-50 absolute top-0.5 left-1">{atomicNum}</span>}
<span className="text-[10px] leading-none font-semibold">{sym}</span>
diff --git a/client/src/components/meatspace/tabs/OverviewTab.jsx b/client/src/components/meatspace/tabs/OverviewTab.jsx
index 8f218d59ca..819c55b96a 100644
--- a/client/src/components/meatspace/tabs/OverviewTab.jsx
+++ b/client/src/components/meatspace/tabs/OverviewTab.jsx
@@ -6,7 +6,7 @@ import BrailleSpinner from '../../BrailleSpinner';
import DeathClockCountdown from '../../DeathClockCountdown';
import ProvenanceChip from '../../ui/ProvenanceChip';
import { useAutoRefetch } from '../../../hooks/useAutoRefetch';
-import { clickableProps } from '../../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard.js';
import { formatWeight, formatPercent, formatDateShort, formatCount } from '../../../utils/formatters';
function HealthTile({ icon: Icon, iconColor, label, metrics, onClick }) {
@@ -14,6 +14,7 @@ function HealthTile({ icon: Icon, iconColor, label, metrics, onClick }) {
<div
onClick={onClick}
{...(onClick ? clickableProps(onClick) : {})}
+ onKeyDown={onClick ? onActivateKeyDown(onClick) : undefined}
className={`bg-port-card border border-port-border rounded-lg p-3 ${
onClick ? 'cursor-pointer hover:border-port-accent/50 transition-colors' : ''
}`}
diff --git a/client/src/components/media/CollectionPickerShell.jsx b/client/src/components/media/CollectionPickerShell.jsx
index f4e57a81c8..bb1c7497b4 100644
--- a/client/src/components/media/CollectionPickerShell.jsx
+++ b/client/src/components/media/CollectionPickerShell.jsx
@@ -213,6 +213,12 @@ export default function CollectionPickerShell({
visibility: style ? 'visible' : 'hidden',
}}
onClick={(e) => e.stopPropagation()}
+ // Same containment as the click handler above — a keystroke that
+ // reaches here already came through a focused control inside the
+ // popover (search input, form, toggle buttons), so it must not bubble
+ // to an ancestor either. Escape is excepted so `useEscapeKey`'s
+ // `window` listener still sees it and closes the popover.
+ onKeyDown={(e) => { if (e.key !== 'Escape') e.stopPropagation(); }}
>
{title && (
<div className="text-[10px] text-gray-500 uppercase tracking-wide px-1 pt-1 pb-1.5 shrink-0">{title}</div>
diff --git a/client/src/components/media/MediaLightbox.jsx b/client/src/components/media/MediaLightbox.jsx
index 5e8af7fbc2..2381acfa85 100644
--- a/client/src/components/media/MediaLightbox.jsx
+++ b/client/src/components/media/MediaLightbox.jsx
@@ -11,7 +11,7 @@ import PinToMoodBoardMenu from './PinToMoodBoardMenu';
import MediaImage from '../MediaImage';
import { useScrollLock } from '../../hooks/useScrollLock';
import { useSwipeNav } from '../../hooks/useSwipeNav';
-import { isEditableTarget } from '../../lib/a11yKeyboard';
+import { isEditableTarget, onActivateKeyDown } from '../../lib/a11yKeyboard';
import { i2vReferenceModeLabel } from '../../lib/videoReferenceModes';
import useFocusTrap from '../../hooks/useFocusTrap.js';
import { copyToClipboard } from '../../lib/clipboard';
@@ -319,6 +319,13 @@ export default function MediaLightbox({
aria-label={`Media viewer — ${item.filename || item.key || 'item'}`}
className={`fixed inset-0 z-50 bg-black/90 flex items-center justify-center ${overlayPad}`}
onClick={onClose}
+ // The backdrop itself carries no tabIndex (it isn't a tab stop) and its
+ // real keyboard equivalent — Escape — is already handled by the
+ // window-level listener above, which also respects the refine/prompt-
+ // from/fullscreen precedence. `onActivateKeyDown`'s currentTarget guard
+ // makes this a no-op for a bubbled keydown from a focused descendant
+ // (button, input) and only fires if this div itself were ever focused.
+ onKeyDown={onActivateKeyDown(onClose)}
>
{hasPrevious && (
<button
@@ -596,7 +603,15 @@ function SettingsPane({
return () => clearTimeout(handle);
}, [saveStatus]);
return (
- <aside className={asideClasses} onClick={(e) => e.stopPropagation()}>
+ <aside
+ className={asideClasses}
+ onClick={(e) => e.stopPropagation()}
+ // Same containment, minus Escape: a keystroke from a focused control in
+ // this sidebar (an annotation field, a toggle) must not bubble to the
+ // overlay's onClick={onClose}, but Escape still needs to reach the
+ // window-level listener that owns close-precedence.
+ onKeyDown={(e) => { if (e.key !== 'Escape') e.stopPropagation(); }}
+ >
<header className="flex items-center justify-between p-3 border-b border-port-border">
<span className="text-xs uppercase tracking-wide text-gray-400">{isVideo ? 'Video' : 'Image'} settings</span>
<div className="flex items-center gap-2">
diff --git a/client/src/components/media/VideoTimelineLanes.jsx b/client/src/components/media/VideoTimelineLanes.jsx
index 9e8db483cb..4e839db79e 100644
--- a/client/src/components/media/VideoTimelineLanes.jsx
+++ b/client/src/components/media/VideoTimelineLanes.jsx
@@ -12,7 +12,7 @@ import { memo, useEffect, useRef } from 'react';
import { useSortable } from '@dnd-kit/sortable';
import { X, Film, Plus, Music } from 'lucide-react';
import { dndTransformToCss } from '../../lib/dndTransform';
-import { clickableProps } from '../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../lib/a11yKeyboard.js';
import { assetUrl, segmentDuration } from '../../lib/videoTimelineModel';
const segmentLabel = (segment, meta) => {
@@ -148,6 +148,7 @@ export const LaneBlock = memo(function LaneBlock({
}`}
onClick={() => onSelect(entry._key)}
{...clickableProps(() => onSelect(entry._key))}
+ onKeyDown={onActivateKeyDown(() => onSelect(entry._key))}
>
<span className={`absolute top-0.5 text-[9px] text-white truncate pointer-events-none ${showRemove ? 'left-1 right-7' : 'inset-x-1'}`}>
{isMissing ? '(missing)' : label}
diff --git a/client/src/components/messages/beeper/BeeperPersonPicker.jsx b/client/src/components/messages/beeper/BeeperPersonPicker.jsx
index 09ca3302d2..ef64d2db1c 100644
--- a/client/src/components/messages/beeper/BeeperPersonPicker.jsx
+++ b/client/src/components/messages/beeper/BeeperPersonPicker.jsx
@@ -151,7 +151,7 @@ export default function BeeperPersonPicker({
/>
</div>
{open && createPortal(
- <ul
+ <div
ref={listRef}
id={listboxId}
role="listbox"
@@ -171,14 +171,18 @@ export default function BeeperPersonPicker({
}}
>
{matches.length === 0 && (
- <li className="px-2 py-1 text-[11px] text-gray-500">No matches</li>
+ <div className="px-2 py-1 text-[11px] text-gray-500">No matches</div>
)}
{matches.map((person, index) => (
- <li
+ <div
key={person.id}
id={optionId(index)}
role="option"
aria-selected={index === activeIndex}
+ // Virtually focused via the input's `aria-activedescendant`
+ // (WAI-ARIA combobox pattern), not individually tabbable;
+ // tabIndex={-1} keeps it programmatically focusable.
+ tabIndex={-1}
// `onMouseDown` with `preventDefault`, not `onClick`: a click
// fires AFTER the input's own `onBlur`, which would have
// already closed (and unmounted) this list.
@@ -188,12 +192,13 @@ export default function BeeperPersonPicker({
}`}
>
{person.name}
- </li>
+ </div>
))}
- <li
+ <div
id={optionId(createNewIndex)}
role="option"
aria-selected={createNewIndex === activeIndex}
+ tabIndex={-1}
onMouseDown={(event) => { event.preventDefault(); selectRow(createNewIndex); }}
className={`flex items-center gap-1 border-t border-port-border/60 px-2 py-1 text-[11px] ${
createNewIndex === activeIndex ? 'bg-port-accent/20 text-white' : 'text-gray-300'
@@ -201,8 +206,8 @@ export default function BeeperPersonPicker({
>
<UserPlus size={10} aria-hidden="true" />
Create new…
- </li>
- </ul>,
+ </div>
+ </div>,
document.body,
)}
</div>
diff --git a/client/src/components/pipeline/manuscript/ManuscriptReadAloud.jsx b/client/src/components/pipeline/manuscript/ManuscriptReadAloud.jsx
index f474c91283..3ceb664be7 100644
--- a/client/src/components/pipeline/manuscript/ManuscriptReadAloud.jsx
+++ b/client/src/components/pipeline/manuscript/ManuscriptReadAloud.jsx
@@ -26,7 +26,7 @@ import ProgressBar from '../../ui/ProgressBar';
import { formatDurationMs } from '../../../utils/formatters';
import { narratePipelineProse } from '../../../services/api';
import { STAGE_LABEL } from './constants';
-import { clickableProps } from '../../../lib/a11yKeyboard';
+import { clickableProps, onActivateKeyDown } from '../../../lib/a11yKeyboard';
import { safeReadStorage, safeWriteStorage } from '../../../lib/safeStorage';
import useMounted from '../../../hooks/useMounted';
@@ -200,6 +200,7 @@ export default function ManuscriptReadAloud({ open, onClose, section }) {
key={`seg-${seg.index}`}
{...clickableProps(() => jumpTo(seg.index))}
onClick={() => jumpTo(seg.index)}
+ onKeyDown={onActivateKeyDown(() => jumpTo(seg.index))}
title={hard ? `Hard to say: ${reasons.join('; ')}` : undefined}
className={[
'cursor-pointer rounded transition-colors',
diff --git a/client/src/components/shell/ShellSessionTabs.jsx b/client/src/components/shell/ShellSessionTabs.jsx
index c2a290f47f..3f24d9221a 100644
--- a/client/src/components/shell/ShellSessionTabs.jsx
+++ b/client/src/components/shell/ShellSessionTabs.jsx
@@ -1,6 +1,6 @@
import { Plus, X, Terminal as TerminalIcon, Bot } from 'lucide-react';
import { formatDurationMs } from '../../utils/formatters';
-import { clickableProps } from '../../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../../lib/a11yKeyboard.js';
const shortId = (id) => id?.slice(0, 6) ?? '';
@@ -47,6 +47,7 @@ export default function ShellSessionTabs({ sessions, activeSessionId, onSwitch,
}`}
onClick={() => !isActive && onSwitch(s.sessionId)}
{...clickableProps(() => !isActive && onSwitch(s.sessionId))}
+ onKeyDown={onActivateKeyDown(() => !isActive && onSwitch(s.sessionId))}
title={title}
>
<TabIcon size={12} className="shrink-0" />
diff --git a/client/src/components/songs/PianoRoll.jsx b/client/src/components/songs/PianoRoll.jsx
index b048c8003c..17542a3bcd 100644
--- a/client/src/components/songs/PianoRoll.jsx
+++ b/client/src/components/songs/PianoRoll.jsx
@@ -185,11 +185,20 @@ export default function PianoRoll({ parts, tempo, getPosition, playing, height =
return (
<div ref={wrapRef} className="w-full">
- {/* Background comes from ROLL_BG, not a theme token — see canvasRoll.js. */}
- <canvas ref={canvasRef} className="block w-full rounded-lg" style={{ backgroundColor: ROLL_BG }} aria-hidden="true" />
- <p className="sr-only">
- Piano-roll visualization of the selected song layers falling onto a piano keyboard.
- </p>
+ {/* Background comes from ROLL_BG, not a theme token — see canvasRoll.js.
+ `role="img"` + `aria-label` (rather than `aria-hidden` + a separate
+ sr-only paragraph) gives the canvas one accessible name directly —
+ `aria-hidden` on a non-focusable decorative canvas is harmless in
+ practice, but pairing it with a sighted-only visualization still
+ reads as "hide this, but here's a substitute" to a screen reader,
+ which `role="img"` states more directly. */}
+ <canvas
+ ref={canvasRef}
+ className="block w-full rounded-lg"
+ style={{ backgroundColor: ROLL_BG }}
+ role="img"
+ aria-label="Piano-roll visualization of the selected song layers falling onto a piano keyboard."
+ />
</div>
);
}
diff --git a/client/src/components/sprites/SpriteSearch.jsx b/client/src/components/sprites/SpriteSearch.jsx
index 58f0d0d009..ffa1e23962 100644
--- a/client/src/components/sprites/SpriteSearch.jsx
+++ b/client/src/components/sprites/SpriteSearch.jsx
@@ -77,20 +77,23 @@ export default function SpriteSearch({ records, onSelect }) {
className="w-full bg-port-bg border border-port-border rounded pl-8 pr-3 py-1.5 text-sm text-white"
/>
{showSuggestions && (
- <ul
+ <div
id={listId}
role="listbox"
aria-label="Matching sprites"
className="absolute z-30 mt-1 w-full max-h-72 overflow-y-auto bg-port-card border border-port-border rounded-lg shadow-lg"
>
{suggestions.length === 0 ? (
- <li className="px-3 py-2 text-xs text-gray-500">No matches</li>
+ <div className="px-3 py-2 text-xs text-gray-500">No matches</div>
) : suggestions.map((r, i) => {
const Icon = groupIconForKind(r.kind);
return (
- <li key={r.id} id={`sprite-opt-${r.id}`} role="option" aria-selected={i === activeIndex}>
+ <div key={r.id}>
<button
type="button"
+ id={`sprite-opt-${r.id}`}
+ role="option"
+ aria-selected={i === activeIndex}
onClick={() => commit(r)}
onMouseEnter={() => setActiveIndex(i)}
className={`w-full flex items-center gap-2 text-left px-3 py-2 text-sm ${i === activeIndex ? 'bg-port-accent/20 text-white' : 'text-gray-300 hover:bg-port-bg'}`}
@@ -99,10 +102,10 @@ export default function SpriteSearch({ records, onSelect }) {
<span className="font-medium truncate">{r.name}</span>
<span className="ml-auto text-xs text-gray-500 shrink-0">{r.kind}</span>
</button>
- </li>
+ </div>
);
})}
- </ul>
+ </div>
)}
</div>
);
diff --git a/client/src/components/ui/CopyableId.test.jsx b/client/src/components/ui/CopyableId.test.jsx
index ac532b4c02..e42fdb0e8f 100644
--- a/client/src/components/ui/CopyableId.test.jsx
+++ b/client/src/components/ui/CopyableId.test.jsx
@@ -40,7 +40,10 @@ describe('CopyableId', () => {
it('stops click propagation so it does not trigger row handlers', () => {
const onRowClick = vi.fn();
render(
- <div onClick={onRowClick}>
+ // Stands in for a real clickable row (e.g. HistoryPage's history row,
+ // which uses `clickableProps`/`onActivateKeyDown` for real) — this test
+ // only exercises click containment, so mirror that same keyboard prop.
+ <div onClick={onRowClick} onKeyDown={onRowClick}>
<CopyableId id="abcdef1234567890" />
</div>
);
diff --git a/client/src/components/ui/Modal.jsx b/client/src/components/ui/Modal.jsx
index 87070f78be..10b693cd26 100644
--- a/client/src/components/ui/Modal.jsx
+++ b/client/src/components/ui/Modal.jsx
@@ -351,6 +351,11 @@ export default function Modal({
// matches the original hand-rolled modals' behavior so the refactor
// stays 1:1.
onClick={(e) => e.stopPropagation()}
+ // Same swallow, minus Escape: `handleGlobalEsc` above is a
+ // `document`-level listener (native bubbling, not React's), and it
+ // already owns stack-aware precedence for nested modals — a keydown
+ // stopPropagation here would keep Escape from ever reaching it.
+ onKeyDown={(e) => { if (e.key !== 'Escape') e.stopPropagation(); }}
>
{children}
</div>
diff --git a/client/src/pages/CharacterSheet.jsx b/client/src/pages/CharacterSheet.jsx
index e070d5fcc7..0f6e3b3bc0 100644
--- a/client/src/pages/CharacterSheet.jsx
+++ b/client/src/pages/CharacterSheet.jsx
@@ -12,7 +12,7 @@ import toast from '../components/ui/Toast';
import { timeAgo, formatCompactCount, formatCount } from '../utils/formatters';
import api, { generateAvatar } from '../services/api';
import socket from '../services/socket';
-import { clickableProps } from '../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../lib/a11yKeyboard.js';
// Silent by default — every caller owns its own error UI (a catch-block toast,
// or the loadError banner in load()), so the request() helper must not also
@@ -531,6 +531,7 @@ export default function CharacterSheet() {
<span
onClick={() => setEditingClass(true)}
{...clickableProps(() => setEditingClass(true))}
+ onKeyDown={onActivateKeyDown(() => setEditingClass(true))}
className="text-sm text-gray-400 cursor-pointer hover:text-port-accent transition-colors"
title="Click to edit your title"
>
diff --git a/client/src/pages/HistoryPage.jsx b/client/src/pages/HistoryPage.jsx
index 7706cbdb61..2151d8b9e6 100644
--- a/client/src/pages/HistoryPage.jsx
+++ b/client/src/pages/HistoryPage.jsx
@@ -4,7 +4,7 @@ import * as api from '../services/api';
import { formatTime, formatRuntime, formatDateTime } from '../utils/formatters';
import PageSkeleton from '../components/ui/PageSkeleton';
import Banner from '../components/ui/Banner';
-import { clickableProps } from '../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../lib/a11yKeyboard.js';
export function HistoryPage() {
const [history, setHistory] = useState([]);
@@ -173,6 +173,7 @@ export function HistoryPage() {
className="p-3 sm:p-4 hover:bg-port-border/20 cursor-pointer group"
onClick={() => toggleExpand(entry.id)}
{...clickableProps(() => toggleExpand(entry.id))}
+ onKeyDown={onActivateKeyDown(() => toggleExpand(entry.id))}
>
<div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">
<div className="flex items-center gap-3 flex-1 min-w-0">
diff --git a/client/src/pages/Loops.jsx b/client/src/pages/Loops.jsx
index 942d21fe7c..0fcdfc9c5c 100644
--- a/client/src/pages/Loops.jsx
+++ b/client/src/pages/Loops.jsx
@@ -12,7 +12,7 @@ import { formatCount, formatDurationMs } from '../utils/formatters';
import BrailleSpinner from '../components/BrailleSpinner';
import { useAutoRefetch } from '../hooks/useAutoRefetch';
import { useSocketSubscription } from '../hooks/useSocketSubscription';
-import { clickableProps } from '../lib/a11yKeyboard.js';
+import { clickableProps, onActivateKeyDown } from '../lib/a11yKeyboard.js';
import EmptyState from '../components/EmptyState';
import ProviderModelSelector from '../components/ProviderModelSelector';
@@ -233,6 +233,7 @@ function LoopCard({ loop, onAction, expandedId, onToggle }) {
className="flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-port-bg/50"
onClick={() => onToggle(loop.id)}
{...clickableProps(() => onToggle(loop.id))}
+ onKeyDown={onActivateKeyDown(() => onToggle(loop.id))}
>
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2">
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 117b4c69b9..803bde385b 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -1,6 +1,6 @@
{
"DEFAULT_TASK_PROMPTS": {
- "accessibility": "762506421c793074d172d3eb794fe866",
+ "accessibility": "46f628a44a919bb788de8761e86ca0e1",
"api-contract": "cf02b10a5993baf473e0d320771f26b6",
"better-cognitive-load": "a1fe22f6ef936131456c55a6b0623204",
"better-complexity": "c99f67b43ff54a1c8cf0176c721d9c06",
@@ -55,7 +55,7 @@
"ux": "b8c0bde4075685625443a405b2c70b50"
},
"PROMPT_VERSIONS": {
- "accessibility": 4,
+ "accessibility": 5,
"api-contract": 1,
"better-cognitive-load": 1,
"better-complexity": 2,
@@ -110,7 +110,8 @@
"ce7377d0ac57cbf0526074cfb95e3803",
"b07cfe1e367411036ef1d4cc4b6e9d2e",
"372916803f32b82da38a5b2130a54baf",
- "76cfcab471c1a555767b71b8b9932ae0"
+ "76cfcab471c1a555767b71b8b9932ae0",
+ "762506421c793074d172d3eb794fe866"
],
"better-complexity": [
"c92b99080d0453d70bb26a412fb48ce9"
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index 8fc4d4b54f..05bca77fc5 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -361,22 +361,26 @@ Check for a JSX/TSX a11y linter already wired into the project (e.g. Biome's
\`a11y\` rule group, \`eslint-plugin-jsx-a11y\`) before you start, and run it if
one exists. Do NOT re-derive or file findings that linter already catches
deterministically on every commit — missing \`alt\`/labels, invalid or
-unsupported ARIA props/roles, an unlabeled form control. Spend your budget on
-what only a live agent driving the running interface can establish.
+unsupported ARIA props/roles, an unlabeled form control, a clickable element
+with no keyboard handler, a non-interactive element given an interactive ARIA
+role, an interactive role that isn't focusable, or \`aria-hidden="true"\` on a
+focusable element. Spend your budget on what only a live agent driving the
+running interface can establish.
## Hunt for
-- **Keyboard traps and unreachable controls** — an interactive element that
- cannot be reached or activated by keyboard, a custom control with no key
- handling, a dialog that does not trap and restore focus.
+- **Keyboard traps and unreachable controls** — a custom control the linter
+ above can't see is missing (e.g. one built without a native/ARIA element at
+ all), a dialog that does not trap and restore focus, or a genuinely
+ unreachable path a static scan of individual elements can't catch.
- **Missing focus indication** — a focus style removed and never replaced, so
keyboard users cannot tell where they are.
- **Images and media without text alternatives** — a meaningful image with no
description, or a decorative one announced as content — when the linter
above doesn't already cover this project's markup.
-- **Semantics faked with generic elements** — a clickable element that is not a
- button or link, a heading order that skips levels, a list that is not marked
- up as one, a table without headers.
+- **Semantics faked with generic elements** — a heading order that skips
+ levels, a list that is not marked up as one, a table without headers, or a
+ faked-semantics case the linter's element-vs-role rules don't cover.
- **Dynamic changes nobody is told about** — an async result, validation error,
or toast that appears with no live region, so a screen-reader user never
learns it happened.
diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.js
index 460f5b907f..cdf9366996 100644
--- a/server/services/taskPromptDefaults/versions.js
+++ b/server/services/taskPromptDefaults/versions.js
@@ -37,7 +37,7 @@ export const PROMPT_VERSIONS = {
'code-quality': 4, // v4: hands generated-artifact/hand-synced-registry/layout-coupling drift to the better-structural-drift lane and counted branching + reader cost to better-complexity / better-cognitive-load, keeping conventional maintainability defects — the split the sibling do:better lenses made possible. Previously v3: inventory structural drift, duplicate sources of truth, volatile generated artifacts, and incidental-layout coupling before conventional maintainability checks. v2: generic {appName} body (older default hardcoded "PortOS")
'test-coverage': 3, // v3: carries {modeInstructions}, ranks gaps by consequence rather than percentage, tests at the highest practical public boundary, requires naming the regression a new test uniquely catches, and hands existing-test quality to better-test-quality. Previously v2: generic {appName} body (older default hardcoded "PortOS")
'performance': 4, // v4: requires UI route-load, idle-network and large-collection evidence; missing measurements are explicitly unverified.
- 'accessibility': 4, // v4: checks for an existing JSX a11y linter (Biome's a11y group, jsx-a11y) first and skips findings it already catches deterministically (missing alt/labels, invalid/unsupported ARIA), so the live-agent budget goes to keyboard/focus/live-region/contrast/zoom issues static analysis can't establish. Previously v3: carries {modeInstructions}, names who is blocked and how far they get, and prefers a native element over a custom control with patched attributes. Previously v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)
+ 'accessibility': 5, // v5: the "skip what static analysis already covers" list now also names keyboard-trap/unreachable-control and faked-semantics findings, matching Biome's `useKeyWithClickEvents`, `noNoninteractiveElementToInteractiveRole`, `useFocusableInteractive`, and `noAriaHiddenOnFocusable` a11y rules (enabled in `client/biome.jsonc` alongside the four from v4) — the live-agent budget shifts further to focus-order/live-region/contrast/zoom issues static analysis still can't establish. Previously v4: checks for an existing JSX a11y linter (Biome's a11y group, jsx-a11y) first and skips findings it already catches deterministically (missing alt/labels, invalid/unsupported ARIA), so the live-agent budget goes to keyboard/focus/live-region/contrast/zoom issues static analysis can't establish. Previously v3: carries {modeInstructions}, names who is blocked and how far they get, and prefers a native element over a custom control with patched attributes. Previously v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)
'console-errors': 4, // v4: refer to framework-neutral UI lifecycle audit. v3: carries {modeInstructions}, collects real emitted output before diagnosing, groups duplicates by cause, and forbids "fixing" an error by suppressing it. Previously v2: unified `[Improvement: {appName}]` body (pre-unification defaults shipped separate self- and app-improvement bodies)
'error-handling': 3, // v3: carries {modeInstructions} and covers resilience (timeouts, retry ceilings, degraded-dependency fallback, cleanup on the error path, actionable user-facing text) while handing swallowed errors and log context to observability. Previously v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)
'typing': 3, // v3: carries {modeInstructions}, exits cleanly on an untyped project, and targets boundary escape hatches and validator/type disagreement instead of a mechanical annotation sweep. Previously v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)