Skip to content

Add URL query-parameter filtering for dashboards - #49

Merged
TanayBensuYurtturk merged 6 commits into
mainfrom
TanayBensuYurtturk/dashboard-url-filters
Jul 28, 2026
Merged

Add URL query-parameter filtering for dashboards#49
TanayBensuYurtturk merged 6 commits into
mainfrom
TanayBensuYurtturk/dashboard-url-filters

Conversation

@TanayBensuYurtturk

@TanayBensuYurtturk TanayBensuYurtturk commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Dashboards can now be filtered straight from the URL, so a filtered view is a shareable link (e.g. ?region=Europe&date_range=last_30_days). Filter values sync both ways with the URL, and select/date/number values from the URL are validated so anything invalid or injected is ignored and falls back to the default.

Filters are read from and written back to the URL, so a filtered dashboard view is a shareable link. Select values from the URL are validated against the filter's options and ignored if not valid.
@TanayBensuYurtturk
TanayBensuYurtturk force-pushed the TanayBensuYurtturk/dashboard-url-filters branch from a431701 to 8468fed Compare July 27, 2026 14:15
Reject non-finite numbers and impossible dates from the URL, and encode multi-select as repeated params so option values containing commas survive.
@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Fix All in Conductor

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
frontend/src/components/DashboardView.tsx:149
**Local state shadows URL changes**

When a viewer edits a filter and then navigates to the same dashboard with different query parameters, the non-null local `filters` state continues to override the recomputed `baseFilters`, causing the controls and widget queries to use values that disagree with the visible URL.

Reviews (1): Last reviewed commit: "Harden URL filter parsing and use repeat..." | Re-trigger Greptile

Comment thread frontend/src/components/DashboardView.tsx
Local filter overrides are dropped when the URL query string changes on its own (navigating to the same dashboard with different params), while a self-write guard preserves in-progress input during the user's own edits.
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Fix All in Conductor

Prompt To Fix All With AI
### Issue 1
frontend/src/components/DashboardView.tsx:266
**Concurrent URL writes drop filters**

When two filter controls invoke this handler before the first URL update causes a rerender, both calls clone the same render-time search parameters. The second write drops the first changed parameter while local state retains both filters, so copying or reloading the URL loses an active filter.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (2): Last reviewed commit: "Re-apply URL filters on external navigat..." | Re-trigger Greptile

Comment thread frontend/src/components/DashboardView.tsx Outdated
Filter edits accumulate in local state and a single effect mirrors the whole set to the URL, so concurrent changes never drop a param and external URL changes re-seed the filters while in-progress input is preserved.
Comment thread frontend/src/components/DashboardView.tsx
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Fix All in Conductor

Prompt To Fix All With AI
### Issue 1
frontend/src/components/DashboardView.tsx:211
**Persistent marker ignores navigation**

When an external navigation returns to the same query string as the most recent local URL write while local filter state differs, this persistent marker classifies it as the original self-write and skips clearing `filters`, causing the controls and widget queries to remain out of sync with the navigated URL.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (3): Last reviewed commit: "Sync dashboard filters with the URL via ..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Reviews (4): Last reviewed commit: "Keep the self-write marker in sync so na..." | Re-trigger Greptile

The projection effect now records the current filter query string even when the URL is already up to date, so an external navigation back to an older string is no longer mistaken for our own write.
@TanayBensuYurtturk
TanayBensuYurtturk force-pushed the TanayBensuYurtturk/dashboard-url-filters branch from 14e051c to aa03e1b Compare July 28, 2026 06:16
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Reviews (5): Last reviewed commit: "Keep the self-write marker in sync so na..." | Re-trigger Greptile

@TanayBensuYurtturk
TanayBensuYurtturk merged commit c56209e into main Jul 28, 2026
3 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.

2 participants