Skip to content

feat(insights): Update Web Vital Meter in the landing page with link to performance issues #93520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

edwardgou-sentry
Copy link
Contributor

@edwardgou-sentry edwardgou-sentry commented Jun 13, 2025

Update to design with link to related perf issues.
image

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 13, 2025
@edwardgou-sentry edwardgou-sentry marked this pull request as ready for review June 13, 2025 18:15
@edwardgou-sentry edwardgou-sentry requested a review from a team as a code owner June 13, 2025 18:15
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

Makes sense, just a few nits and questions here and there! The suggestion to use GroupType is just for your consideration, not a blocker 👍🏻

Comment on lines +142 to +173
export const WEB_VITAL_PERFORMANCE_ISSUES: Record<
WebVitals,
Array<keyof typeof ISSUE_TYPE_TO_ISSUE_TITLE>
> = {
lcp: [
'performance_render_blocking_asset_span',
'performance_uncompressed_assets',
'performance_http_overhead',
'performance_consecutive_http',
'performance_n_plus_one_api_calls',
'performance_large_http_payload',
'performance_p95_endpoint_regression',
],
fcp: [
'performance_render_blocking_asset_span',
'performance_uncompressed_assets',
'performance_http_overhead',
'performance_consecutive_http',
'performance_n_plus_one_api_calls',
'performance_large_http_payload',
'performance_p95_endpoint_regression',
],
inp: [
'performance_http_overhead',
'performance_consecutive_http',
'performance_n_plus_one_api_calls',
'performance_large_http_payload',
'performance_p95_endpoint_regression',
],
cls: [],
ttfb: ['performance_http_overhead'],
} as const;
Copy link
Member

Choose a reason for hiding this comment

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

This makes sense, but I bet people won't remember to update this. I think a more flexible solution here would be to:

  1. Add a field to the GroupType class in Python that specifies whether a given group type affects page load performance or not
  2. Add a filter to issue search that allows to search for issues that affect page load

I think that approach is better because when we add more issue detectors (apparently this is planned) and when users start creating their own issue detectors based on metrics we can make sure that those issues also show up in these dropdowns somehow

That's a lot more work, obviously, but worth considering, IMO!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, interesting solution. I can look into this! Would you mind if I explored this separately and handle this in separate prs? Should be simple to pivot the frontend once I've dug into this a bit more

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I didn't mean for that comment to be a blocker, just thinking ahead since the Issue Platform folks are working in this area right now

showTooltip = true,
}: VitalMeterProps) {
const organization = useOrganization();
const [isIssuesButtonHovered, setIsIssuesButtonHovered] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

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

Whoa, why manually keep track of hover state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a little gross but I couldn't find a more elegant way to handle this.

Basically, when hovering over the issue button, by default the InteractionStateLayer on the meter component will activate. This looks a little weird because the meter and the issue button within are highlighted simultaneously:
image

I added the manual tracking to work around this so I can exclusively highlight the issue button and not the entire meter.

Alternatively, maybe we just stop using InteractionStateLayer (I heard it might be going away) and use something else to handle highlighting.

Let me know if you have any other suggestions!

Copy link
Member

Choose a reason for hiding this comment

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

Dang! What about doing an event.stopPropagation() on the hover on the button? If that works, it's still better. Also worth adding a code comment to explain why this is happening, since it's surprising!

Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

Makes sense! The only thing left is the hover behaviour, which I think is worth clarifying, if possible. Worth asking the FE folks in Slack, even, if stopping the event propagation doesn't work. Otherwise LGTM 👍🏻

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.

2 participants