Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(settings): empty-state gating + recorder a11y polish in the shortcuts section

enes365a0e702a99
diff --git a/src/renderer/components/settings/ShortcutRecorderButton.tsx b/src/renderer/components/settings/ShortcutRecorderButton.tsx
index 1324e47ae..ee6537cfc 100644
--- a/src/renderer/components/settings/ShortcutRecorderButton.tsx
+++ b/src/renderer/components/settings/ShortcutRecorderButton.tsx
@@ -137,7 +137,7 @@ export function ShortcutRecorderButton({
const className = capturing
? 'min-w-[140px] rounded-md border border-accent bg-[color:var(--accent)]/10 px-3 py-1 text-[12px] text-text ring-1 ring-[color:var(--accent)]/40'
: appearance === 'icon'
- ? 'flex size-6 items-center justify-center rounded-md text-muted hover:bg-fill-weak hover:text-text'
+ ? 'flex size-6 items-center justify-center rounded-md text-muted hover:bg-fill-weak hover:text-text focus-visible:text-text'
: 'min-w-[120px] cursor-pointer rounded-md border border-border bg-panel-header px-3 py-1.5 text-[13px] font-medium text-text outline-none hover:bg-[rgba(255,255,255,0.06)]'
const isIdleIcon = appearance === 'icon' && !capturing
return (
@@ -151,7 +151,13 @@ export function ShortcutRecorderButton({
onKeyDown={onKeyDown}
onKeyUp={onKeyUp}
onBlur={stop}
- aria-label={isIdleIcon ? effectiveLabel : undefined}
+ // The icon button has no text in EITHER state, so the label is its only accessible name —
+ // and it must survive arming. Dropping it on capture (as this did) left a screen-reader
+ // user with a button whose name flipped to the hint text mid-interaction, i.e. no way to
+ // tell which command is being recorded for. The 'button' appearance keeps its own text and
+ // is deliberately untouched. `title` stays idle-only: the armed pill already says
+ // "Press keys…" on screen, and a hover tooltip over a live capture is noise.
+ aria-label={appearance === 'icon' ? effectiveLabel : undefined}
title={isIdleIcon ? effectiveLabel : undefined}
>
{capturing ? (
diff --git a/src/renderer/components/settings/sections/ShortcutsSection.test.tsx b/src/renderer/components/settings/sections/ShortcutsSection.test.tsx
index de16bf84d..df03e34b8 100644
--- a/src/renderer/components/settings/sections/ShortcutsSection.test.tsx
+++ b/src/renderer/components/settings/sections/ShortcutsSection.test.tsx
@@ -205,6 +205,20 @@ describe('ShortcutsSection rows', () => {
])
})
+ // The idle icon buttons have no text, so `aria-label` is their only accessible name — and it
+ // must not vanish the moment the recorder is armed, which is exactly when a screen-reader user
+ // needs to know which command they are recording for.
+ it('keeps the recorder named and focus-styled while it is armed', () => {
+ render()
+ const record = button('app.commandPalette', 'Record Command palette')!
+ // Same keyboard-focus affordance the Disable/Reset buttons beside it carry.
+ expect(record.className).toContain('focus-visible:text-text')
+ click(record)
+ const armed = recorder('app.commandPalette', 'Press keys…')!
+ expect(armed.getAttribute('data-shortcut-recording')).toBe('true')
+ expect(armed.getAttribute('aria-label')).toBe('Record Command palette')
+ })
+
// Record and Add sit side by side in the same hover-revealed cluster with no text, so two
// identical keycaps would leave the pair unreadable — the icon is the whole label.
it('gives Add a different glyph than Record', () => {
@@ -329,6 +343,19 @@ describe('the filter rail', () => {
expect(body().textContent).toContain('No shortcuts match.')
})
+ // The empty state is a sentence ABOUT the rail, so it must not outlive it. A global settings
+ // query can keep this section for the policy row alone ('policy' appears in no command title,
+ // id, group or note) — and answering that with "No shortcuts match." describes a filter control
+ // that is not on screen, in a section showing exactly what was asked for.
+ it('stays silent when a global query keeps only the policy row', () => {
+ render('policy')
+ expect(pill()).toBeTruthy()
+ expect(statusPill()).toBeNull()
+ expect(ids()).toEqual([])
+ expect(body().textContent).not.toContain('No shortcuts match.')
+ expect(body().children).toHaveLength(1)
+ })
+
// The chord the user SEES is searchable, which is the whole reason the local matcher exists —
// the global settings search has no idea what a command is bound to.
it('finds a row by the chord shown on its chip', () => {
diff --git a/src/renderer/components/settings/sections/ShortcutsSection.tsx b/src/renderer/components/settings/sections/ShortcutsSection.tsx
index 041e0d62a..e87eee2ad 100644
--- a/src/renderer/components/settings/sections/ShortcutsSection.tsx
+++ b/src/renderer/components/settings/sections/ShortcutsSection.tsx
@@ -658,9 +658,16 @@ export function ShortcutsSection({ isActive }: { isActive: boolean }): React.JSX
</div>
))}
- {visibleGroups.length === 0 ? (
- <p className="text-[13px] text-muted">No shortcuts match.</p>
- ) : null}
+ {/* The sentence is ABOUT the rail, so it rides the rail's OWN search entry and can never
+ outlive the control it explains. A global settings query can keep this section for the
+ policy row alone ('policy', 'shell', 'tui', 'minimize' appear in no command title, id,
+ group or note) — and answering that with "No shortcuts match." would describe a filter
+ that is not on screen, in a section showing exactly what was asked for. */}
+ <SearchableRow {...RAIL_ROW}>
+ {visibleGroups.length === 0 ? (
+ <p className="text-[13px] text-muted">No shortcuts match.</p>
+ ) : null}
+ </SearchableRow>
</SettingsSection>
)
}