Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/CategoryPills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function CategoryPills({ categories, selected, onToggle, className }: Cat
onKeyDown={(e) => handleKeyDown(e, index)}
className={cn(
"flex-shrink-0 rounded-full border px-4 py-1.5 text-sm font-medium transition-colors",
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
isActive
? "border-primary bg-primary text-primary-foreground"
: "border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground"
Expand Down
8 changes: 8 additions & 0 deletions app/components/__tests__/MarketFilters.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,12 @@ describe("MarketFilters", () => {
const outer = container.firstChild as HTMLElement
expect(outer).toHaveClass("custom-class")
})

it("uses focus-visible ring classes on category buttons for keyboard accessibility", () => {
render(<MarketFilters />)
const buttons = screen.getAllByRole("checkbox")
buttons.forEach((btn) => {
expect(btn.className).toContain("focus-visible:ring-2")
})
})
})