Repository navigation
fix(web): filter toggle hover as border, not background (#1460) - #1461
Conversation
The Logging/History/Network filter toggles used the same
--mantine-primary-color-light background for both their hover and their
active (toggled-on) state, so clicking a button to turn it off while the
cursor was still over it looked like a no-op — the hover background
masked the removal of the active background.
- Add a shared FilterToggleButton element used by LogControls,
NetworkControls, and MessageDirectionFilter, replacing the duplicated
UnstyledButton + inline `bg={active ? … : undefined}` in each.
- Add a `filterToggle` UnstyledButton theme variant + `.filter-toggle`
rules: hover is now a thin border (reserved via a transparent 1px
border so it doesn't shift layout); the active state is the filled
background, keyed off `aria-pressed="true"`.
- This leaves the `.list-item` selectable rows (Prompts/Apps/Tools/
Resources lists, section headers) untouched — they keep their
hover-fill since they aren't toggles.
- Add `aria-pressed` to the Logging level toggles (previously missing).
Tests + stories cover the active/hover distinction via aria-pressed for
FilterToggleButton and all three controls.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…1460) The previous attempt set the reserved `1px solid transparent` border via the theme's `styles` callback, which Mantine emits as an *inline* style. Inline styles outrank stylesheet `:hover` rules, so `.filter-toggle:hover { border-color }` never applied — hovering showed no border at all (verified in a real browser via Playwright). Move the border (and border-radius) out of the inline theme styles into the `.filter-toggle` class in App.css, so `:hover` can override the transparent border-color. The active fill (`[aria-pressed="true"]`) was already correct. Verified with real Playwright page.hover: inactive+hover now shows a 1px --inspector-brand-primary border, active shows the fill, active+hover shows both, all distinct. Story play functions assert the active fill and the reserved transparent border (the hover border can't be asserted in the synthetic-event test runner, so it's documented as Playwright-verified). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
@claude review |
|
Claude finished @cliffhall's task in 1m 28s —— View job Review: filter toggle hover as border, not background (#1460)
Solid, well-scoped fix. The root cause (hover-fill and active-fill sharing Correctness ✅
Minor / optional (non-blocking)
No blocking issues — the fix is correct, the abstraction reduces duplication, and tests/coverage are maintained. 👍 |
|
Thanks for the thorough review! All four are non-blocking; my take on each:
No code changes from this round since the items are all taste/observation. Re-requesting a review to confirm a clean pass. |
|
@claude review |
|
Claude finished @cliffhall's task in 47s —— View job Re-review: filter toggle hover as border, not background (#1460)
Clean pass — confirmed. ✅ Nothing changed since the last round (as you noted, the four items were all taste/observation calls), and your dispositions are all reasonable:
Re-verification of the diff
No blocking issues, no new concerns — convention-compliant (theme variant + |
|
Thanks for the clean re-review and the 👍 — all four items confirmed as reasonable dispositions with no new concerns. Ready to merge whenever. |
Closes #1460
Problem
The Filter by … toggle buttons on the Logging, History, and Network screens gave no feedback when toggled off: their hover background and their active (on) background were the same token (
--mantine-primary-color-light). Clicking a toggled-on button to turn it off while the cursor was still over it looked like nothing happened — the identical hover background immediately replaced the active one.Fix
FilterToggleButtonelement (components/elements/FilterToggleButton/) now used byLogControls,NetworkControls, andMessageDirectionFilter, replacing the duplicatedUnstyledButton+ inlinebg={active ? "var(--mantine-primary-color-light)" : undefined}in each of the three. The toggle styling lives in one place now.filterToggletheme variant (theme/UnstyledButton.ts) +.filter-togglerules (App.css):--inspector-brand-primary), reserved via a permanent1px solid transparentborder so it doesn't shift layout.aria-pressed="true"..list-itemselectable rows (Prompts/Apps/Tools/Resources lists,sectionHeaderGroups) are untouched — they keep their hover-fill since they're single-select/navigation rows, not toggles.aria-pressedto the Logging level toggles (previously missing; the Network/Direction toggles already had it).Screencapture
filter-toggle-feedback.mov
Tests
FilterToggleButtonunit tests + stories (active/inactivearia-pressed, toggle-on, toggle-off).aria-pressedreflection test toLogControls, and a clear-button test toNetworkControls(keeps per-file coverage ≥ 90% after the line-count shrank).npm run validate✅ ·npm run test:storybook✅ (353 passed).🤖 Generated with Claude Code