MissingCore / Music

A Nothing inspired local music player.
GNU Affero General Public License v3.0
216 stars 13 forks source link

fix: Snapping on `<AnimatedHeader />` #20

Closed cyanChill closed 4 months ago

cyanChill commented 4 months ago

Why

When switching over to the new settings route UI design, we encountered a flaw with <AnimatedHeader /> in which we didn't account for the height of the content during the snapping animation. For example, if we reach the snap threshold, but the content isn't large enough, we might end up with the title sticking out from underneath the header, displaying an "incomplete" animation.

How

With our original design, we provided a fix bottom padding, in which all screens that used the <AnimatedHeader /> would have a 32px bottom padding. This of course, doesn't fix the mentioned issue. The solution is to dynamically increase this padding to ensure that we provide enough to allow the snapping animation to complete.

Flawed Behavior Fix
Displays flow with `<AnimatedHeader />` component in which the title peaks out from underneath the header. Demonstrates the dynamic padding being added to the content.

Test Plan

Go to any of the /third-party/[id] routes and see that the snapping animation is completed completely.

Checklist