Skip to content

fix(coding-conventions): Resolve static-component-definitions in progressActivityTooltip#120045

Open
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/static-component-definitions-tooltip
Open

fix(coding-conventions): Resolve static-component-definitions in progressActivityTooltip#120045
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/static-component-definitions-tooltip

Conversation

@sentry

@sentry sentry Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a static-component-definitions linting error occurring in static/app/views/issueList/progressActivityTooltip.tsx.

Problem:
The ProgressActivityItem component was dynamically creating a React component type during its render cycle. Specifically, the componentFunction within groupActivityTypeIconMapping (defined in groupActivityIcons.tsx) for certain activity types (like GroupActivityType.NOTE) was returning a new inline function component on every render. When this dynamically generated component type was then used as a JSX element (<Icon />), React would treat it as a new component on each render, leading to unnecessary unmounting/remounting of its subtree and preventing React Compiler optimizations.

Solution:

  1. Refactored Icon Rendering: Introduced a new exported helper function, renderActivityIcon, in groupActivityIcons.tsx. This function now directly returns a ReactNode (JSX) by using createElement from react, rather than returning a component type. This ensures that the actual component rendering is handled by a stable, module-scoped function.
  2. Updated progressActivityTooltip.tsx: The ProgressActivityItem component now calls renderActivityIcon directly, passing the iconMapping, item data, and any additional icon props. This eliminates the need for the intermediate Icon variable that previously held the dynamically created component type.
  3. Handling GroupActivityType.NOTE: For GroupActivityType.NOTE, the componentFunction in the iconMapping is explicitly set to undefined in the effectiveMapping passed to renderActivityIcon. This ensures that renderActivityIcon falls back to the static IconChat component or renders the avatar directly, preventing the dynamic component creation.
  4. Code Style Consistency: Changed import React from 'react' to import {createElement} from 'react' in groupActivityIcons.tsx to align with codebase conventions that favor named imports over default React imports for specific utilities.

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-36D

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 20:00
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.00% 94.00% ±0%
Typed 136,101 136,107 🟢 +6
Untyped 8,686 8,687 🔴 +1
🔍 2 new type safety issues introduced

any-typed symbols (2 new)

File Line Detail
static/app/views/issueDetails/activitySection/groupActivityIcons.tsx 231 componentFunction (var(binding))
static/app/views/issueDetails/activitySection/groupActivityIcons.tsx 231 propsFunction (var(binding))

This is informational only and does not block the PR.

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