You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d7e6034
Browse filesBrowse the repository at this point in the historyBrowse files
Profile expansion: the background bounces with the content
The open's spring overshoots past rest, and everything lent to the transition rides it: the avatar, the title and
status, the buttons and the page below the header went 10 pt past their places and came back. The cover is not lent
to move, only clipped at the page's top (pageEdgeViews), and the edge's rule held its gradient and pattern still the
whole way, so they stood still while everything on them bounced.
What a page edge shows now holds still only while the page comes in from above (so the cover still never sticks out
below it) and lands with the page past its place: the edge's sublayer counter-translation is -min(page, 0) instead of
-page. The gifts around the avatar, which were only faded, are the loan's new landingViews, which take only the
page's overshoot. The cover's gradient view already reaches 1000 pt above it, so moving it down shows no gap. The close
and the way in never overshoot downward, so they are unchanged.
Measured on the simulator, tracking the name, the buttons and the cover pattern through the overshoot: before, the
pattern stayed at 0 while the name and buttons went to +10 pt and back; after, it follows them (9/8, 7/7, 5/4, 2/2,
0/0 pt, pattern/name).
Tests: NavigationExpansionRendererTests test_pageEdge_ridesThePage_contentLandsWithIt and test_pageEdge_keyframed
(rewritten for the new rule, failing before the fix), test_landing_takesOnlyThePagesOvershoot (new). Three tests in
the suite fail before and after this change: test_begin_atZero_showsThePill,
test_models_areTheLastKeyframes_afterTheTint and test_platters_appearWithTheirButtons still read alpha and the old
keyframes after e686160 moved the renderer to an opacity-holding animation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: submodules/TelegramUI/Components/NavigationExpansionTransition/Sources/NavigationExpansionRendererImpl.swift
+13-10Lines changed: 13 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -112,13 +112,15 @@ public final class NavigationExpansionRendererImpl: NavigationExpansionRenderer
112
112
letrest:CATransform3D
113
113
}
114
114
privatevarfollowers:[Follower]=[]
115
-
/// A view of the page below the header (`NavigationExpansionDestinationLoan.pageViews`, `pageEdgeViews`), measured
116
-
/// before anything is lent: how many screen points one of its superlayer's points is, vertically, and its own
117
-
/// transform.
115
+
/// A view of the page below the header (`NavigationExpansionDestinationLoan.pageViews`, `pageEdgeViews`,
116
+
/// `landingViews`), measured before anything is lent: how many screen points one of its superlayer's points is,
117
+
/// vertically, and its own transform.
118
118
privatestructPageRider{
119
119
letlayer:CALayer
120
120
letunit:CGFloat
121
121
letrest:CATransform3D
122
+
/// A landing view's (`landingViews`): it takes only the page's overshoot past its resting place.
123
+
letlandsOnly:Bool
122
124
/// An edge's (`pageEdgeViews`): how many screen points one of its own points is, vertically, and its own sublayer
123
125
/// transform, which takes its content back to where it stands.
124
126
letcontent:(unit:CGFloat,rest:CATransform3D)?
@@ -205,14 +207,14 @@ public final class NavigationExpansionRendererImpl: NavigationExpansionRenderer
Copy file name to clipboardExpand all lines: submodules/TelegramUI/Components/NavigationExpansionTransition/Tests/NavigationExpansionRendererTests.swift
+60-11Lines changed: 60 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ private final class FakeDestination: NavigationExpansionDestinationProviding {
72
72
varpageViews:[UIView]=[]
73
73
/// Views clipping at the page's top edge (the profile's cover).
74
74
varpageEdgeViews:[UIView]=[]
75
+
/// The rest of the background, landing with the page (the profile's gifts around its avatar).
0 commit comments