-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Animate status bar max-height and margin-top #2981
Conversation
When collapsed, the max-height is set to 0px. When expanded, max-height is set to 50px, margin-top is set to 0px. When expanded and when the timeline is not scrolled down to the bottom, margin-top is set to -50px to offset the change in height, keeping it at the same scroll position. Without the animation, there would be a jump when the user starts scrolling up from the bottom whilst the StatusBar is expanded.
I'm wondering whether we should animate adding event tiles to the timeline itself, or at least the sticky scroll position so that the timeline doesn't suddenly jump. |
(optionally) animating addition of roomtiles too would be lovely eyecandy, although i'd do it as a separate PR. |
this is almost perfect :D Slightly weird things:
|
@@ -202,6 +202,25 @@ hr.mx_RoomView_myReadMarker { | |||
width: 100%; | |||
-webkit-flex: 0 0 auto; | |||
flex: 0 0 auto; | |||
|
|||
max-height: 0px; | |||
background-color: #fff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use $primary-bg-color or whatever the variable is in our brave new SCSS world
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something I might have to merge in to get that to work? I've got npm start:css
running, but it doesn't seem to be doing SCSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might have to be done as a separate PR because this was branched prior to scss stuff.
z-index: 1000; | ||
overflow: hidden; | ||
|
||
-webkit-transition: all .5s ease-in-out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per main comment, suggest .2s
} | ||
|
||
.mx_RoomView_statusArea_expanded.mx_RoomView_statusArea_mid_timeline { | ||
margin-top: -50px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm. this is almost a beautiful hack, but it does result in a weird "inertial scrolling transition when you scroll from middle to bottom of timeline whilst the statusbar is visible. Feels like there should be a way to skip the transition in that scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ease-out
instead of ease-in-out
on .mx_RoomView_statusArea
seems to make this weird inertia feel less weird. Ideally we would do the transition based on the scroll position of the scroll view... or lose the _mid_timeline
class earlier on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or lose the _mid_timeline class earlier on.
would require some major threading-through of a theoretical isNearlyAtBottom
on ScrollPanel of react sdk
@lukebarnard1: is this meant to be back with me? I was assuming that a possible correct fix for the weird scrolling would be to always have the status bar |
@ara4n If we animate the gap at the bottom of the screen, then we change the position of events in the timeline. This is fine when we're scrolled down to the bottom but not when we're mid-timeline. So however we manage it, we have to treat being mid-timeline differently. |
From the files of
|
OK, so for now we shall
This will mean removing the CSS to change margin-top |
lgtm! |
When collapsed, the max-height is set to 0px. When expanded, max-height is set to 50px, margin-top is set to 0px. When expanded and when the timeline is not scrolled down to the bottom, margin-top is set to -50px to offset the change in height, keeping it at the same scroll position.
Without the animation, there would be a jump when the user starts scrolling up from the bottom whilst the StatusBar is expanded.
Complements matrix-org/matrix-react-sdk#615