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

Try: Add animation to sidebar. #13635

Merged
merged 4 commits into from
Feb 12, 2019
Merged

Try: Add animation to sidebar. #13635

merged 4 commits into from
Feb 12, 2019

Conversation

jasmussen
Copy link
Contributor

This is another "Try" branch for an animation. This animates in the sidebar. See also #13617

sidebar animation

What do you think? This one I feel less certain about.

@jasmussen jasmussen added the Needs Design Feedback Needs general design feedback. label Feb 1, 2019
@jasmussen jasmussen self-assigned this Feb 1, 2019
@jasmussen jasmussen requested a review from a team February 1, 2019 11:30
@youknowriad
Copy link
Contributor

This could use the same component from the other PR. what do you think?

@jasmussen
Copy link
Contributor Author

If we dig it, absolutely it should! I'll rebase and make it happen if/when the other one ships.

I'll also update the Publish dialog, which uses the same animation.

@kjellr
Copy link
Contributor

kjellr commented Feb 1, 2019

This is great. Definitely an improvement.

It seems a little weird to me that while the sidebar slides in, the content next to it abruptly pops over. But I figure it'd be fairly un-performant to animate all that content, too. 😄 The action here is all about the sidebar, so I think it's fine as is.

I am seeing one bug though — the menu isn't appearing at all for me on smaller breakpoints:

sidebar

mapk
mapk previously requested changes Feb 5, 2019
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.

Really nice animation! Can't wait to get this in. I did experience the same issue Kjell found for the smaller screens as well though. After that bug fix, LGTM.

@jasmussen
Copy link
Contributor Author

Just as an update, I'm waiting for #13617 to land before rebasing and fixing up this one.

@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 7, 2019
@youknowriad
Copy link
Contributor

Can we rebase this and try the "Animate" component?

@jasmussen
Copy link
Contributor Author

Rebased this, but I won't have time to look into the animate component today as I have some other things I need to wrap. But if you have a bunch of time, feel free to commandeer this PR 👍 👍

@youknowriad youknowriad self-assigned this Feb 8, 2019
@gziolo gziolo added General Interface Parts of the UI which don't fall neatly under other labels. and removed Needs Design Feedback Needs general design feedback. labels Feb 8, 2019
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

I wanted to double check whether we can remove some code which might be now handled inside Animate component.


body.is-fullscreen-mode & {
top: 0;
}
}
}

@keyframes edit-post-layout__slide-in-animation {
@keyframes edit-post-post-publish-panel__slide-in-animation {
Copy link
Member

Choose a reason for hiding this comment

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

It's exactly the same as @keyframes components-animate__slide-in-animation {. Is it still necessary?

@@ -173,15 +173,15 @@
width: $sidebar-width;
border-left: $border-width solid $light-gray-500;
transform: translateX(+100%);
animation: edit-post-layout__slide-in-animation 0.1s forwards;
animation: edit-post-post-publish-panel__slide-in-animation 0.1s forwards;
Copy link
Member

Choose a reason for hiding this comment

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

How does it differ from .components-animate__slide-in?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's not ideal, but since the animation is not inheritant to the panel itself but more to the fact that it's used as a sidebar by the edit-post module, it doesn't make sense to introduce the component inside the panel, which makes this issue harder to solve. I decided to keep the CSS for this particular panel for now.

@gziolo
Copy link
Member

gziolo commented Feb 8, 2019

Travis seems to be very unhappy about this animation. It looks like we need to land #13769 first before we can proceed. In the meantime, this could use a review from someone who can ✅ UI part of the PR. Code wise it looks good. Nice work @jasmussen and @youknowriad. I really like this new Animate component and the way how it can simplify usage and unify behaviors for future work.

@youknowriad
Copy link
Contributor

This might need some tweaks for RTL, I need to check.

@youknowriad youknowriad deleted the try/sidebar-animation branch February 12, 2019 08:37
@jasmussen
Copy link
Contributor Author

HAH you just merged :D :D — good, because I was about to 👍 👍

@jasmussen
Copy link
Contributor Author

I had some additional enhancements but they are a bit sensitive so I decided to make a separate PR for them. Thanks so much for your help, Riad!

@afercia
Copy link
Contributor

afercia commented Feb 16, 2019

Looking a bit into this, I've noticed a couple things:

The sidebar animation happens also on page load:

  • edit an existing post or create a new one
  • if the sidebar is set to be open, the animation runs on page load (also when you refresh the page)

Is this intentional? Doesn't seem ideal to me: I don't see why users should see an animation every time they open the edit post page. Note: for some reason, this is more evident in Firefox and Safari, especially when the post has some long content.

More importantly: on Windows the vertical scrollbars are always visible. Whether users open the edit post page or toggle the sidebar, the visual effect is not so great:

  • test with a post with some long content (so there's a vertical scrollbar)
  • toggle the sidebar to make it appear
  • the vertical scrollbar appears immediately, delimiting the sidebar area
  • the sidebar area is not fully taken by the sidebar content yet, which is being animated

Basically, for a fraction of a second users see an empty column with a vertical scrollbar. I've tried to make an animated GIF to better illustrate, but some frames get removed and it doesn't give a clear idea of the actual visual effect, which is not nice to see.

/Cc @jasmussen @youknowriad

@kjellr
Copy link
Contributor

kjellr commented Feb 18, 2019

Thanks, @afercia!

The sidebar animation happens also on page load:

Yeah, this is also the case for our fullscreen load animation. I wonder if there's a way we can assign these animation classes only after the page's been fully loaded... 🤔

I've opened #13925 to track this.

Basically, for a fraction of a second users see an empty column with a vertical scrollbar. I've tried to make an animated GIF to better illustrate, but some frames get removed and it doesn't give a clear idea of the actual visual effect, which is not nice to see.

This happens on Mac too, if you have scrollbars enabled:

reload

(I slowed down the animation quite a bit to make sure it got picked up by the GIF, but this gets the general idea across)

I'm not sure if we can do anything about this, but I've opened #13926 to track it.

youknowriad pushed a commit that referenced this pull request Mar 6, 2019
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
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
General Interface Parts of the UI which don't fall neatly under other labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants