fix(search): make excluded filter pills readable in the light theme#2478
Conversation
Excluded ("!=") filter pills layered --color-text-danger text and remove
button on a --color-bg-danger background. In the light theme both tokens
resolve to red-8, so the operator, value, and "x" were red on red and
unreadable (dark theme was weak too). Switch the excluded pill to Mantine's
red-light variant (a soft tint with its paired readable accent color), which
is scheme-aware and legible in both themes. The change is local to the pill,
so the shared danger tokens used by other components are untouched, and the
included and inactive pill styles stay distinct.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 36bdd55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
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
|
Greptile SummaryThis PR fixes a readability problem where excluded (
Confidence Score: 5/5Safe to merge — the change is three CSS variable token swaps isolated to excluded filter pills, with no logic or data-flow modifications. The change is purely presentational: three inline style string replacements inside a single render path. The shared --color-bg-danger / --color-text-danger tokens used elsewhere in the codebase are untouched. The new test correctly uses getAttribute('style') string matching to avoid jsdom CSS-variable resolution issues, making the assertions meaningful rather than no-ops. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[FilterPill rendered] --> B{isInvalid?}
B -- yes --> C[transparent bg\ndashed border\n0.75 opacity\nstrikethrough text]
B -- no --> D{isExcluded?}
D -- yes --> E[--mantine-color-red-light bg\n--mantine-color-red-light-color\nfor operator & remove icon]
D -- no --> F[--color-bg-hover bg\ndimmed operator color]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[FilterPill rendered] --> B{isInvalid?}
B -- yes --> C[transparent bg\ndashed border\n0.75 opacity\nstrikethrough text]
B -- no --> D{isExcluded?}
D -- yes --> E[--mantine-color-red-light bg\n--mantine-color-red-light-color\nfor operator & remove icon]
D -- no --> F[--color-bg-hover bg\ndimmed operator color]
Reviews (2): Last reviewed commit: "test(search): assert excluded-pill token..." | Re-trigger Greptile |
E2E Test Results✅ All tests passed • 200 passed • 3 skipped • 1246s
Tests ran across 4 shards in parallel. |
Address review feedback on the new test: check the excluded pill's background and remove-button accent tokens by inspecting the raw inline style string instead of toHaveStyle, so the assertion stays meaningful regardless of how the jsdom version handles unresolved CSS custom properties. Also covers the accent token, not just the background. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Excluded ("!=") filter pills above the search results were drawn with a saturated red background plus red text and a red remove button. In the light theme that meant the
!=operator, the value, and thexwere red on red and effectively unreadable. This swaps the excluded pill to Mantine'sred-lightvariant: a soft red tint with its paired readable accent.Summary
ActiveFilterPillsexcluded pills now use--mantine-color-red-lightfor the background and--mantine-color-red-light-colorfor the!=operator and the removex, instead of--color-bg-danger/--color-text-danger.--color-bg-danger/--color-text-dangertokens (also used byGroupTabBar, the SQL editor border, the filter panel label, and dashboards) are unchanged.Why red-light
red-light/red-light-coloris Mantine's scheme-aware light variant (autoContrast is on), already used here for destructive buttons and menu items. It is a guaranteed-legible background and text pair, so one local change fixes both light and dark, and both the hyperdx and clickstack themes.Verification
Rendered the pill states in Storybook and read the computed colors of the excluded pill in both themes:
rgb(224,49,49), remove buttonrgb(224,49,49)(identical, invisible)rgb(255,227,227), accentrgb(201,42,42)(clear contrast)rgb(101,21,21), accentrgb(255,245,245)Before/after screenshots in light and dark are attached below.
after
Test plan
eslint(changed files) cleanyarn tsc --noEmitjestActiveFilterPills (27 passing, including a new assertion that the excluded pill uses the soft red-light background and the included pill stays neutral)