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

Fix plot progress bar #4781

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Fix plot progress bar #4781

merged 1 commit into from
Sep 25, 2024

Conversation

timtmok
Copy link
Contributor

@timtmok timtmok commented Sep 23, 2024

Address #4562

Add a flex direction on the plot element so that the children are in a single column.

There was another issue with leftover progress bars that's been fixed by removing any existing ones before creating a new one. Sometimes this would leave a progress bar in perpetual animation when another render is called before the current one completes (triggered by resizing the plot container when a render is in progress). It looked even worse when another render is called and it becomes difficult to distinguish the current progress bar with a previous one.

Before:
image

After:

Screen.Recording.2024-09-23.at.9.04.35.AM.mov

QA Notes

The feature flag to enable plots in editors has changed recently and reset the flag. It may need to be re-enabled.

Viewing a plot in an editor would render the progress bar in the middle, behind the plot image. Trigger a render by resizing the editor or changing the sizing policy in the Plots View.

Resizing a plot in editor or the Plots View would create another progress bar. If a render is triggered while one is already in progress, the old progress bar may not be set to done so it looks like a render is always in progress.

Show progress bar at top of editor
Remove old progress bars before new render
Copy link
Contributor

@isabelizimm isabelizimm left a comment

Choose a reason for hiding this comment

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

renderplot.mov

progress bar is where i expect it to be!

Copy link
Contributor

@seeM seeM left a comment

Choose a reason for hiding this comment

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

Just a small comment on the code since @isabelizimm already verified the behavior.

// Before starting a new render, remove any existing progress bars. This prevents
// a buildup of progress bars when rendering multiple times and ensures the progress bar
// is removed when a new render is requested before the previous one completes.
progressRef.current.replaceChildren();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we maintain a single progress bar and ensure that done()/hide() are called at the correct times rather than deleting and recreating the DOM nodes? This seems fine as is though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this might be more complicated with the timing to create the progress bar once the ref to the parent div is available. I'll see if I can follow up with something if it isn't too complicated.

@timtmok timtmok merged commit 2c7fa4e into main Sep 25, 2024
3 checks passed
@timtmok timtmok deleted the bugfix/plot-progress-bar branch September 25, 2024 21:14
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants