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
This commit implements a way to save the scroll position within a
timeline. It does that by assigning each note in the timeline an ID
based on the NoteID, and adding a `scrollPosition` modifier along with
SceneStorage to keep track of and persist the scroll position along the
timeline view throughout a single app session.
Notes:
- Scroll position is not persisted across app restarts. When the user
completely quits the app, scroll position is lost.
- This works on home feed and universe view. However, due to how
Universe view is dynamically loaded, performance may not be as good as
on the home feed
- This only works on iOS 17 and higher, since the necessary scroll
position reading mechanism is only available in those versions. On
older versions things should work as before this change.
Testing
-------
PASS
Damus: This commit
iOS: 17.6.1
Device: iPhone 13 mini
Steps:
1. Scroll down home feed to a note with a memorable image
2. Switch to the notifications tab
3. Switch back to the home tab. Ensure scroll position is at the memorable image (or close). PASS
4. Navigate into another profile from the home feed
5. Go back to the home feed by clicking the "back" button on the top
left. Ensure scroll position is preserved. PASS
6. Navigate into another profile from the home feed again.
7. Go back to the home feed by clicking the home button at the bottom
tab bar. Ensure scroll position is preserved. PASS
8. Click on the home button at the bottom tab bar while at the home
feed. You should be taken to the top. PASS
Backwards compatibility testing
-------------------------------
PASS
Damus: This commit
iOS: 16.4
Device: iPhone SE simulator
Steps:
1. Navigate through the home feed, navigate between tabs
2. Ensure there are no visible regressions on navigation. PASS
Changelog-Fixed: Fixed situations where scroll position would be lost (iOS 17 only)
Closes: damus-io#751
Signed-off-by: Daniel D’Aquino <[email protected]>
0 commit comments