Skip to content
Merged
4 changes: 3 additions & 1 deletion static/app/components/events/contexts/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@
if (getLogoImage(iconName) === null) {
return null;
}
return <ContextIcon name={iconName} {...contextIconProps} />;
return (
<ContextIcon name={iconName} alt={`${type}: ${iconName}`} {...contextIconProps} />

Check failure on line 367 in static/app/components/events/contexts/utils.tsx

View workflow job for this annotation

GitHub Actions / typescript

Type '{ size?: "2xl" | "lg" | "md" | "sm" | "xl" | "xs" | undefined; name: string; alt: string; }' is not assignable to type 'IntrinsicAttributes & ContextIconProps'.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The ContextIcon component receives an alt prop, but it's not declared in its props or used, so the accessibility text is silently ignored.
Severity: LOW

Suggested Fix

Update the ContextIcon component to accept and use the alt prop. Add alt to the ContextIconProps interface, destructure it in the component's function signature, and pass it to the underlying rendered element that requires the accessibility text.

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/components/events/contexts/utils.tsx#L367

Potential issue: The `ContextIcon` component is passed an `alt` prop from `utils.tsx` to
provide accessibility text. However, the component's props interface,
`ContextIconProps`, does not declare `alt`, and the function signature only destructures
the `name` and `size` props. Consequently, the `alt` prop is silently ignored by React
and not passed down to the underlying `PlatformIcon` component. This results in the
intended accessibility improvement being non-functional, as no alternative text is
rendered for the icon.

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

);
}

export function getFormattedContextData({
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/feedback/feedbackSetupPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function FeedbackSetupPanel() {
<NoMarginPanel>
<Container>
<IlloBox>
<img src={feedbackOnboardingImg} />
<img src={feedbackOnboardingImg} alt="" />
</IlloBox>
<StyledBox>
<Fragment>
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/feedback/feedbackEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function FeedbackEmptyState({projectIds, issueTab = false}: Props) {
return (
<OnboardingPanel
data-test-id="user-feedback-empty"
image={<img src={emptyStateImg} />}
image={<img src={emptyStateImg} alt="" />}
>
<h3>{t('What do users think?')}</h3>
<p>
Expand Down
Loading