Skip to content

fix: Fix missing scrim background on LoadingOverlay#2098

Merged
vbabich merged 3 commits intodeephaven:mainfrom
vbabich:fix_missing_scrim
Jul 9, 2024
Merged

fix: Fix missing scrim background on LoadingOverlay#2098
vbabich merged 3 commits intodeephaven:mainfrom
vbabich:fix_missing_scrim

Conversation

@vbabich
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread packages/components/src/LoadingOverlay.tsx Outdated
@vbabich vbabich requested a review from mofojed July 8, 2024 14:25
@codecov
Copy link
Copy Markdown

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
@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