Conversation
Summary of ChangesHello, 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 optimizes the behavior of embedded iframes by introducing a height change threshold. This enhancement prevents the iframe from frequently resizing for minor height adjustments, which can lead to visual instability and performance overhead. By only applying height updates when the change is significant, the PR aims to provide a smoother and more efficient user experience for embedded ThoughtSpot applications and liveboards. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a threshold to prevent small, frequent iframe height adjustments in AppEmbed and LiveboardEmbed, which is a good improvement to prevent visual flickering. The PR title has a typo and should be "FullHeight".
My review includes a few points:
- There's a typo in the new constant name in both files.
- In
AppEmbed, an incorrect log level (error) is used for a routine operation. - The new logic is duplicated across
AppEmbedandLiveboardEmbed. I've suggested refactoring this into a shared location to improve maintainability.
Please see the specific comments for details.
src/embed/liveboard.ts
Outdated
| )}`; | ||
| } | ||
|
|
||
| private HEIGHT_CHANAGE_THRESHOLD = 30; |
src/embed/liveboard.ts
Outdated
| private HEIGHT_CHANAGE_THRESHOLD = 30; | ||
| /** | ||
| * Set the iframe height as per the computed height received | ||
| * from the ThoughtSpot app. | ||
| * @param data The event payload | ||
| */ | ||
| private updateIFrameHeight = (data: MessagePayload) => { | ||
| this.setIFrameHeight(Math.max(data.data, this.defaultHeight)); | ||
| const currentHeight = this.iFrame.getBoundingClientRect().height; | ||
| const heightToSet = Math.max(data.data, this.defaultHeight); | ||
| const heightChange = Math.abs(heightToSet - currentHeight); | ||
| if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) { | ||
| logger.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight }); | ||
| return; | ||
| } | ||
| this.setIFrameHeight(heightToSet); | ||
| this.sendFullHeightLazyLoadData(); | ||
| }; |
There was a problem hiding this comment.
This constant and the updateIFrameHeight method are duplicated from src/embed/app.ts. To improve maintainability and avoid code duplication, consider moving this shared logic to a common base class like V1Embed or a utility function. This will ensure that any future changes only need to be made in one place.
commit: |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>


No description provided.