mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 16:02:24 +00:00
fix(native-chat): give the reconnect row's provider icon an accessible name
Every row rendered the provider as a bare AgentIcon, whose svg carries no
aria-label, title or alt. With a Claude chat and a Codex chat in one worktree the
two rows were identical to any non-visual consumer, and the dialog offered
several identically-named "Reconnect" buttons with nothing to tell them apart.
A regression from 233e37b2bd, where the row read `${agent} · ${workspace} · …` as
text. Moving the workspace name into the group heading was right; dropping the
provider to an unlabelled glyph is what lost the information.
AgentIcon takes no label prop, so the icon is wrapped the way
NativeChatSupportedAgents already names it: a span with role="img" and an
aria-label from formatAgentTypeLabel, the same labeller the sidebar and dashboard
rows use.
The per-row button also names its agent now ("Reconnect Claude chat"). The
identical buttons were half the reported harm, and an accessible name that opens
with the visible word keeps WCAG 2.5.3 satisfied. Say so if you would rather ship
only the icon label -- it is one attribute and one catalog key to drop.
Age code untouched, as asked: formatShortTimeAgo still takes (timestamp, now) and
is still called with (recordedAt, listedAt).
This commit is contained in:
@@ -3,7 +3,7 @@ import { Button } from './ui/button'
|
||||
import { RepoIconGlyph } from '@/components/repo/repo-icon'
|
||||
import { CompactAgentExpansion } from '@/components/sidebar/worktree-card-compact-agents'
|
||||
import { AgentIcon } from '@/lib/agent-catalog'
|
||||
import { agentTypeToIconAgent } from '@/lib/agent-status'
|
||||
import { agentTypeToIconAgent, formatAgentTypeLabel } from '@/lib/agent-status'
|
||||
import { formatShortTimeAgo } from '@/lib/short-time-ago'
|
||||
import { translate } from '@/i18n/i18n'
|
||||
import { useAppStore } from '../store'
|
||||
@@ -69,9 +69,14 @@ function ResumeCandidateRow({
|
||||
busy: boolean
|
||||
onReconnect: () => void
|
||||
}): React.JSX.Element {
|
||||
const agentLabel = formatAgentTypeLabel(candidate.agent)
|
||||
return (
|
||||
<li className="flex items-center gap-2 py-0.5">
|
||||
<AgentIcon agent={agentTypeToIconAgent(candidate.agent)} size={14} />
|
||||
{/* AgentIcon carries no label of its own, so the provider was invisible to assistive tech and
|
||||
two rows in one worktree read identically. Named the way NativeChatSupportedAgents does. */}
|
||||
<span role="img" aria-label={agentLabel} className="inline-flex shrink-0">
|
||||
<AgentIcon agent={agentTypeToIconAgent(candidate.agent)} size={14} />
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-xs font-medium">
|
||||
{candidate.latestPrompt.trim() ||
|
||||
@@ -82,7 +87,20 @@ function ResumeCandidateRow({
|
||||
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground">
|
||||
{formatShortTimeAgo(candidate.recordedAt, listedAt)}
|
||||
</span>
|
||||
<Button variant="ghost" size="xs" className="shrink-0" disabled={busy} onClick={onReconnect}>
|
||||
{/* Names which agent this button acts on: several rows otherwise expose an identical
|
||||
"Reconnect". Keeps the visible word first, so the accessible name still contains it. */}
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
className="shrink-0"
|
||||
disabled={busy}
|
||||
onClick={onReconnect}
|
||||
aria-label={translate(
|
||||
'auto.components.NativeChatResumeOnRestartModal.reconnectAgent',
|
||||
'Reconnect {{value0}} chat',
|
||||
{ value0: agentLabel }
|
||||
)}
|
||||
>
|
||||
<Play className="size-3" />
|
||||
{translate('auto.components.NativeChatResumeOnRestartModal.resume', 'Reconnect')}
|
||||
</Button>
|
||||
|
||||
@@ -1925,6 +1925,7 @@
|
||||
"updateBody": "These chats were mid-turn when Orca installed an update. Reconnecting restores each one where it stopped, with its full context and without re-sending your prompt — the interrupted reply will not continue on its own.",
|
||||
"terminalSessionsUnaffected": "Only chats are affected — your terminal sessions kept running and need nothing from you.",
|
||||
"resume": "Reconnect",
|
||||
"reconnectAgent": "Reconnect {{value0}} chat",
|
||||
"resumeAll": "Reconnect all",
|
||||
"resuming": "Reconnecting…",
|
||||
"notNow": "Not now",
|
||||
|
||||
Reference in New Issue
Block a user