-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix library scroll issue - part 1 #1117
Conversation
} | ||
|
||
@ViewBuilder | ||
var articleActions: some View { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this became: ArticleActions
} | ||
|
||
@ViewBuilder | ||
var supplementaryActions: some View { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this became: CopyPasteMenu
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1117 +/- ##
==========================================
- Coverage 35.07% 34.81% -0.27%
==========================================
Files 135 137 +2
Lines 7808 7868 +60
==========================================
Hits 2739 2739
- Misses 5069 5129 +60 ☔ View full report in Codecov by Sentry. |
Mostly fixing the issue: #1116
There were 2 main issues:
ViewModifier
within aForEach
loop. It was hard to track down, but the possible explanation for this, is that SwiftUI needs to see the view hierarchy tree in order to make performant diffs between states. Now it seems that the formerViewModifier
was erasing too heavily the type of the underlying views, and the performance got worse. Solution is to use view composition instead of view modifier.The good news is that it performs a lot better now.
There needs to be a part 2 fix for this as well. There's a "micro hang" on a freshly installed app, when scrolling the new section. This is mainly due to the icon loading and saving to the DB at the same time, for which I do have some solutions, but they are not final yet, so will leave them to a new PR.
Managed to add back the animations as well, and it works great:
news_with_animation.mov