Skip to content

fix(dashboards): Resolve static-component-definitions in GenericFilterSelector#120033

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/dashboards-static-component-definitions
Open

fix(dashboards): Resolve static-component-definitions in GenericFilterSelector#120033
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/dashboards-static-component-definitions

Conversation

@sentry

@sentry sentry Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the static-component-definitions violation reported in static/app/views/dashboards/globalFilter/genericFilterSelector.tsx.

The issue stemmed from calling the getFilterSelector function inside the GenericFilterSelector component's render method. Although getFilterSelector returned a stable, module-level component reference (NumericFilterSelector or FilterSelector), the act of calling a function to determine the component type during render caused React to perceive a new component type on each render. This leads to unnecessary unmounting/remounting of the component subtree, state resets, and blocks React Compiler optimizations.

The fix involves removing the getFilterSelector helper function and inlining its logic directly into the GenericFilterSelector component. By using a conditional (isNumericType ? NumericFilterSelector : FilterSelector) to assign the component to a local variable, we ensure that the component reference used in JSX is always a stable, module-level component, satisfying the static-component-definitions rule.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-359

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@sentry
sentry Bot requested a review from a team as a code owner July 19, 2026 19:55
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 19, 2026
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.

1 participant