forked from damus-io/damus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 iOS 16 regression 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]>
- Loading branch information
1 parent
3902fe7
commit 7f0f577
Showing
2 changed files
with
99 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters