Skip to content
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

enh: make viz responsive, remove extra renders, handle err in main window #6629

Merged
merged 6 commits into from
Aug 1, 2024

Conversation

fontanierh
Copy link
Contributor

Description

  1. improve the responsiveness of viz components by changing the prompt
  2. improve overall latency by not relying on onLoad (and instead relying on contentHeight)
  3. stop displaying error through the iframe (instead, use a setErrored cross-doc call to set error state on parent window)
  4. improve latency / smoothness by removing state vars (enabled by removing onLoad and not relying on iframe to display the error)

After this PR, we can release viz

Risk

N/A

Deploy Plan

@fontanierh fontanierh requested a review from flvndvd August 1, 2024 16:22
Copy link
Contributor

@flvndvd flvndvd left a comment

Choose a reason for hiding this comment

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

Not sure to get why we don't send the error message back to the main window?

@@ -202,7 +201,9 @@ export function VisualizationActionIframe({
<div
className={classNames(
"transition-height relative w-full overflow-hidden duration-500 ease-in-out",
codeFullyGenerated ? "min-h-96" : ""
codeFullyGenerated && !errored ? "min-h-96" : "",
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Don't we want the min height only when we have an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(explained on slack)

style={{
height: !errored ? `${contentHeight}px` : "100%",
minHeight: !errored ? "96" : undefined,
maxHeight: "60vh",
Copy link
Contributor

Choose a reason for hiding this comment

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

✂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No we need this actually

Copy link
Contributor

Choose a reason for hiding this comment

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

It's already below set with tailwind, why do we need to duplicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, nvm me 👍

@@ -28,65 +26,14 @@ export class ErrorBoundary extends React.Component<

componentDidCatch(error: unknown) {
this.setState({ hasError: true, error });
this.props.onErrored();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not passing the error message as we use to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't do anything with it yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we'll pass it when we need it

@fontanierh fontanierh merged commit 65cd136 into main Aug 1, 2024
3 checks passed
@fontanierh fontanierh deleted the enh/viz-content branch August 1, 2024 17:12
albandum pushed a commit that referenced this pull request Aug 28, 2024
…ndow (#6629)

* enh: improve viz responsiveness, remove extra renders, handle error in main

* mark last viz as complete on agent message success

* naming

* nit

* remove outdated comment

* r

---------

Co-authored-by: Henry Fontanier <[email protected]>
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.

2 participants