Skip to content

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Feb 10, 2026

Merge some page filter modules that have been scattered around the different files, but have matching or similar implementations.

@JonasBa JonasBa requested review from a team as code owners February 10, 2026 22:04
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 10, 2026
@@ -0,0 +1,246 @@
import {OrganizationFixture} from 'sentry-fixture/organization';
Copy link
Member Author

Choose a reason for hiding this comment

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

This file was the only one that was using the isSelectionEqual, so I've moved the functionality here and added the tests. Eod, it is up to the consumers to detect this and not something that pageFilters should provide functionality for.

@@ -1,64 +0,0 @@
import type {Location} from 'history';
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed this by moving the filters to the appropriate locations

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

import {createStore} from 'reflux';

import {getDefaultSelection} from 'sentry/components/pageFilters/utils';
import {getDefaultPageFilterSelection} from 'sentry/components/pageFilters/actions';
Copy link
Contributor

Choose a reason for hiding this comment

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

Circular dependency between store and actions modules

Medium Severity

Moving getDefaultPageFilterSelection into actions.tsx creates a circular dependency: store.tsx imports from actions.tsx, and actions.tsx imports PageFiltersStore from store.tsx. Critically, getDefaultPageFilterSelection() is called at module-level evaluation time (line 49) to initialize the store's state. Previously, both modules imported from utils.tsx, avoiding this cycle. This works today only because export function declarations are hoisted, but it's fragile — refactoring to an arrow function or changing the bundler could cause a runtime crash.

Additional Locations (2)

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

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

Seems legit!

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I didn't notice it. I need to separate more logic here, this is all quite messy, but I'll find a better place for it

import {createStore} from 'reflux';

import {getDefaultSelection} from 'sentry/components/pageFilters/utils';
import {getDefaultPageFilterSelection} from 'sentry/components/pageFilters/actions';
Copy link
Member

Choose a reason for hiding this comment

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

Seems legit!

Base automatically changed from jb/pagefilters/locations to master February 10, 2026 23:31
@JonasBa JonasBa requested review from a team as code owners February 10, 2026 23:31
@JonasBa JonasBa requested review from a team as code owners February 10, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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