Skip to content

feat(preprod): Add treemap diff UI - #105331

Merged
chromy merged 3 commits into
masterfrom
chromy/2025-12-18-add-evidence-data-with-metric-ids-ui-3
Jan 6, 2026
Merged

chromy merged 3 commits into
masterfrom
chromy/2025-12-18-add-evidence-data-with-metric-ids-ui-3

Conversation

@chromy

@chromy chromy commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

This causes the x-ray to show up in the issues feed for size issues:

CleanShot 2026-01-06 at 12 43 45@2x

@chromy
chromy requested a review from a team as a code owner December 19, 2025 17:00
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 19, 2025
@chromy
chromy force-pushed the chromy/2025-12-18-add-evidence-data-with-metric-ids-ui-3 branch from 8d774a7 to 85fbc7c Compare December 19, 2025 17:03
Comment thread static/app/components/events/eventXrayDiff.tsx Outdated
Comment thread static/app/components/events/eventXrayDiff.tsx
Comment on lines +32 to +42
if (query.isLoading) {
return <LoadingIndicator />;
}

const diffItems = query.data?.diff_items;

if (!diffItems || diffItems.length === 0) {
return <EmptyStateWarning small>No diff found.</EmptyStateWarning>;
}

return <TreemapDiffSection diffItems={diffItems} />;

This comment was marked as outdated.

@chromy
chromy force-pushed the chromy/2025-12-18-add-evidence-data-with-metric-ids-ui-3 branch from 0520276 to 0a3405e Compare January 6, 2026 11:47

@runningcode runningcode left a comment

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.

LGTM!

return <TreemapDiffSection diffItems={diffItems} />;
}

type SectionProps = {

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.

what's the difference between SectionProps and ContentProps?

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.

Nothing currently, I've made it so one aliases the other

Comment on lines +78 to +88
const headMetricId = event.occurrence?.evidenceData?.headSizeMetricId;
const baseMetricId = event.occurrence?.evidenceData?.baseSizeMetricId;

if (baseMetricId && headMetricId) {
return {
baseMetricId,
headMetricId,
};
}
return undefined;
}

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 getMetricIds function expects headSizeMetricId and baseSizeMetricId in event.occurrence.evidenceData, but these fields are never populated, causing the X-ray diff UI to never render.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The getMetricIds function in the new EventXrayDiff component attempts to extract headSizeMetricId and baseSizeMetricId from event.occurrence.evidenceData. However, these camelCase fields are not defined in the type system and are not populated by the backend for size-related issues. As a result, getMetricIds will always return undefined. This causes the EventXrayDiff component to consistently return null, preventing the new X-ray diff UI from ever rendering for users. The feature will fail silently without any error indication.

💡 Suggested Fix

Ensure the backend populates event.occurrence.evidenceData.headSizeMetricId and event.occurrence.evidenceData.baseSizeMetricId. Alternatively, if the data exists elsewhere or with different naming (e.g., snake_case), update the frontend to source the metric IDs from the correct location and handle any naming discrepancies.

🤖 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/eventXrayDiff.tsx#L77-L88

Potential issue: The `getMetricIds` function in the new `EventXrayDiff` component
attempts to extract `headSizeMetricId` and `baseSizeMetricId` from
`event.occurrence.evidenceData`. However, these camelCase fields are not defined in the
type system and are not populated by the backend for size-related issues. As a result,
`getMetricIds` will always return `undefined`. This causes the `EventXrayDiff` component
to consistently return `null`, preventing the new X-ray diff UI from ever rendering for
users. The feature will fail silently without any error indication.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8223334

/>
</ErrorBoundary>
</InterimSection>
);

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.

Duplicate section headers when rendering treemap diff

The EventXrayDiffSection wraps its content in InterimSection with title={t('X-Ray diff')}, which renders a section header. However, TreemapDiffSection (rendered inside via EventXrayDiffContent) already includes its own <Heading as="h2">X-Ray Diff</Heading> and a <Separator>. This results in duplicate "X-Ray diff" headings appearing in the UI when the treemap successfully renders.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

Will solve this later

@chromy
chromy merged commit 48b5216 into master Jan 6, 2026
52 checks passed
@chromy
chromy deleted the chromy/2025-12-18-add-evidence-data-with-metric-ids-ui-3 branch January 6, 2026 13:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 21, 2026

This branch was successfully deployed

1 active deployment
Preview — 117f483b Deployed Jan 6, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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