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

Make notices push down content #13614

Merged
merged 3 commits into from
Feb 14, 2019
Merged

Conversation

jasmussen
Copy link
Contributor

This PR restores the good stuff from #12301. That is: it allows notices to push down content. Dismissible notices are sticky at the top, non-dismisible notices scroll out of view.

This is mostly an exact copy of the other PR, but fresh. The behavior has a number of benefits:

  • If you have multiple non-dismissible notices, you can still actually use the editor.
  • Notices no longer cover the scrollbar.
  • Notices no longer cover the permalink interface.
  • Notices now only cover content if you do not dismiss the notices.

Fixes #7276.

GIFs:

desktop

mobile

screenshot 2019-01-31 at 11 58 01

@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Package] Notices /packages/notices labels Jan 31, 2019
@jasmussen jasmussen self-assigned this Jan 31, 2019
@jasmussen jasmussen requested review from youknowriad, aduth and a team January 31, 2019 11:00
@jasmussen
Copy link
Contributor Author

Please read also review points on #12301, as some of them still apply.

@jasmussen
Copy link
Contributor Author

This also mitigates the situation in https://core.trac.wordpress.org/ticket/46098#comment:6.

Copy link
Contributor

@mapk mapk left a comment

Choose a reason for hiding this comment

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

This worked great for me. Both dismissible and non-dismissible notices performed as expected. The scrolling of content behind dismissible notices, but not behind non-dismissible notices was a good experience.

@jasmussen jasmussen added this to the 5.1 (Gutenberg) milestone Feb 5, 2019
@jasmussen jasmussen requested a review from a team February 5, 2019 08:13
@jasmussen
Copy link
Contributor Author

Nice, thank you. I put this in a milestone and expanded the review range for a code review.

@aduth
Copy link
Member

aduth commented Feb 8, 2019

In Firefox, I see an issue at the medium range viewport size (~970px).

Using: [ ...Array( 3 ) ].forEach( () => wp.data.dispatch( 'core/notices' ).createInfoNotice( 'Not dismissible', { isDismissible: false } ) )

image

This PR restores the good stuff from #12301. That is: it allows notices to push down content. Dismissible notices are sticky at the top, non-dismisible notices scroll out of view.

This is mostly an exact copy of the other PR, but fresh. The behavior has a number of benefits:

- If you have multiple non-dismissible notices, you can still actually use the editor.
- Notices no longer cover the scrollbar.
- Notices no longer cover the permalink interface.
- Notices now only cover content if you do not dismiss the notices.
@jasmussen
Copy link
Contributor Author

Noticed an issue with this branch that isn't fixed:

cover sticky

Notice how the sticky notice covers the block toolbar.

However, compare to master:

master

It's even worse there.

For that reason, I feel like it would still be good to ship this as an improvement.

@jasmussen
Copy link
Contributor Author

Looking into the issue, thanks Andrew. It's not Firefox specific, it's because of the top toolbar.

@jasmussen
Copy link
Contributor Author

Solid catch, Andrew. Turns out there was a lot of old cruft there that was vestigial and could be killed entirely. So the most recent commit should fix issues even in master:

breakpoints

I think this should be good for a final review.

jasmussen pushed a commit that referenced this pull request Feb 12, 2019
This PR tries to add additional animation when the sidebar open/closes. Specifically, it now animates the right-margin in lockstep with the sidebar opening and closing. This causes the main body content to animate, just like the sidebar, for a nicer experience.

However in order to be performant, this means we add `will-change: transform;` to the .edit-post__layout-content`. This is causing an issue with the notices, which will be moot when #13614 gets merged, so *this PR is dependant on that landing first*.

Secondly, although it's a small PR, the addition of the will-change property is likely going to need a lot of testing so it doesn't cause regressions. Things to look for are absolute, fixed, or sticky position elements and the like. In my own testing, only the notices regressed which as mentioned gets fixed when 13614 lands. But this will still need a lot of eyes.
@jasmussen
Copy link
Contributor Author

Thanks all for the reviews, I think this is good to go when the checks pass.

@jasmussen jasmussen merged commit 6991141 into master Feb 14, 2019
@jasmussen jasmussen deleted the try/restore-notices-push-content branch February 14, 2019 06:22
@irishetcher
Copy link

That would be an improvement. It's a bit jarring to have the title covered. Thanks for letting me know.

youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Make notices push down content

This PR restores the good stuff from #12301. That is: it allows notices to push down content. Dismissible notices are sticky at the top, non-dismisible notices scroll out of view.

This is mostly an exact copy of the other PR, but fresh. The behavior has a number of benefits:

- If you have multiple non-dismissible notices, you can still actually use the editor.
- Notices no longer cover the scrollbar.
- Notices no longer cover the permalink interface.
- Notices now only cover content if you do not dismiss the notices.

* Address top toolbar issues.

* Remove the overly specific is-pinned.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Make notices push down content

This PR restores the good stuff from #12301. That is: it allows notices to push down content. Dismissible notices are sticky at the top, non-dismisible notices scroll out of view.

This is mostly an exact copy of the other PR, but fresh. The behavior has a number of benefits:

- If you have multiple non-dismissible notices, you can still actually use the editor.
- Notices no longer cover the scrollbar.
- Notices no longer cover the permalink interface.
- Notices now only cover content if you do not dismiss the notices.

* Address top toolbar issues.

* Remove the overly specific is-pinned.
This was referenced Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Notices /packages/notices [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants