Repository navigation
feat: Add button to remove stale dashboard URL filter params - #3874
Conversation
Co-authored-by: Drew Davis <pulpdrew@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: d5dcd69 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 |
🔵 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
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review
2 finding(s): 🔴 1 P0/P1 · 🟡 0 P2 · 🔵 1 P3 1 posted as inline comment(s) on the changed lines. 1 P3 folded at the bottom. 🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a tightly scoped, well-tested change. The core logic ( 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (10): correctness, testing, maintainability, project-standards, agent-native, learnings-researcher, kieran-typescript, julik-frontend-races, adversarial, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
E2E Test Results✅ All tests passed • 483 passed • 1 skipped • 1165s
Tests ran across 4 shards in parallel. |
| return; | ||
| } | ||
| setFilterValueEntries(prev => { | ||
| const parsed = parseDashboardFilterValues(prev ?? []); |
There was a problem hiding this comment.
🔴 P1 — Cleanup round-trip also silently drops sql URL entries that parseQuery can't parse, which the banner never listed
parseDashboardFilterValues → serializeDashboardFilterValues only keeps sql entries that parseQuery turns into IN/NOT IN/numeric BETWEEN (see packages/common-utils/src/filters.ts:507 and dashboardFilterValues.ts:93). An entry like {type:'sql', condition:"status = 'error'"} never shows up in ignoredFilterExpressions, so the banner doesn't mention it, but clicking the button deletes it anyway. That breaks the doc comment's promise that only the listed values are removed. Fix: when nothing parseable changes, leave the raw sql entries in prev as they are, or report entries that don't parse as ignored so the banner lists them too.
Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond
Summary
When a dashboard URL carries
filters=entries that match no declared dashboardfilter, we show a "Some filters could not be applied" warning banner. The banner
explained the problem but left the stale state in the URL, so the only way to
clear it was to hand-edit the address bar.
This PR adds a button to the banner that strips exactly the mismatched expressions and variable
names in one click and dismisses the banner, leaving valid selections untouched.
Screenshots or video
Screen.Recording.2026-12-01.at.1.11.31.PM.mov
How to reproduce
Starting point: full-stack
yarn dev(dashboards need the API).On
main:Service(variablesvc).?filters=[{"type":"variable","name":"groupBy","values":["ServiceName"]},{"type":"sql","condition":"team IN ('platform')"},{"type":"variable","name":"svc","values":["accounting"]}].groupBy/teamstate is to edit the URL by hand.On this branch:
groupBy/teamentries are gone from the URL, and the validService = accountingselection stays. It stays gone after a reload.How to test on Vercel preview
N/A — the repro needs the API to persist a dashboard, so it can't run in LOCAL_MODE preview.
References
Note
Low Risk
URL filter cleanup is scoped to already-ignored entries; valid selections are preserved and the change is covered by unit and e2e tests.
Overview
When the "Some filters could not be applied" banner appears for stale
filters=URL params, users can click Remove ignored values from URL to strip unmatched SQL expressions and orphaned variable entries in one action, dismiss the banner, and keep valid filter selections unchanged.useDashboardFiltersexposes newremoveIgnoredFilterState, which updates the URLfilters=param by deleting onlyignoredFilterExpressionsandignoredVariableNameswhile preserving declared selections and passthrough entries (no-op when nothing is stale). Unit, preset-hook mock, and e2e coverage accompany the dashboard UI button (data-testid="remove-ignored-url-filters-button").Reviewed by Cursor Bugbot for commit d5dcd69. Bugbot is set up for automated code reviews on this repo. Configure here.