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: Fix missing scrim background on LoadingOverlay #2098

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

vbabich
Copy link
Collaborator

@vbabich vbabich commented Jun 21, 2024

Background class wasn't applied when LoadingOverlay has error or is loading

@vbabich vbabich self-assigned this Jun 21, 2024
@vbabich vbabich requested a review from mofojed June 21, 2024 17:36
@vbabich vbabich added the bug Something isn't working label Jun 21, 2024
@vbabich vbabich added this to the June 2024 milestone Jun 21, 2024
@vbabich vbabich removed the bug Something isn't working label Jun 21, 2024
@vbabich vbabich enabled auto-merge (squash) June 21, 2024 17:37
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

I believe not having an overlay in this case was intentional - the scrim changes the colour unnecessarily of the panel if it hasn't loaded a widget yet.
What ticket are we fixing here? This is for the error covering a dashboard?

@vbabich
Copy link
Collaborator Author

vbabich commented Jul 3, 2024

I believe not having an overlay in this case was intentional - the scrim changes the colour unnecessarily of the panel if it hasn't loaded a widget yet. What ticket are we fixing here? This is for the error covering a dashboard?

This is for DH-16180 where I need a spinner with an overlay while the panel content is updating.
I see that we do something like this in a couple of places:

<LoadingOverlay isLoading={showSpinner} isLoaded={!showSpinner} ... />

This displays the spinner without the overlay, then on the fade-out the black overlay is shown for a split second, so there's a bit of a flicker.

I guess the right usage should be just <LoadingOverlay isLoading={showSpinner} /> to show the spinner without the overlay, and <LoadingOverlay isLoaded isLoading={showSpinner} /> to show the spinner with the overlay. In that case, my change isn't needed.

For my use case, Don suggested adding a background-colored overlay immediately with no fade-in, and do a quick fade-out when loaded. I'm going to update the PR to parameterize background color, fade-in, and fade-out duration.

@vbabich
Copy link
Collaborator Author

vbabich commented Jul 3, 2024

Still, I think flickering the overlay when we change isLoading to false and isLoaded to true isn't right.

@vbabich vbabich requested a review from mofojed July 8, 2024 14:25
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.63%. Comparing base (a30341a) to head (8c8de5e).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2098      +/-   ##
==========================================
+ Coverage   46.59%   46.63%   +0.03%     
==========================================
  Files         679      682       +3     
  Lines       38598    38443     -155     
  Branches     9779     9580     -199     
==========================================
- Hits        17986    17928      -58     
+ Misses      20560    20505      -55     
+ Partials       52       10      -42     
Flag Coverage Δ
unit 46.63% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vbabich vbabich merged commit c9ed895 into deephaven:main Jul 9, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 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.

2 participants