Repository navigation
Keep skeleton rows still on the pages you can't see - #32
Merged
Merged
Conversation
The Log and Profile pagers lay out the pages beside the one you're on, and their skeleton rows pulsed there forever. SwiftUI keeps redrawing a looping animation even off screen, and every so often it holds the main thread on its lock while it does. Only the page you're on pulses now. The pulsing column has a key that changes with it, so a page you swipe to gets a fresh view whose loop starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Log and Profile pagers lay out the pages beside the one you're on, and the skeleton rows on those pages pulsed forever. A preview page nearly always has one: the row for the commits past its first five, or three of them when nothing is kept. SwiftUI keeps running a looping animation even when its view is off screen, so while the Log was open its async renderer drew frames continuously and, every so often, held the main thread on SwiftUI's lock while it did.
Now only the page you're on pulses.
rail-loadingtakes apulseflag, and the Log and Profile pages passshowing. A loop only starts when its view appears, so the pulsing column has a key that changes with the flag. A page you swipe to gets a fresh view whose loop starts, instead of keeping the still one.What it does and doesn't fix
I found this while chasing the scroll stutter on the Log. Sampling the app sitting idle on Latest (simulator, Debug), the main thread spent 220 of about 5,000 samples blocked on that lock. With this change that's zero, and SwiftUI's renderer goes quiet.
It's not the main cause of the stutter, though. On the simulator, dropped frames while flinging the list are the same as before (19 to 25 in either build), and about 5% fewer during load more. The bigger costs are measuring and building rows as they come into view, and the stall each time a new page lands. Those are in core and I'm still on them.
Testing
LogCacheTest: the log you're on has a pulsing skeleton, the page beside it doesn't, and aftershowPageit's the other way round. It fails onmain. The full suite passes (1004 tests).🤖 Generated with Claude Code