Skip to content

The agent that grows with you

fix(desktop): Kanban board switcher reads as a control — icon, tooltip, i18n

teknium1d235ae0991dc
diff --git a/apps/desktop/src/plugins/kanban/board-switcher.test.tsx b/apps/desktop/src/plugins/kanban/board-switcher.test.tsx
index fb646bb426b..e5656a38b38 100644
--- a/apps/desktop/src/plugins/kanban/board-switcher.test.tsx
+++ b/apps/desktop/src/plugins/kanban/board-switcher.test.tsx
@@ -1,10 +1,15 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
-import { cleanup, render, screen } from '@testing-library/react'
-import { afterEach, describe, expect, it, vi } from 'vitest'
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+// Test harness supplies the host's locale registration, as plugin loading does.
+// eslint-disable-next-line no-restricted-imports
+import { registerPluginLocales } from '@/i18n/plugin-i18n'
import type * as KanbanApi from './api'
import { $boardSlug } from './api'
import { BoardSwitcher } from './board-switcher'
+import { KANBAN_LOCALES } from './i18n'
vi.mock('./api', async importOriginal => ({
...(await importOriginal<typeof KanbanApi>()),
@@ -14,8 +19,15 @@ vi.mock('./api', async importOriginal => ({
}))
}))
+let disposeLocales: () => void = () => undefined
+
+beforeEach(() => {
+ disposeLocales = registerPluginLocales('kanban', KANBAN_LOCALES)
+})
+
afterEach(() => {
cleanup()
+ disposeLocales()
$boardSlug.set('')
})
@@ -37,11 +49,18 @@ describe('board switcher', () => {
expect(await screen.findByText('Shipping')).toBeTruthy()
})
+ // The trigger is projected into the title bar as the board's own name, so it
+ // must announce itself as a control: a visible "Board" label, a "Board: …"
+ // accessible name, and a "Switch board" tooltip on hover.
it('identifies the current board switcher as a control', async () => {
mount()
- const trigger = await screen.findByRole('button', { name: /board: Shipping/i })
+ const trigger = await screen.findByRole('button', { name: 'Board: Shipping' })
+
+ expect(trigger.textContent).toContain('Board')
+
+ fireEvent.pointerMove(trigger, { pointerType: 'mouse' })
- expect(trigger.getAttribute('title')).toMatch(/board: Shipping/i)
+ expect((await screen.findByRole('tooltip')).textContent).toContain('Switch board')
})
})
diff --git a/apps/desktop/src/plugins/kanban/board-switcher.tsx b/apps/desktop/src/plugins/kanban/board-switcher.tsx
index 0a7538cf92e..ea01003d13e 100644
--- a/apps/desktop/src/plugins/kanban/board-switcher.tsx
+++ b/apps/desktop/src/plugins/kanban/board-switcher.tsx
@@ -25,6 +25,7 @@ import {
SelectItem,
SelectTrigger,
SelectValue,
+ Tip,
useI18n,
useMutation,
useQuery,
@@ -335,22 +336,24 @@ export function BoardSwitcher() {
return (
<>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={`${k.board}: ${label}`}
- className="h-full min-w-0 max-w-full gap-1.5 px-2"
- size="sm"
- title={`${k.board}: ${label}`}
- variant="ghost"
- >
- <span className="shrink-0 text-[0.6875rem] font-medium text-(--ui-text-tertiary)">{k.board}</span>
- <span className="min-w-0 flex-1 truncate text-[0.75rem] font-medium leading-none">{label}</span>
- {typeof current?.total === 'number' && (
- <span className="text-[0.6875rem] tabular-nums text-(--ui-text-quaternary)">{current.total}</span>
- )}
- <Codicon className="shrink-0 text-(--ui-text-tertiary)" name="chevron-down" size="0.8125rem" />
- </Button>
- </DropdownMenuTrigger>
+ <Tip label={k.switchBoard}>
+ <DropdownMenuTrigger asChild>
+ <Button
+ aria-label={`${k.board}: ${label}`}
+ className="h-full min-w-0 max-w-full gap-1.5 px-2"
+ size="sm"
+ variant="ghost"
+ >
+ <Codicon className="shrink-0 text-(--ui-text-tertiary)" name="project" size="0.8125rem" />
+ <span className="shrink-0 text-[0.6875rem] font-medium text-(--ui-text-tertiary)">{k.board}</span>
+ <span className="min-w-0 flex-1 truncate text-[0.75rem] font-medium leading-none">{label}</span>
+ {typeof current?.total === 'number' && (
+ <span className="text-[0.6875rem] tabular-nums text-(--ui-text-quaternary)">{current.total}</span>
+ )}
+ <Codicon className="shrink-0 text-(--ui-text-tertiary)" name="chevron-down" size="0.8125rem" />
+ </Button>
+ </DropdownMenuTrigger>
+ </Tip>
<DropdownMenuContent align="center">
{boards.boards.map(meta => (
<DropdownMenuItem
diff --git a/apps/desktop/src/plugins/kanban/i18n.ts b/apps/desktop/src/plugins/kanban/i18n.ts
index 57c8c105e88..e98115233b3 100644
--- a/apps/desktop/src/plugins/kanban/i18n.ts
+++ b/apps/desktop/src/plugins/kanban/i18n.ts
@@ -163,6 +163,9 @@ type KanbanMessages = {
// board switcher
board: string
newBoard: string
+ /** Tooltip on the title-bar trigger — names the ACTION, since the visible
+ * text is the board's own name and reads as a static label otherwise. */
+ switchBoard: string
newBoardDots: string
// Menu labels are bare verbs — the board they act on is the one named in the
// switcher's trigger. The nouns come back for the native file-dialog and
@@ -380,6 +383,7 @@ export const en: KanbanMessages = {
working: 'working',
board: 'Board',
newBoard: 'New board',
+ switchBoard: 'Switch board',
newBoardDots: 'New board…',
exportDots: 'Export…',
importDots: 'Import…',
@@ -592,6 +596,7 @@ const ja: KanbanMessages = {
working: '作業中',
board: 'ボード',
newBoard: '新しいボード',
+ switchBoard: 'ボードを切り替え',
newBoardDots: '新しいボード…',
exportDots: 'エクスポート…',
importDots: 'インポート…',
@@ -802,6 +807,7 @@ const zh: KanbanMessages = {
working: '进行中',
board: '面板',
newBoard: '新建面板',
+ switchBoard: '切换面板',
newBoardDots: '新建面板…',
exportDots: '导出…',
importDots: '导入…',
@@ -1011,6 +1017,7 @@ const zhHant: KanbanMessages = {
working: '進行中',
board: '面板',
newBoard: '新增面板',
+ switchBoard: '切換面板',
newBoardDots: '新增面板…',
exportDots: '匯出…',
importDots: '匯入…',
diff --git a/website/docs/user-guide/features/kanban.md b/website/docs/user-guide/features/kanban.md
index a133aefd807..ca0742f6029 100644
--- a/website/docs/user-guide/features/kanban.md
+++ b/website/docs/user-guide/features/kanban.md
@@ -229,6 +229,16 @@ All dashboard API endpoints accept `?board=<slug>` for board scoping. The
events WebSocket is pinned to a board at connection time; switching in
the UI opens a fresh WS against the new board.
+### Switching boards in the Desktop app
+
+In the Desktop app the board switcher lives in the window title bar while
+the Kanban pane is open: a **Board** control showing the current board's
+name and task count, with a chevron — hover it for "Switch board". Click
+it to pick another board, or to rename, configure, export, import,
+create, or archive boards. Like the dashboard, the desktop keeps its own
+selection (persisted locally) and does not move the CLI's `current`
+pointer.
+
## File attachments