Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(a11y): name icon buttons, pickers and fields found unnamed in the release scan

purple9b4cafd75f1b
diff --git a/src/components/__tests__/t1-a11y-names.test.tsx b/src/components/__tests__/t1-a11y-names.test.tsx
new file mode 100644
index 00000000..94ea5efe
--- /dev/null
+++ b/src/components/__tests__/t1-a11y-names.test.tsx
@@ -0,0 +1,146 @@
+// @vitest-environment jsdom
+/**
+ * Accessibility names and states found missing in a DOM scan of the release
+ * build (29.10.2026). Every control here already showed its meaning to a
+ * sighted user (an icon, a caption, a colour); a screen reader got nothing.
+ * The visible markup stays the same, only names and states are added.
+ *
+ * Run: npx vitest run src/components/__tests__/t1-a11y-names.test.tsx
+ */
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { readFileSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
+import { dirname, resolve } from 'node:path'
+
+vi.mock('../../hooks/useCloudAuth', () => ({
+ useCloudAuth: () => ({ status: 'signed-out', login: vi.fn(), signup: vi.fn(), logout: vi.fn() }),
+}))
+vi.mock('../../api/cloud/supabase', () => ({ loginWithProvider: vi.fn() }))
+
+const { ABCompare } = await import('../chat/ABCompare')
+const { BenchmarkView } = await import('../models/BenchmarkView')
+const { AccountPanel } = await import('../auth/AccountPanel')
+const { PermissionSettings } = await import('../settings/PermissionSettings')
+const { CodexModeDropdown } = await import('../chat/CodexModeDropdown')
+const { ProviderSettings } = await import('../settings/ProviderConfig')
+const { ChatInput } = await import('../chat/ChatInput')
+const { useCompareStore } = await import('../../stores/compareStore')
+const { usePermissionStore } = await import('../../stores/permissionStore')
+const { useProviderStore } = await import('../../stores/providerStore')
+const { useChatStore } = await import('../../stores/chatStore')
+
+const here = dirname(fileURLToPath(import.meta.url))
+
+afterEach(() => cleanup())
+
+describe('1. Compare view', () => {
+ it('names the back and send buttons, both model pickers and the prompt box', () => {
+ useCompareStore.setState({ modelA: '', modelB: '', isStreamingA: false, isStreamingB: false, messagesA: [], messagesB: [] })
+ render(<ABCompare />)
+ expect(screen.getByRole('button', { name: 'Back' })).toBeTruthy()
+ const send = screen.getByRole('button', { name: 'Send to both models' }) as HTMLButtonElement
+ expect(send.disabled).toBe(true)
+ expect(screen.getByRole('combobox', { name: 'Model A' })).toBeTruthy()
+ expect(screen.getByRole('combobox', { name: 'Model B' })).toBeTruthy()
+ const prompt = screen.getByRole('textbox', { name: 'Prompt for both models' }) as HTMLInputElement
+ expect(prompt.placeholder).toBe('Select both models first')
+ })
+
+ it('names the stop button while a side is streaming', () => {
+ useCompareStore.setState({ modelA: 'a', modelB: 'b', isStreamingA: true, isStreamingB: false, messagesA: [], messagesB: [] })
+ render(<ABCompare />)
+ expect(screen.getByRole('button', { name: 'Stop' })).toBeTruthy()
+ })
+})
+
+describe('2. Benchmark view', () => {
+ it('names the back arrow', () => {
+ render(<BenchmarkView />)
+ expect(screen.getByRole('button', { name: 'Back to models' })).toBeTruthy()
+ })
+})
+
+describe('3. LU Cloud account', () => {
+ it('names the Email and Password inputs, placeholders kept', () => {
+ render(<AccountPanel />)
+ expect((screen.getByLabelText('Email') as HTMLInputElement).placeholder).toBe('Email')
+ expect((screen.getByLabelText('Password') as HTMLInputElement).placeholder).toBe('Password')
+ })
+})
+
+describe('4. Agent permissions', () => {
+ it('exposes the selected level per category with aria-pressed, in a group named by the category', () => {
+ const perms = usePermissionStore.getState().globalPermissions
+ render(<PermissionSettings />)
+ const groups = screen.getAllByRole('group')
+ expect(groups.length).toBeGreaterThanOrEqual(Object.keys(perms).length)
+ for (const g of groups.slice(0, Object.keys(perms).length)) {
+ expect(g.getAttribute('aria-label')).toBeTruthy()
+ const buttons = Array.from(g.querySelectorAll('button'))
+ expect(buttons.map((b) => b.textContent)).toEqual(['Blocked', 'Ask First', 'Auto'])
+ expect(buttons.filter((b) => b.getAttribute('aria-pressed') === 'true')).toHaveLength(1)
+ expect(buttons.filter((b) => b.getAttribute('aria-pressed') === 'false')).toHaveLength(2)
+ }
+ const web = screen.getByRole('group', { name: 'Web Access' })
+ const pressed = Array.from(web.querySelectorAll('button')).find((b) => b.getAttribute('aria-pressed') === 'true')
+ expect(pressed?.textContent).toBe({ blocked: 'Blocked', confirm: 'Ask First', auto: 'Auto' }[perms.web as string])
+ fireEvent.click(screen.getAllByRole('button', { name: 'Blocked' })[0])
+ expect(screen.getAllByRole('button', { name: 'Blocked' })[0].getAttribute('aria-pressed')).toBe('true')
+ usePermissionStore.getState().resetToDefaults()
+ })
+})
+
+describe('5. Code mode trigger', () => {
+ it('says it opens a popup and whether it is open', () => {
+ useChatStore.setState({ activeConversationId: null })
+ render(<CodexModeDropdown />)
+ const trigger = screen.getAllByRole('button')[0]
+ expect(trigger.getAttribute('aria-haspopup')).toBe('true')
+ expect(trigger.getAttribute('aria-expanded')).toBe('false')
+ fireEvent.click(trigger)
+ expect(trigger.getAttribute('aria-expanded')).toBe('true')
+ })
+})
+
+describe('6. Neurons view', () => {
+ // NeuronView needs the bundled engine bridge to render its picker; its own
+ // render test is the known flaky one, so this item is pinned on the source.
+ it('ties the Model caption to the select', () => {
+ const src = readFileSync(resolve(here, '../neuron/NeuronView.tsx'), 'utf8')
+ expect(src).toMatch(/<label[^>]*htmlFor="neuron-model"[^>]*>Model<\/label>/)
+ expect(src).toMatch(/<select\s+id="neuron-model"/)
+ })
+})
+
+describe('7. AI Backends provider card', () => {
+ it('ties the Endpoint caption to its input on an expanded card', () => {
+ vi.stubGlobal('fetch', vi.fn(async () => { throw new Error('offline in tests') }))
+ const providers = useProviderStore.getState().providers
+ const id = (Object.keys(providers) as (keyof typeof providers)[]).find((k) => k === 'ollama') ?? 'ollama'
+ useProviderStore.setState({ providers: { ...providers, [id]: { ...providers[id], enabled: true } } })
+ render(<ProviderSettings />)
+ fireEvent.click(screen.getByText('Ollama'))
+ const endpoint = screen.getByLabelText('Endpoint') as HTMLInputElement
+ expect(endpoint.placeholder).toBe('http://localhost:...')
+ vi.unstubAllGlobals()
+ })
+
+ it('ties the API Key caption to its input on the cloud card', () => {
+ const src = readFileSync(resolve(here, '../settings/ProviderConfig.tsx'), 'utf8')
+ expect(src).toContain('htmlFor={`provider-url-${id}`}>Endpoint</label>')
+ expect(src).toContain('htmlFor={`provider-key-${id}`}>API Key</label>')
+ expect(src).toContain('id={`provider-key-${id}`}')
+ expect(src.match(/aria-label=\{(isKeyVisible|keyVisible) \? 'Hide API key' : 'Show API key'\}/g)).toHaveLength(2)
+ })
+})
+
+describe('8. Chat composer', () => {
+ it('names the textarea "Message" and keeps its data attribute and placeholder', () => {
+ useChatStore.setState({ activeConversationId: 'a' })
+ render(<ChatInput onSend={() => {}} onStop={() => {}} isGenerating={false} modelReady={() => true} />)
+ const box = screen.getByRole('textbox', { name: 'Message' }) as HTMLTextAreaElement
+ expect(box.hasAttribute('data-lu-composer')).toBe(true)
+ expect(box.placeholder).toBeTruthy()
+ })
+})
diff --git a/src/components/auth/AccountPanel.tsx b/src/components/auth/AccountPanel.tsx
index d1d0c8c9..cd53fc2a 100644
--- a/src/components/auth/AccountPanel.tsx
+++ b/src/components/auth/AccountPanel.tsx
@@ -212,6 +212,7 @@ export function AccountPanel() {
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Email"
+ aria-label="Email"
autoComplete="email"
className="w-full px-2 py-1.5 rounded text-[0.7rem] bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-gray-900 dark:text-gray-100 placeholder-gray-400 outline-none focus:border-gray-400 dark:focus:border-white/30"
/>
@@ -220,6 +221,7 @@ export function AccountPanel() {
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="Password"
+ aria-label="Password"
autoComplete={mode === 'signin' ? 'current-password' : 'new-password'}
className="w-full px-2 py-1.5 rounded text-[0.7rem] bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-gray-900 dark:text-gray-100 placeholder-gray-400 outline-none focus:border-gray-400 dark:focus:border-white/30"
/>
diff --git a/src/components/chat/ABCompare.tsx b/src/components/chat/ABCompare.tsx
index c445fcfd..d14219a4 100644
--- a/src/components/chat/ABCompare.tsx
+++ b/src/components/chat/ABCompare.tsx
@@ -62,6 +62,7 @@ export function ABCompare() {
<div className="flex items-center gap-3 justify-self-start">
<button
onClick={() => { setComparing(false); reset() }}
+ aria-label="Back"
className="p-1 rounded-lg hover:bg-white/10 text-gray-400 hover:text-white transition-colors"
>
<ArrowLeft size={14} />
@@ -77,6 +78,7 @@ export function ABCompare() {
<select
value={modelA}
onChange={(e) => setModelA(e.target.value)}
+ aria-label="Model A"
className="px-2 py-1 rounded-lg bg-red-500/10 border border-red-500/30 t-micro text-red-300 focus:outline-none"
>
<option value="">Model A</option>
@@ -88,6 +90,7 @@ export function ABCompare() {
<select
value={modelB}
onChange={(e) => setModelB(e.target.value)}
+ aria-label="Model B"
className="px-2 py-1 rounded-lg bg-blue-500/10 border border-blue-500/30 t-micro text-blue-300 focus:outline-none"
>
<option value="">Model B</option>
@@ -163,18 +166,20 @@ export function ABCompare() {
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={(e) => e.key === 'Enter' && !e.shiftKey && handleSend()}
+ aria-label="Prompt for both models"
placeholder={modelA && modelB ? 'Same prompt, two models...' : 'Select both models first'}
disabled={!modelA || !modelB || isStreaming}
className="flex-1 px-3 py-2 rounded-lg bg-white/5 border border-white/10 text-[0.7rem] text-white placeholder-gray-500 focus:outline-none focus:border-white/25 disabled:opacity-40"
/>
{isStreaming ? (
- <button onClick={stopCompare} className="px-3 py-2 rounded-lg bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors">
+ <button onClick={stopCompare} aria-label="Stop" className="px-3 py-2 rounded-lg bg-red-500/20 text-red-400 hover:bg-red-500/30 transition-colors">
<Square size={14} />
</button>
) : (
<button
onClick={handleSend}
disabled={!input.trim() || !modelA || !modelB}
+ aria-label="Send to both models"
className="px-3 py-2 rounded-lg bg-white/10 text-white hover:bg-white/15 transition-colors disabled:opacity-30"
>
<Send size={14} />
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index d8c30fe5..da346e30 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -899,6 +899,7 @@ export function ChatInput({ onSend, onStop, isGenerating, waitingForLocalLane, p
<textarea
data-lu-composer
key={conversationId ?? 'none'}
+ aria-label="Message"
ref={textareaRef}
value={input}
onChange={(e) => updateInput(e.target.value, e.target.selectionStart)}
diff --git a/src/components/chat/CodexModeDropdown.tsx b/src/components/chat/CodexModeDropdown.tsx
index c9a2f82f..2db33745 100644
--- a/src/components/chat/CodexModeDropdown.tsx
+++ b/src/components/chat/CodexModeDropdown.tsx
@@ -96,6 +96,8 @@ export function CodexModeDropdown({ openUpward = false }: { openUpward?: boolean
<div className="relative shrink-0">
<button
onClick={() => setOpen(!open)}
+ aria-haspopup="true"
+ aria-expanded={open}
title={
runActive
? 'A run is in flight. A change here applies to the next message.'
diff --git a/src/components/models/BenchmarkView.tsx b/src/components/models/BenchmarkView.tsx
index d8818047..f28f5cdd 100644
--- a/src/components/models/BenchmarkView.tsx
+++ b/src/components/models/BenchmarkView.tsx
@@ -75,7 +75,7 @@ export function BenchmarkView() {
)}
{/* Header */}
<div className="flex items-center gap-2 mb-4">
- <button onClick={() => setView('models')} className="p-1 rounded hover:bg-gray-200 dark:hover:bg-white/5 text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors">
+ <button onClick={() => setView('models')} aria-label="Back to models" className="p-1 rounded hover:bg-gray-200 dark:hover:bg-white/5 text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors">
<ArrowLeft size={16} />
</button>
{/* Der Pokal war golden, weil Pokale golden sind, nicht weil die
diff --git a/src/components/settings/PermissionSettings.tsx b/src/components/settings/PermissionSettings.tsx
index f7ece293..0e207001 100644
--- a/src/components/settings/PermissionSettings.tsx
+++ b/src/components/settings/PermissionSettings.tsx
@@ -110,13 +110,14 @@ export function PermissionSettings() {
</div>
{/* Permission Level Selector */}
- <div className="flex gap-0.5 shrink-0">
+ <div className="flex gap-0.5 shrink-0" role="group" aria-label={label}>
{LEVEL_OPTIONS.map(({ value, label: lvlLabel }) => {
const isActive = globalPermissions[key] === value
return (
<button
key={value}
onClick={() => setGlobalPermission(key, value)}
+ aria-pressed={isActive}
// "Ask First" war gelb und sah damit aus wie eine Warnung,
// obwohl es die vorsichtigste der drei Einstellungen ist.
// Rot und Gruen sind hier schon vergeben, Blau nicht, und
diff --git a/src/components/settings/ProviderConfig.tsx b/src/components/settings/ProviderConfig.tsx
index 8fb98b17..3dc0b8b3 100644
--- a/src/components/settings/ProviderConfig.tsx
+++ b/src/components/settings/ProviderConfig.tsx
@@ -717,8 +717,9 @@ export function ProviderSettings() {
</div>
) : (
<div className="pt-1.5">
- <label className="text-[0.6rem] text-gray-500 mb-0.5 block">Endpoint</label>
+ <label className="text-[0.6rem] text-gray-500 mb-0.5 block" htmlFor={`provider-url-${id}`}>Endpoint</label>
<input
+ id={`provider-url-${id}`}
value={config.baseUrl}
onChange={(e) => setProviderConfig(id, { baseUrl: e.target.value })}
placeholder="http://localhost:..."
@@ -730,9 +731,10 @@ export function ProviderSettings() {
{/* API Key (cloud only) */}
{needsKey && (
<div>
- <label className="text-[0.6rem] text-gray-500 mb-0.5 block">API Key</label>
+ <label className="text-[0.6rem] text-gray-500 mb-0.5 block" htmlFor={`provider-key-${id}`}>API Key</label>
<div className="relative">
<input
+ id={`provider-key-${id}`}
type={isKeyVisible ? 'text' : 'password'}
value={currentKey}
onChange={(e) => setProviderApiKey(id, e.target.value)}
@@ -741,6 +743,7 @@ export function ProviderSettings() {
/>
<button
onClick={() => setShowKey(prev => ({ ...prev, [id]: !isKeyVisible }))}
+ aria-label={isKeyVisible ? 'Hide API key' : 'Show API key'}
className="absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300"
>
{isKeyVisible ? <EyeOff size={10} /> : <Eye size={10} />}
@@ -1398,6 +1401,7 @@ function OpenAIEntryRow({ entry, expanded, onToggleExpanded }: {
/>
<button
onClick={() => setKeyVisible(!keyVisible)}
+ aria-label={keyVisible ? 'Hide API key' : 'Show API key'}
className="absolute right-1.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300"
>
{keyVisible ? <EyeOff size={10} /> : <Eye size={10} />}