Repository navigation
feat(mobile): show skeletons instead of loading notices - #269
Merged
Merged
Conversation
nixuuu
added a commit
that referenced
this pull request
Nov 6, 2026
Thread switches render the device's latest snapshot before connecting, then resume the watch from its journal checkpoint. The header and composer use real thread/project/model/worker metadata from the copy or overview. Cold reads reuse the generic skeleton components merged in #269. A quiet fixed-space “Syncing…” state keeps cached content visible until live; sending and stopping wait for live, and other actions retain authoritative gateway checks. The cache uses existing Expo app-private `expo-file-system` storage at `Paths.cache/thread-snapshots-v1`, so no new native dependency is needed. The OS may evict it safely. Binary protobuf files use atomic replacement and persistent LRU timestamps. Disk limits are **16 threads / 64 MiB**, with **16 MiB maximum per entry**; the memory LRU holds **6 threads / 24 MiB**. Writes coalesce into 2-second windows and flush on screen exit/background. Size budgets measure encoded protobuf, not the entire decoded object heap. Pairing device ID and certificate pin isolate cache scopes. Unpair or detected revocation fences new writes, clears memory and serializes disk deletion; orphan scopes are removed before mounting screens. An offline device detects remote revocation upon reconnect. Failed deletion reports an actionable storage error. Snapshot secret fields contain request metadata only, never stored secret values, ciphertext, device tokens or provider credentials. Ordinary conversation text remains private conversation data. Android development builds disable Expo's network inspector: its HTTP/2 response preview waits for up to 1 MiB, blocking small open-ended Connect streams. Certificate pinning, authorization and wire format remain unchanged. Device verification identified this behavior in both thread deltas and the pre-existing overview watch. The fresh EAS build with the inspector disabled receives small deltas, becomes live and clears Syncing. No temporary transport bypass is committed. Measurements use two synthetic conversations with 500 completed turns / 3,001 timeline items each, including tool output. Initial baseline app samples on Medium_Phone_API_36.1 were 3177.15 / 3660.23 / 3324.30 ms to first content (median 3324.30 ms), transferring about 6.23 MB protobuf per open. The final controlled comparison below uses the same Canopy_Fold emulator, fresh native build and SSH network path. The full-watch control disables cache reads/writes and requests the original full snapshot; both modes use the current timeline renderer. | Watch open on Fold | Full-watch control | Warm cache + delta | | --- | ---: | ---: | | First content, three samples | 3119.1 / 3677.3 / 3104.1 ms | 653.6 / 580.9 / 693.4 ms | | Median | 3119.1 ms | 653.6 ms | | Initial protobuf update received by the app | 6,233,091–6,233,101 B | 513–523 B | After a process restart, a disk-backed open showed content in **709.5 ms**, then received a **523 B delta**. Empty-cache controls took 2234.9 / 2708.1 ms and received full snapshots, as expected. Cached switches visibly kept content in place and reached live. Revoking the live synthetic device returned the app to pairing with the revocation message; inspecting its private cache confirmed no snapshot files remained. Timing runs from the thread hook mounting to snapshot render plus two animation frames; pre-mount navigation animation is excluded. Byte figures measure the initial WatchThread protobuf update, excluding framing, TLS and separate metadata RPCs. These are instrumented development-mode, synthetic, shared-host results, not production guarantees. Provisional HMR/debugging samples are excluded. The browser results are in the preceding layer. A separate local tail-loading stage is deferred; the existing mobile FlatList remains, and two nested item/turn scans were replaced with a Set and grouped Map. Verification: install, generated-contract check, typecheck, lint, formatting, Expo lint and Expo Doctor (20/20) pass. iOS and Android production JS exports pass. The complete `check:tmp` run passed **1,490 tests, 159 skipped, 0 failed**, with 10,039 assertions. Meaningful filesystem/gateway tests cover restart, cursor durability, byte/count LRU limits, oversized/corrupt entries, unpair races and late writes, real paired TLS HTTP/1.1 and HTTP/2 delta reads, secret/token exclusion and actual device revocation. Protocol owner/fallback/restart and two-gateway remote coverage are in the first layer. Device qualification: the fresh Android dev build installed on Canopy_Fold on the Mac Studio. Light/dark and open/closed hinge postures were checked; this generic AVD retains its wide viewport when closed. Phone-width light/dark layouts were checked on Medium's existing dev client with the current JS. Installing the fresh native build on Medium failed, including the tool-prescribed retry, with “Requested internal only, but not enough space”; it was not reinstalled or cleared to make room. No iOS runtime or physical Galaxy check is claimed. The task-owned app, servers, gateway/Postgres, port forwards and emulator were cleaned up afterward. Copy audit (§8): removed temporary “Thread / Thread”, “Default model” and “Worker” values when metadata is known. Unknown metadata/timeline uses shared skeletons. The existing quiet “Syncing…” copy has reserved space. Revocation/storage errors state the cause and recovery action. No new glossary term or colour-only state. Draft stack; do not merge individual layers.
This was referenced Nov 13, 2026
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.
Mobile screens inserted loading notices above their content, including one notice per workspace in Projects. Replace those notices with shared skeletons, keep loaded content during refreshes, and present project text edits as text fields.
What changed
ui/Skeleton.tsxsupplies the shared building block: the web's translucent light/dark fill, rounded corners and an opacity pulse. It stops pulsing under the system reduced-motion setting and hides pending controls from touch and accessibility. Known form rows stay mounted behind the skeleton, so loading does not insert or remove an extra box or spacer. List placeholders use the corresponding row/card structure; the number of results and arbitrary text wrapping are unknown before the first response.The remaining spinners show ongoing actions: sending, uploading attachments, running shell commands, and busy buttons. They do not stand in for fetched content.
Verification
bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check, andbunx expo lintinapps/mobile.bun run check:tmpwith a private TMPDIR on disk: 1481 pass, 158 skip, 0 fail, 1639 tests across 264 files; nothing left in its temp directory. Opt-in live tests were skipped. No UI tests were added or run.Device coverage gap
Device verification was unavailable.
Canopy_Foldfailed to boot both initially and on the final retry: “The emulator process … exited with code 1 before coming online.” The remote Mac had 1.9 GiB free on the final check. Medium belonged to another agent's active session and was left untouched. The maintainer explicitly authorized skipping device checks in this situation.Folded/unfolded, light/dark, short/long text, slow first-load, refresh geometry and the reduced-motion behavior have not been visually verified. Static review and the gates do not establish pixel-perfect layout parity. No code, APK or build artifacts were copied to the Mac; no native build or AVD data changes were made, so there are no manually created Mac artifacts to clean up.
Copy audit (§8)