Repository navigation
Conversation
With pastéis mode off, the screen passes $pasteis as null, and both RowInputs::for() and commit-actions treated null as "not given" and asked the account again. That's a query on the phone, where the cache is the app's SQLite database, so every row on the Log cost one on every frame, kept or not: 24 queries a frame on a log of 20. Null is now an answer. The account is only asked when the screen passed nothing at all. The same goes for $viewer, which is null when you're signed out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every frame built the rows around the commits afresh: the skeleton rows of a log or tab with nothing loaded, the loading row at the end of a list, the root commit row, the day markers and the last-visit marker, and a profile's pinned commit. On the Log that was five skeleton and loading rows on every frame, about a third of a frame where nothing changed. They now go through the list's RowCache like its commits, on the Log, profiles, organizations, Starred and Search. Each is kept against what it draws, so a loading row that stops pulsing when you swipe away is built again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every frame read the answer kept for the log beside yours and made its first commits afresh, with their bodies parsed again. New commits then missed the timeline laid out for them last frame and the rows kept for them, so each was hashed again too. The preview is now kept with a hash of what it was made from, and only made again when that changes, as it does when a star or a delete reaches the kept answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A poll you can vote on draws its Vote button in your lane colour, which the row reads from the screen. RowInputs didn't have it, so after you changed your colour the Log kept the old one on that button until the row changed for some other reason. The kept-row test now also changes your colour and joins you to an organization whose commit is showing, and checks the kept rows against rows built afresh, as it did for stars, times and threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RowInputs kept every row against the whole list of stashed drafts and unfolded commits, though a row only shows its own: a dot on its Quote or Reply button, and its body whole once you tapped Show more. Starting a draft anywhere, as the first letter of a quote or a reply does, built every row on the screen again. Each row is now kept against its own drafts and its own unfolding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commit a page is about, what it replies to, the rest of its series and the related commits were built again on every frame. Typing a reply draws a frame a few times a second, so each letter built every commit above the reply bar. They now go through the page's RowCache with its replies. The commit the page is about is also kept against what it shows of its thread (whether its replies are open, and how many) and your timezone, which its time's label is in. The test changes each of those, and the time, and checks the kept rows against rows built afresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
Brings in #178's HEAD@{last visit} band. 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.
This PR's base is
integration/timeline-memo-base:mainwith the open PRs #175, #176, #177, #178, #179, #180, #181, #182, #183 and #186 merged in, the combination Simon's phone runs. That keeps the diff to this work alone. It gets retargeted tomainonce those PRs land.Why the rows aren't
#[Memo]componentsThe question was whether the Log and profile rows use
#[Memo]from mobile-air 4.8. They don't, and they shouldn't. Since #40 they go throughApp\Devnull\RowCache, which already does what Memo does and a bit more: it keeps each row's elements and the node it sent, against a hash of what the row shows, so an unchanged row costs one hash a frame.I turned the feed's commit and reply rows into a
#[Memo]child component on mobile-air 4.8.0 and timed both on the same data. Memo was slower on every step:#[Memo]Two reasons. The Log, profiles, Search and Starred send every frame in full (
$forceFullFrames), and Memo's shortcut is a reuse marker that only works with subtree reuse on, so it walks and serialises every kept row again each frame.CachedRowskips that walk. And Memo compares a child's props every frame by serialising any object among them, which here is theCommit, whereRowCachehashes each readonly commit once. So the rows stay where they are and this PR goes after the rest of each frame. The prototype isn't in this PR.What changed
$viewertoo.RowCachewith its commits, on the Log, profiles, organizations, Starred and Search. On the Log that was five rows on every frame.RowCachelike its replies. Typing a reply used to build all of them on every frame. The focused commit is also kept against whether its replies are open, its reply count and your timezone.RowInputsdidn't cover, so after changing your colour the Log kept the old one on that button.Every frame is the same as before. The bench below records the tree each step ends on, and all 336 of them match the base branch's, node for node, so there's no visible change and the phone gets as much as before: about 204 KB a frame on a Log of 20 commits and 530 KB with 60, measured as the tree's JSON.
Numbers
Mac, PHP only (render plus
toArray, median of 11 runs, same fixtures, cache in SQLite and kept answers in files as on a phone):On an iOS 27 simulator and an Android 15 emulator, a debug build of each side ran a scripted session against a fake API serving the same fixtures, one step every 1.5 s, timed from mobile-air's own
PERFlines inedge-nav.log. This is the frame each step caused, render plustoArray, median of five runs:First renders barely move on either: building a row costs about the same as before (about 1 ms each on a Mac), and that's most of a first render.
The bench, the timing harness and the fake API aren't in this PR. They're attached to the board entry for this task, with how to run them.
What to watch for
RowInputsis the contract: anything a row partial reads from its screen has to be in it, or a kept row shows what it showed before. The tests inLogRowCacheTestandRowCacheScreensTestnow change a star, the time, your timezone, your colour, your organizations, a draft, Show more and a thread's state, and check kept rows against rows built afresh. A partial that starts reading something new needs adding there too.On the commit page, the commit it's about reads its replies' state and your timezone from the page, so those are in its inputs as well (
commit-detail.blade.php). That test fails if they're taken out.Not done here
CachedRowwould need to send reuse markers for kept rows, or a one-row change still sends every kept row in full.Account::user()asked again from several places. Remembering it for a frame would cut most of them, but background tasks read the same keys from another runtime, so it needs care.commit-actionsandcommit-row-contentmost of it. That's what first renders, next pages and opening threads pay for. Fewer nodes per row is the lever there.#[Memo]to help a list in mobile-air, a memoised child would need to keep its serialised node on full-frame screens, asCachedRowdoes, and compare object props without serialising them every frame.Screenshots
Nothing a user sees changed: every frame matches the base branch's. Checked by hand on an iOS simulator and an Android emulator in light and dark: starring, opening and closing threads, the quote sheet, next pages, pull to refresh, a profile's tabs, and a commit page's replies and reply bar all update as before.
🤖 Generated with Claude Code