Skip to content

fix: restore visible focus-visible outline on CommandPalette input - #802

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
16navigabraham:fix/command-palette-focus-visible
Jul 28, 2026
Merged

fix: restore visible focus-visible outline on CommandPalette input#802
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
16navigabraham:fix/command-palette-focus-visible

Conversation

@16navigabraham

Copy link
Copy Markdown

Closes #699

Note on scope

The issue references src/pages/OnboardingTour.tsx, which does not exist anywhere in this repo (confirmed via full-text search and git history) — there is no tour/walkthrough/spotlight feature of any kind in this codebase. The literal, universal requirement ("visible keyboard-only focus outlines on every interactive element") is already substantially satisfied globally: src/index.css defines a single @layer focus with *:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }, reinforced per-component across most existing pages (see src/styles/focus.css and the extensive focus-layer.test.ts suite this repo already maintains for exactly this kind of regression).

What I did instead

Since there's no OnboardingTour to fix, I audited every remaining unconditional outline: none in the codebase for the one bug class this repo's own focus-layer.test.ts already tests for (see e.g. "Dropdown trigger no longer overrides :focus-visible with inline outline:none").

  • Two were legitimate design choices with an equally-visible substitute indicator: ParamsBuilder / RequestBodyEditor's raw-body textareas use a .pb-raw-shell:focus-within / .rbe-shell:focus-within wrapper (border-color + box-shadow) instead of an outline on the textarea itself — not a bug, left alone.
  • One was real: CommandPalette.css is imported directly (unlayered — never wrapped in @layer focus), and .command-palette-input { outline: none; } was unconditional, with no :focus-visible restoration anywhere in the file. Per CSS cascade layer rules, an unlayered declaration always beats a layered one regardless of specificity, so nothing in @layer focus could ever restore this input's outline. Every keyboard user tabbing into or typing in the command palette's primary search field (Cmd/Ctrl+K) got zero visible focus indicator — a real WCAG 2.4.7 violation.

Fix

Split the unconditional outline: none into the same suppress-on-:focus / restore-on-:focus-visible pattern used by the global reset, so it's correct standalone regardless of layer/cascade context. Also added explicit :focus-visible reinforcement for the clear/close buttons, matching this repo's established convention of stating per-component coverage explicitly for audits even where the global rule already technically applies (see focus.css's own header comment).

Tests

4 new source-assertion cases in focus-layer.test.ts, following this repo's own established convention for this exact class of bug (regex assertions against the CSS source — see the existing Dropdown test). Confirms the unconditional outline:none is gone, the :focus-visible restoration exists with the correct accent token, the :focus suppression is conditional not blanket, and the clear/close buttons have explicit reinforcement.

npx vitest run src/focus-layer.test.ts src/components/CommandPalette.test.tsx
 Test Files  2 passed (2)
      Tests  28 passed (28)

Repo-wide npx vitest run has 68 pre-existing failures across 13 files (confirmed unrelated — none touch CommandPalette.css/focus-layer.test.ts).

Closes CalloraOrg#699

Note on scope: the issue references src/pages/OnboardingTour.tsx and
does not exist anywhere in this repo (confirmed via full-text and git
history search) — there is no tour/walkthrough/spotlight feature of any
kind in this codebase. The literal, universal requirement ("visible
keyboard-only focus outlines on every interactive element") is already
substantially satisfied globally: src/index.css defines a single
@layer focus with *:focus-visible { outline: 2px solid var(--accent);
outline-offset: 3px }, reinforced per-component across most existing
pages (see src/styles/focus.css and the extensive focus-layer.test.ts
suite this repo already maintains for exactly this kind of regression).

Since there's no OnboardingTour to fix, I audited every remaining
unconditional `outline: none` in the codebase for the one bug class
this repo's own focus-layer.test.ts already tests for (see e.g. "Dropdown
trigger no longer overrides :focus-visible with inline outline:none").
Two were legitimate design choices with an equally-visible substitute
indicator (ParamsBuilder / RequestBodyEditor raw-body textareas use a
`.pb-raw-shell:focus-within` / `.rbe-shell:focus-within` wrapper border +
box-shadow instead of an outline on the textarea itself — not a bug).

One was real: CommandPalette.css is imported directly (unlayered — never
wrapped in @layer focus), and `.command-palette-input { outline: none; }`
was unconditional, with no :focus-visible restoration anywhere in the
file. Per CSS cascade layer rules, an unlayered declaration always beats
a layered one regardless of specificity, so nothing in @layer focus
could ever restore this input's outline. Every keyboard user tabbing
into or typing in the command palette's primary search field (Cmd/Ctrl+K)
got zero visible focus indicator — a real WCAG 2.4.7 violation.

Fixed by splitting the unconditional outline:none into the same
suppress-on-:focus / restore-on-:focus-visible pattern used by the
global reset, so it's correct standalone regardless of layer/cascade
context. Also added explicit :focus-visible reinforcement for the
clear/close buttons, matching this repo's established convention of
stating per-component coverage explicitly for audits even where the
global rule already technically applies (see focus.css's own header
comment).

Tests: 4 new source-assertion cases in focus-layer.test.ts, following
this repo's own established convention for this exact class of bug
(regex assertions against the CSS source — see the existing Dropdown
test). Confirms the unconditional outline:none is gone, the
:focus-visible restoration exists with the correct accent token, the
:focus suppression is conditional not blanket, and the clear/close
buttons have explicit reinforcement.

npx vitest run src/focus-layer.test.ts src/components/CommandPalette.test.tsx
 Test Files  2 passed (2)
      Tests  28 passed (28)
Copilot AI review requested due to automatic review settings July 28, 2026 13:03
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@16navigabraham Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged into main via admin resolver (-X theirs).

@greatest0fallt1me
greatest0fallt1me merged commit 1fe0146 into CalloraOrg:main Jul 28, 2026
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Nice work, everything checks out. Merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add visible focus-visible outline on OnboardingTour interactive elements [b#022]

3 participants