Skip to content

feat(dashboards): Persist global filters in dashboard details and url params#101257

Merged
Ahmed-Labs merged 15 commits into
masterfrom
ahmedmo/feat/dashboard-global-filters-persistence
Oct 16, 2025
Merged

feat(dashboards): Persist global filters in dashboard details and url params#101257
Ahmed-Labs merged 15 commits into
masterfrom
ahmedmo/feat/dashboard-global-filters-persistence

Conversation

@Ahmed-Labs

@Ahmed-Labs Ahmed-Labs commented Oct 9, 2025

Copy link
Copy Markdown
Contributor
  • Pushes unsaved global filter changes to URL query parameters
  • Parses global filters from query parameters for saving
  • Query parameter global filters take precedence over saved global filters

Fixes DAIN-980

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 9, 2025
@Ahmed-Labs Ahmed-Labs changed the title Ahmedmo/feat/dashboard global filters persistence feat(dashboards): Persist global filters and apply them to widget queries Oct 9, 2025
@Ahmed-Labs Ahmed-Labs changed the base branch from master to ahmedmo/feat/dashboard-global-filters-component October 9, 2025 17:56
@linear

linear Bot commented Oct 9, 2025

Copy link
Copy Markdown

@Ahmed-Labs Ahmed-Labs marked this pull request as ready for review October 9, 2025 18:44
@Ahmed-Labs Ahmed-Labs requested a review from a team October 9, 2025 18:44
Base automatically changed from ahmedmo/feat/dashboard-global-filters-component to master October 9, 2025 19:35
@Ahmed-Labs Ahmed-Labs force-pushed the ahmedmo/feat/dashboard-global-filters-persistence branch from a95eb83 to a744a0d Compare October 9, 2025 19:38
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@Ahmed-Labs Ahmed-Labs force-pushed the ahmedmo/feat/dashboard-global-filters-persistence branch from 5266153 to cbb5521 Compare October 14, 2025 18:03
@Ahmed-Labs Ahmed-Labs changed the title feat(dashboards): Persist global filters and apply them to widget queries feat(dashboards): Persist global filters in dashboard details and url params Oct 14, 2025

@nikkikapadia nikkikapadia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm! just a couple clarifying questions before i approve

Comment on lines +508 to +511
filterParams[DashboardFilterKeys.RELEASE] = activeFilters[DashboardFilterKeys.RELEASE]
?.length
? activeFilters[DashboardFilterKeys.RELEASE]
: [''];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why are we changing the release type here? just curious it's not an issue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

setting the release param to '' or [''] does the same thing so its just to avoid the unnecessary eslint disable comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah ok sounds good

Comment on lines +84 to +86
// Ignore location.query dependency to avoid reading query params when possible (and instead use local state)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [filters]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why would location.query be a dependency here? it's not being used in the memo 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch! it used to be a dependency then I made a change to use a helper instead and forgot to update it. I removed the memo entirely for now since I would need to update state handling for releases for this to work as intended

@Ahmed-Labs Ahmed-Labs force-pushed the ahmedmo/feat/dashboard-global-filters-persistence branch from 454bf6c to 5c2134f Compare October 16, 2025 16:10
Comment thread static/app/views/dashboards/utils.tsx
@Ahmed-Labs Ahmed-Labs merged commit 5bdaad8 into master Oct 16, 2025
46 checks passed
@Ahmed-Labs Ahmed-Labs deleted the ahmedmo/feat/dashboard-global-filters-persistence branch October 16, 2025 16:31
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants