Skip to content

Header magnifier reads as engaged when the filter is open#260

Merged
cameronapak merged 2 commits into
mainfrom
header-toggle-states
Jul 15, 2026
Merged

Header magnifier reads as engaged when the filter is open#260
cameronapak merged 2 commits into
mainfrom
header-toggle-states

Conversation

@cameronapak

@cameronapak cameronapak commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

The header filter magnifier now shows a muted "engaged" state the moment you open the filter (before typing a query) and turns solid only once a filter is actually applied, so opening the box finally reads as a toggle. Formalizes a header-toggle rule so future contributors stop reinventing the "on" look (ADR 0050).

Changes

  1. Opening the filter now lights the magnifier muted; a bare click no longer looks inert.
  2. The magnifier turns solid only when a ?q= query is actually applied — muted = tool engaged, solid = your view is altered.
  3. aria-pressed now reflects "the input is open" (open ∨ applied), not just "a query is applied".
  4. The magnifier learns it's open via a reactive open-signal in query-filter-nav (the useSyncExternalStore house pattern) — it lives outside QueryFilterBar, which owns the summoned flag.
  5. Recorded the cross-cutting rule as ADR 0050; cross-referenced the spotlight indicator, which already conformed (solid = view dimmed).

Start here: change 4 — the button is in the header, so the open state had to become observable outside QueryFilterBar rather than read from the route.

Flow

flowchart LR
  QFB[QueryFilterBar: summoned/active] -->|setFilterOpen| S[open-signal store]
  S -->|useSyncExternalStore| FB[FilterButton]
  Route[?q= param] -->|useSearch| FB
  FB -->|ghost / muted / solid| UI[three states]
Loading

Test plan

  • bun run typecheck, typecheck:test, lint — clean
  • bun run test — 640 unit tests pass
  • bun run build — production build + / prerender succeed (the header stays prerender-safe)
  • filter-input.spec.ts serial — 14/14 pass, incl. a new three-state guard (idle ghost → muted open-empty → solid applied, asserting aria-pressed + the standalone bg-muted/bg-primary fill tokens)
  • Verified settled computed colors: idle transparent · open-empty --muted (0.97, light grey) · applied --primary (0.205, dark) — muted is the only filled button at rest, so it's distinguishable
  • /code-review (high): one finding — useSyncExternalStore was missing the getServerSnapshot arg every sibling store passes; fixed in a follow-up commit

The header filter magnifier now shows a muted "engaged" state the moment
the filter input opens (before a query is typed), and turns solid only
once a query is actually applied. Formalizes the header-toggle rule
(ADR 0050): solid = the view is altered (spotlight-on, filter-applied);
muted = a toggle is engaged but the view is still normal (bookmark,
filter-open-empty).

- query-filter-nav: reactive open-signal (useSyncExternalStore pattern)
  so FilterButton, which lives outside QueryFilterBar, can light while
  the input is open.
- FilterButton: three states (ghost -> muted -> solid); aria-pressed now
  reflects "the input is open", not just "a query is applied".
- Spotlight/bookmark already conformed; left untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cameronapak, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b63c97a-6b4d-40cf-82f3-5df7ef090b38

📥 Commits

Reviewing files that changed from the base of the PR and between 774e9e0 and 41d94de.

📒 Files selected for processing (6)
  • .changeset/header-toggle-states.md
  • docs/adr/0050-header-toggle-button-states.md
  • e2e/filter-input.spec.ts
  • src/components/query-filter-nav.ts
  • src/components/query-filter.tsx
  • src/components/spotlight-indicator.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch header-toggle-states

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Prerender safety + consistency with every other useSyncExternalStore in the
repo (spotlight, coarse-pointer, tree/protection registry all pass one).
Caught by /code-review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cameronapak cameronapak merged commit a76bfe7 into main Jul 15, 2026
2 checks passed
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.

1 participant