Repository navigation
Show a tab at once, and draw less while switching - #36
Merged
Merged
Conversation
On a slow Android phone a bottom-nav tap took 2 to 3 seconds to show the new screen, with nothing on screen in between. Three things in the app made it worse: - Every signed request read the device key from the Keychain again, which takes about 150ms on Android's Keystore, a few times per screen. DeviceKey is now one per process and holds the key once read or made. - A tab's first frame was every kept row, which a slow phone takes seconds to render and build. The Log, Notifications, Remotes and your Profile now draw skeleton rows first and fill in what they kept as soon as a no-op background task comes back (DrawsSkeletonFirst). DEVNULL_SKELETON_FIRST turns it off, as phpunit.xml does. - The Log sent five kept commits for each log you're not on, a third of its frame. The log beside yours now gets three, and the one two swipes away gets skeleton rows until you're beside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
1 task
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 Moto G24, a bottom-nav tap switched the tab straight away but showed the new screen 2 to 3 seconds later, with nothing on screen in between. Most of that is NativePHP's Android PHP build running without OPcache, which a separate php-bin-mobile change is taking on. These are the three app-side parts.
The device key is read once
Every signed request read the device key from the Keychain, and on Android's Keystore that takes about 150 ms. The phone's log showed two or three of those per tab switch.
DeviceKeyis now a singleton that holds the key once it has read or made it, andforget()drops it with the stored seed. It's the same key for the life of the install, so nothing per request is kept in a singleton.Tabs draw skeleton rows first
A tab's first frame used to be every row it had kept: about 2,800 views on the Log, which the Moto took over a second to render in PHP and then build. The Log, Notifications, Remotes and the Profile now
mount()with a first frame of skeleton rows, and dispatchFirstFrame, a no-opAsyncTask. When it comes back, straight after that frame, the screen shows what it kept and refreshes as before (DrawsSkeletonFirst).DEVNULL_SKELETON_FIRSTturns it off, andphpunit.xmldoes, so existing tests still see a screen open on what it kept. A new test per screen turns it on and checks the skeleton first, then the kept rows.Fewer rows for the logs you're not on
The Log sent five kept commits for each log you're not on, about a third of its frame. The log beside yours now gets three, enough for the top of the screen as you swipe, and the log two swipes away gets skeleton rows until you're beside it.
Worth checking
Testing
1,012 tests pass and Pint is clean. I'm putting it on the Moto G24 to compare tab switches.
🤖 Generated with Claude Code