feat(ActiveFilterPills): inactive-state pill styling and a11y polish#2361
Conversation
Adds visual treatment for filters that are present in state but not applied to the current query (e.g. column doesn't exist on the active source). Inactive pills render with a dashed `--color-border-emphasis` border, transparent background, 0.75 opacity, and strikethrough text plus a multi-line tooltip explaining why they aren't applied. Also refreshes the excluded (!=) pill to use the `--color-bg-danger` / `--color-text-danger` design tokens instead of raw Mantine red, adds deterministic `data-testid="active-filter-pill-<field>"` hooks for E2E, an `aria-label` on the remove button, and a `data-invalid` attribute on the pill wrapper. The component exposes two new optional props — `invalidFields` and `invalidFieldReason` — so callers can drive the inactive state without any behavior change for existing call sites. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Deep ReviewScope: ✅ No critical issues found. The diff is additive, well-scoped, and behaviorally backward-compatible for the existing 🟡 P2 -- recommended
🔵 P3 nitpicks (8)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, api-contract. Testing gaps:
|
E2E Test Results✅ All tests passed • 192 passed • 3 skipped • 1248s
Tests ran across 4 shards in parallel. |
Summary
Refreshes
ActiveFilterPillsso it can render filters that are present in state but not currently applied to the query (e.g. the column doesn't exist on the active source) in a clearly muted, "inactive" style — without changing any behavior for existing call sites.--color-border-emphasisborder, transparent background,0.75opacity, strikethrough label/operator/value, and a multi-line tooltip explaining why the filter isn't applied (with aninvalidFieldReasonoverride hook).!=) pill refresh: now uses the--color-bg-danger/--color-text-dangerdesign tokens instead of raw Mantine red, so the variant follows the theme.data-testid="active-filter-pill-<field>"on every pill for deterministic E2E selection.data-invalid="true"on inactive pills.aria-label="Remove filter"on the close button.ActiveFilterPills—invalidFields?: Set<string>andinvalidFieldReason?: (field) => string. Existing callers don't change.This PR is purely the component-level work. The feature wiring (search page state, query stripping, source-switch flow) lives in #2360, which is moved to draft for reference.
Test plan
yarn ci:unitinpackages/appstill passes.invalidFieldspassed in, pills render dashed / strikethrough / muted and the tooltip explains why.!=) pills still read as the "danger" variant via the new tokens.invalidFieldsprop) behave identically to before.Made with Cursor