Skip to content

fix(coding-conventions): Make activity section icon component static#120044

Closed
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/static-activity-icon
Closed

fix(coding-conventions): Make activity section icon component static#120044
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/static-activity-icon

Conversation

@sentry

@sentry sentry Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a static-component-definitions violation in the activity section of issue details.

Root Cause:
The componentFunction for GroupActivityType.NOTE in groupActivityIcons.tsx was returning new anonymous React components (e.g., () => <SentryAppAvatar /> or () => <StyledUserAvatar />) on every render. This meant that the Icon component rendered at static/app/views/issueDetails/activitySection/index.tsx:165 had a new identity each time, violating the React Compiler's StaticComponents diagnostic.

Solution:

  1. A new, static, module-scoped component NoteActivityIcon was created in groupActivityIcons.tsx.
  2. The groupActivityTypeIconMapping for GroupActivityType.NOTE was updated to use NoteActivityIcon directly as its Component.
  3. The dynamic user and sentry_app data, previously captured by closures, are now passed as props to NoteActivityIcon via an extended propsFunction signature.
  4. The call site in index.tsx was updated to pass these additional props to propsFunction.

This ensures that the icon component has a stable identity across renders, resolving the coding convention violation and allowing for better React Compiler optimization.

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-350

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
}
return user ? () => <StyledUserAvatar user={user} /> : IconChat;
},
propsFunction: (_, user, sentry_app) => ({user, sentry_app}),

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.

Bug: The call to propsFunction in progressActivityTooltip.tsx was not updated after a refactor, causing it to be called with incomplete arguments for GroupActivityType.NOTE.
Severity: MEDIUM

Suggested Fix

Update the call to propsFunction in progressActivityTooltip.tsx at line 100 to pass all required arguments. Change iconMapping.propsFunction?.(item.data) to iconMapping.propsFunction?.(item.data, item.user, item.sentry_app) to match the updated signature.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/views/issueDetails/activitySection/groupActivityIcons.tsx#L82

Potential issue: A refactor updated the signature of `propsFunction` for
`GroupActivityType.NOTE` to accept `data`, `user`, and `sentry_app` as arguments. While
the call site in `index.tsx` was correctly updated to pass all three, the call site in
`progressActivityTooltip.tsx` was missed and still only passes `item.data`.
Consequently, when a note activity created by a user or Sentry app is displayed in the
progress tooltip, the `user` and `sentry_app` arguments will be `undefined`. This causes
the `NoteActivityIcon` to fall back to rendering a generic chat icon instead of the
correct user or Sentry app avatar, resulting in a functional regression.

Also affects:

  • static/app/views/issueList/progressActivityTooltip.tsx:100

Did we get this right? 👍 / 👎 to inform future reviews.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.00% 94.00% ±0%
Typed 136,101 136,104 🟢 +3
Untyped 8,686 8,688 🔴 +2
🔍 1 new type safety issue introduced

any-typed symbols (1 new)

File Line Detail
static/app/views/issueDetails/activitySection/groupActivityIcons.tsx 82 _ (param)

This is informational only and does not block the PR.

@ryan953

ryan953 commented Jul 20, 2026

Copy link
Copy Markdown
Member

replaced by #120047

@ryan953 ryan953 closed this Jul 20, 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