Repository navigation
Build a Log row from fewer nodes - #41
Merged
Merged
Conversation
A list builds and measures every node of a row as it scrolls in, and on the phone that is most of what a scroll stall is. A plain commit row was 40 nodes, eight deep, many of them wrappers that only padded or placed the one thing inside them. It is now 31, six deep, and looks the same. - The row's pressable lays itself out as a row instead of holding one. - The 64pt gutter is the content column's left margin, not an empty column, and the hairline is that column's bottom border, so the two nested columns are one. The bottom padding takes the hairline's 1pt. - Each action button is the pressable itself, laid out as a row. More keeps its column, since a menu pressable draws its content at its own size in the corner of its box. - The rail places the avatar's pressable, or the node itself, instead of wrapping it in a column to position it. - The avatar ring is a lane border on a surface disc, and a filled dot is a lane centre with a 3pt surface border, each one view fewer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge with main kept main's star button, which still had a row inside the pressable. Main now lets you star your own commits, so the star-count row is gone and the star is one pressable for everyone. This makes it a flex-row pressable like the other buttons, and keeps main's updated logOf fixture in CommitCardTest with this branch's tap-target lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main dropped Save commit from More, so the row in CommitCardTest is 47 nodes wrapped the old way and 35 flattened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 tasks
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.
On Simon's iPhone 16 Pro (Release) the long scroll stalls are mostly SwiftUI measuring and building Log rows as they scroll in:
FlexContainer.sizeThatFitsis about a third of them and row view-graph creation about a sixth. Every node in a row is another layout pass there, and more PHP render and serialise time here. Many of a row's nodes were wrappers that only padded or placed the one thing inside them, so this takes them out without changing how the row looks.flex-row) instead of holding one.Nodes per row, counted from the published frame in the test harness (
Native::visit('/log')), against main as of #38:Depth goes from 8 to 6. A five-row Log frame goes from 328 nodes to 261. Three of each row's nodes are More's menu items, which aren't views.
Screenshots
iPhone 17 Pro simulator, iOS 27, both builds from the same native project and the same canned API, relaunched for each shot.
Pixel diff of the full-resolution screenshots: 142 to 459 pixels differ out of 3.2 million, none by more than 5.5%. All of them are where the rail line meets an avatar ring, where the ring's surface disc now anti-aliases over the line. I tried keeping the lane disc outside for avatars too, but then the avatar's wash and the gap's border share an edge and about 1,800 pixels change round every ring, so avatars keep the bordered surface disc. Dots keep the lane disc outside and come out identical.
Things to look at
CommitCardTestandQuoteTestread a button's tap target from the pressable now that there's no row inside it, andAccountProfileTestreads the ring colour from its border. A newCommitCardTestcase checks the row's shape and that a row with stars and replies stays at 35 nodes or fewer (it was 47).rail-nodeandrail-avatartake$positionand$nodeRefrather than$classand$ref. Blade includes inherit the parent's variables, andrail-loadingalready has a$ref, so the rail would have given its end dot the skeleton's ref.🤖 Generated with Claude Code