Skip to content

Conversation

@shishu314
Copy link
Contributor

@shishu314 shishu314 commented Oct 14, 2025

TLDR

Increment counter for slow render metrics when rendering is more than 200ms

Dive Deeper

I'm unable to mock and test out the function. We have render mocked out, and as a result we do not have any access to the internal callback. Even if we did we don't have any ways to mock it out so I am not sure how to test this.

Reviewer Test Plan

Add a breakpoint into the onRender to see whether or not it's triggered.

Testing Matrix

🍏 🪟 🐧
npm run x
npx x
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Fixes #10600

@shishu314 shishu314 requested a review from jacob314 October 14, 2025 21:01
@shishu314 shishu314 requested a review from a team as a code owner October 14, 2025 21:01
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shishu314, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the application's infrastructure by integrating performance monitoring for UI rendering. It introduces a mechanism to detect and log slow-rendering UI components, specifically those taking over 200 milliseconds, which will help in identifying and addressing potential performance bottlenecks to improve user experience.

Highlights

  • New Telemetry Metric: Introduced a new telemetry metric, SLOW_RENDER_COUNT, to track instances where UI components take longer than 200ms to render.
  • UI Performance Monitoring: Implemented logic within the HistoryItemDisplay component to measure its render duration and increment the SLOW_RENDER_COUNT if the rendering time exceeds the defined threshold of 200ms.
  • Comprehensive Testing: Added new unit tests for both the HistoryItemDisplay component and the core telemetry module to ensure the recordSlowRender function correctly logs slow renders and ignores fast ones, and that the metric is only recorded when telemetry is initialized.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new telemetry metric to log slow component renders, which is a valuable addition for performance monitoring. The implementation across the telemetry and metrics files is well-structured and includes corresponding tests. However, I've identified a critical logic issue in the React component where this metric is used. The useEffect hook is configured in a way that will lead to incorrect render time calculations and false-positive reports upon re-renders. I've provided a suggestion to correct this behavior.

@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Size Change: +186 B (0%)

Total Size: 20.3 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 20.3 MB +186 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@shishu314 shishu314 closed this Oct 16, 2025
@shishu314 shishu314 reopened this Oct 28, 2025
@shishu314 shishu314 marked this pull request as draft October 28, 2025 14:39
@shishu314 shishu314 marked this pull request as ready for review October 28, 2025 18:27
@shishu314 shishu314 requested a review from jacob314 October 29, 2025 15:26
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@shishu314 shishu314 requested a review from a team as a code owner October 30, 2025 17:09
@shishu314 shishu314 enabled auto-merge October 31, 2025 17:04
@shishu314 shishu314 added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit 6ee7165 Oct 31, 2025
22 checks passed
@shishu314 shishu314 deleted the ss/slowRender branch October 31, 2025 19:52
skeshive pushed a commit that referenced this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regressions in UX responsiveness

4 participants