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: Empty notifications height #2810

Closed
wants to merge 4 commits into from

Conversation

georgylobko
Copy link
Contributor

@georgylobko georgylobko commented Oct 4, 2024

Description

This issue arises when the notifications in the refresh-toolbar theme are empty. The current implementation relies on the :not(:empty) CSS property, which doesn't work because the notifications DOM node is always present, even when there are no notifications. In this PR, I updated the calculation to match how it's handled in the refresh theme

image

Related links, issue #, if available: n/a

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.18%. Comparing base (ca1cd89) to head (9db850f).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2810      +/-   ##
==========================================
- Coverage   96.19%   96.18%   -0.01%     
==========================================
  Files         761      761              
  Lines       21408    21411       +3     
  Branches     7310     6927     -383     
==========================================
+ Hits        20593    20595       +2     
- Misses        762      808      +46     
+ Partials       53        8      -45     

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

@georgylobko georgylobko marked this pull request as ready for review October 4, 2024 14:50
@georgylobko georgylobko requested a review from a team as a code owner October 4, 2024 14:50
@georgylobko georgylobko requested review from taheramr and just-boris and removed request for a team October 4, 2024 14:50
@georgylobko georgylobko marked this pull request as draft October 7, 2024 08:07
@@ -377,7 +379,7 @@ const AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLa
{!hasToolbar && breadcrumbs ? <ScreenreaderOnly>{breadcrumbs}</ScreenreaderOnly> : null}
<SkeletonLayout
style={{
[globalVars.stickyVerticalTopOffset]: `${verticalOffsets.header}px`,
[globalVars.stickyVerticalTopOffset]: `${verticalOffsets.header}px + ${resolvedStickyNotifications && notificationsHeight > 0 ? tokens.spaceXs : '0px'}`,
Copy link
Contributor Author

@georgylobko georgylobko Oct 7, 2024

Choose a reason for hiding this comment

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

You may ask why this space is calculated here, not in the computeVerticalLayout or not just calculate it as part of notifications height.

There are 2 reasons:

  1. Since now notifications height includes only actual content size, not the wrapper size, we need to take this space somewhere
  2. It's not feasible to include this to computeVerticalLayout, because tokens.spaceXs is not a number, but css token (string)

If you have a suggestion how to implement it better, let's discuss it in this thread

@just-boris
Copy link
Member

Temporarily addressed here #2821, closing this one for now as no urgent need

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.

3 participants