Repository navigation
Conversation
A new element for long feeds that change often. On iOS it is a ScrollView with a LazyVStack, and each child is identified by its node id. native:list is a SwiftUI List, and a List gets slower with every row inserted into it. In the heimdall firehose (60 keyed inserts a second, capped at 1,000 rows) a List update cost about 10 ms after 100 inserts and 250 to 600 ms once full. The same rows in a lazy stack stayed at about 5.5 ms of main-thread time per update and 60 fps through 3,600 inserts on the simulator. It is deliberately small: children, gap-* spacing, the usual padding and background, a content-padding attribute that pads the scrolled content, and shows-indicators. No separators, swipe actions, pull-to-refresh, sections or row callbacks. native:list is unchanged. A child added above the screen doesn't move what the reader is looking at: scrollPosition keeps the top child in place. A reader at the very top is scrolled back to the top so new children show. Android has no renderer of its own yet. The manifest points it at the scroll view's renderer, which ignores content-padding. 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.
Adds
<native:lazy-stack>(typelazy_stack), a new element for long vertical lists that change often. It's aScrollViewwith aLazyVStack, and each child is identified by its node id.native:listis not touched.SwiftUI's
Listgets slower with every row inserted into it. On the heimdall firehose (60 new rows a second, capped at 1,000), eachListupdate went from about 10 ms to 250 to 600 ms within a minute. Withlazy-stackthe same run stayed at 60 fps, and each update took about 5.5 ms on the main thread, flat after the cap. On a real iPhone it stayed smooth all the way through and the scroll position held.What it supports
gap-*between children, plusp-*andbg-*like any element (dark_bg_colortoo).content-padding, 1 to 4 values like CSS. Server screens send it ascontentPadding.shows-indicators.It leaves out separators, swipe actions, pull-to-refresh, row callbacks and auto-scroll. Use
native:listwhen you need those.The name follows
lazy_grid. The Android renderer is in a separate PR stacked on this one. Until that lands, the manifest points Android at the existingScrollViewRenderer, which ignorescontent-padding.Worth checking
shows-indicators=false, or while scrolling by hand at 60 rows a second.Tests: 8 new in
tests/LazyStackTest.php. The full suite passes (501, 9 skipped).🤖 Generated with Claude Code