fix(a11y): name Agent Dashboard column regions (#26865)

Name Agent Dashboard columns using their translated visible headings.

Co-authored-by: Matheus Breguêz <matbrgz@gmail.com>
This commit is contained in:
Neil
2026-10-10 00:34:54 -07:00
committed by GitHub
co-authored by Matheus Breguêz
parent b961442814
commit e3bca6c5a8
2 changed files with 30 additions and 2 deletions
@@ -127,6 +127,29 @@ describe('AgentKanbanBoard', () => {
expect(screen.getByText('Needs You')).toBeInTheDocument()
})
it('names the visible column regions and keeps cards inside their region', () => {
renderBoard([card({ bucket: 'attention', worktreeName: 'needs-review' })])
expect(
screen.getAllByRole('region').map((region) => region.getAttribute('aria-label'))
).toEqual(['Needs You', 'Working', 'Done'])
expect(
within(screen.getByRole('region', { name: 'Needs You' })).getByText('needs-review')
).toBeInTheDocument()
expect(screen.queryByRole('region', { name: 'Idle' })).not.toBeInTheDocument()
})
it('uses the visible translated names for all regions when idle agents are shown', async () => {
await i18n.changeLanguage('zh')
renderBoard([], { showIdle: true })
expect(screen.getAllByRole('region')).toHaveLength(4)
for (const name of ['需要你', '工作中', '已完成', '空闲']) {
const region = screen.getByRole('region', { name })
expect(within(region).getByText(name)).toBeInTheDocument()
}
})
it('offers project filters without agent-state map filters', async () => {
renderBoard([card({ paneKey: 'busy' })])
@@ -80,13 +80,18 @@ function KanbanColumn({
now: number
onOpenTerminal: (card: DashboardCard) => void
}): React.JSX.Element {
const label = bucketLabel(bucket)
return (
// Why: attention no longer tints the whole column — the cards inside carry
// their own state color, so a column border would double-signal it.
<section className="flex min-w-[264px] flex-1 flex-col rounded-xl border border-border/60 bg-muted/30">
<section
aria-label={label}
className="flex min-w-[264px] flex-1 flex-col rounded-xl border border-border/60 bg-muted/30"
>
<header className="flex items-center gap-2 px-3 py-2">
<span className="text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground">
{bucketLabel(bucket)}
{label}
</span>
<span className="ml-auto rounded-full bg-background px-1.5 text-[11px] tabular-nums text-muted-foreground">
{cards.length}