Skip to content

fix: preserve query and dashboard tag filters in URLs - #7905

Merged
arikfr merged 2 commits into
getredash:masterfrom
poplav:fix/tag-filter-urls
Nov 4, 2026
Merged

arikfr merged 2 commits into
getredash:masterfrom
poplav:fix/tag-filter-urls

Conversation

@poplav

@poplav poplav commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Synchronize selected tags with repeated tags query parameters and restore list state when opening shared links or navigating browser history.

Document shareable filters and cover URL restoration, multi-selection, search, sorting, pagination, and listener cleanup.

Fixes #3197

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Playwright)
  • Manually
  • N/A

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

01-shared-dashboard-link.png
Opening a shared URL restores both selected tags and displays dashboards matching both.
https://redash.example.com/dashboards?tags=Finance&tags=Sales%20Reports
01-shared-dashboard-link
02-shared-query-link.png
Opening a query-list URL restores the Finance filter and highlights the selected tag.
https://redash.example.com/queries?tags=Finance
02-shared-query-link
03-search-with-tags.png
Searching for “Revenue” preserves the Finance filter and narrows the matching queries.
https://redash.example.com/queries?q=Revenue&tags=Finance
03-search-with-tags
04-clear-selection.png
Clearing the selected tags removes the URL filter and restores the full dashboard list.
https://redash.example.com/dashboards
04-clear-selection
05-special-characters.png
Tags containing spaces and punctuation, such as “R&D + QA, Europe,” survive URL encoding and restore correctly.
https://redash.example.com/dashboards?tags=R%26D%20%2B%20QA%2C%20Europe
05-special-characters

View guided diff

Synchronize selected tags with repeated tags query parameters and restore list state when opening shared links or navigating browser history.

Cover URL restoration, multi-selection, search, sorting, pagination, and listener cleanup.

Fixes getredash#3197
@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous search-text issue is fixed and no new blocking issues were found.

Summary

The PR keeps query and dashboard tag selections in repeated tags URL parameters and restores list state during browser navigation.

  • Dashboard and query links restore their selected tags and list state.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[User changes filters] --> B[List state]
  B --> C[Replace URL parameters]
  B --> D[Fetch matching items]
  E[Browser navigation] --> F[Read URL state]
  F --> G[Cancel waiting searches]
  G --> B
  B --> H[Show selected tags and search text]
Loading

Reviews (3) · Last reviewed commit: "fix: preserve navigation and sorting dur..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

View guided diff | Re-trigger cubic

Cancel delayed and queued searches before restoring URL state and when unmounting, so stale search input cannot overwrite navigation.

Ignore sort direction for relevance-ordered results and preserve the prior sort field and direction when restoring search state. Add regression coverage for browser history, stale responses, cleanup, and sort restoration.
@poplav
poplav force-pushed the fix/tag-filter-urls branch from 5f9e033 to 358eae8 Compare November 2, 2026 20:15
@poplav

poplav commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Addressed greptile comments. I see on one test failing at https://github.com/getredash/redash/actions/runs/41517621549/job/125525458277?pr=7905 the e2e tests, but pretty sure it's something flaky/sensitive with the tests and restart may resolve it.

@arikfr
arikfr merged commit 09740ea into getredash:master Nov 4, 2026
10 of 11 checks passed
@arikfr

arikfr commented Nov 4, 2026

Copy link
Copy Markdown
Member

Thanks, @poplav .

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.

Selecting a tag on the list pages should update the URL

2 participants