Skip to content
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

Use a VStack on the timeline #332

Merged
merged 3 commits into from
Nov 22, 2022
Merged

Use a VStack on the timeline #332

merged 3 commits into from
Nov 22, 2022

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Nov 22, 2022

This PR switches from a LazyVStack to a regular VStack for the timeline. This fixes various issues seen with the lazy stack not being able to properly estimate its content size (more specifically that is doesn't seem to cache previous item heights as part of this estimate).

ReversedScrollView has been customised to be specific for the timeline and renamed accordingly.

One tradeoff of this change is that memory usage will be higher than a LazyVStack when back paginating a lot in a room. In my testing an heavy amount of back pagination (mainly text items) resulted in around 500MB of memory usage which doesn't seem unworkable, but in the future we could put a limit on the number of items shown and start removing items as you scroll back.

@pixlwave pixlwave force-pushed the doug/timeline-vstack branch from 4ea4efb to 80a392f Compare November 22, 2022 12:28
@github-actions
Copy link

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consinder using them for better tracking.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 80a392f

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pixlwave pixlwave requested a review from stefanceriu November 22, 2022 12:31
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Base: 32.40% // Head: 32.29% // Decreases project coverage by -0.11% ⚠️

Coverage data is based on head (80a392f) compared to base (6c2ea61).
Patch coverage: 39.28% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #332      +/-   ##
===========================================
- Coverage    32.40%   32.29%   -0.12%     
===========================================
  Files          266      267       +1     
  Lines        17530    17593      +63     
  Branches      9617     9671      +54     
===========================================
  Hits          5681     5681              
- Misses       11677    11738      +61     
- Partials       172      174       +2     
Flag Coverage Δ
unittests 13.64% <0.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...omScreen/View/Timeline/ImageRoomTimelineView.swift 0.00% <0.00%> (ø)
...omScreen/View/Timeline/VideoRoomTimelineView.swift 0.00% <0.00%> (ø)
...s/Screens/RoomScreen/View/TimelineScrollView.swift 0.00% <0.00%> (ø)
...ces/Screens/RoomScreen/View/TimelineItemList.swift 49.50% <59.01%> (-3.65%) ⬇️
...Sources/Screens/RoomScreen/View/TimelineView.swift 51.28% <88.88%> (-5.87%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! 🚀

@pixlwave pixlwave merged commit 5c4ca74 into develop Nov 22, 2022
@pixlwave pixlwave deleted the doug/timeline-vstack branch November 22, 2022 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants