-
-
Notifications
You must be signed in to change notification settings - Fork 657
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
Clean animatedScaleComponent and decide consistently whether to show unread notice or not. #3027
Conversation
be87674
to
97a0624
Compare
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.
@borisyankov Updated!
97a0624
to
72b8be0
Compare
The code looks reasonably correct at first glance. Good job! What needs a bit more work here are the commit messages. |
72b8be0
to
dd1f35a
Compare
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.
@borisyankov Updated! 👍
On my local, order of commits is like
Edit: Before rebasing, Github UI was showing different order.
dd1f35a
to
322a9e7
Compare
If the component is not visible, then due to animated style it's scale is 0 which is causing a sudden splash of the children for a moment. A solution for such sudden splash was introduced in 0baca8f. Now using the same logic make it generic so that it will be applicable to all other components which are using `AnimatedScaleComponent`. `AnimatedScaleComponent` is also used by `UnreadNotice`: In the `AnimationScaleComponent` we have been taking help of `display` property (which acts same as it does in CSS), for same purpose. So when visible is false, we were making display none just after animation ends. Thus making it's size 0. Now when visible becomes false, we will not be rendering anything inside animation component and size thus will be 0. Thus no need to display propery. Basically this is a alternative of using display property. So next `display` can be removed. It's advantage over that is, it will result in smooth transition. Before when visible becomes false, it scale down but height/size remains same (resulting in white space) and as soon as animations get's over it change display to none thus resulting in a sudden change.
This was introduced in 0baca8f. In the previous commit this logic is being handled in the `AnimatedScaleComponent` itself, so removing it from here.
It works same as it works in CSS. There is no use of such property in animation component, as they result in a sudden change. It was used to make size 0 whenever component is not supposed to show. But if there is nothing to show then it's size will be automatically 0. This will not cause any issue. It has been used in unread notice and autocomplete popup. Refer previous commit, which is a better alternative for this in unread notice. For autocomplete, when it is not suppossed to pop, it's children will be null and nothing will be rendered. Thus taking no space (refer 0baca8f). Part of zulip#2943.
322a9e7
to
9b45beb
Compare
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.
@gnprice @borisyankov Let's review this too, so that autocomplete pop up animations starts working. :)
Thanks @jainkuniya ! Have you tried out this branch with each of the UIs it affects? I took a quick look:
(Curious also what thoughts @borisyankov has.) |
Closing this, as this is now in stale state. |
No description provided.