Repository navigation
fix(mobile): open archived threads instantly from device cache - #423
Merged
Merged
Conversation
Open Archived locally before settings writes or network reads, restore pairing-scoped archive pages and metadata, and merge background refreshes into a windowed list. Related: #375
This was referenced Nov 13, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 15, 2026
## What jumped (Android recording, nightly) Frames from the report, at 30 fps: 1. **Swipe snapped back**: releasing a committed swipe returned the row to rest, and it sat there for about 0.5 s until the gateway update removed it instantly. 2. **Counter out of step with its rows**: the archived rows come from the saved cache, which the stream update changes in the same render. `Archived · N` and "No archived threads" came from the pager, which refetches after a 100 ms debounce. Archiving showed `Archived · 0` over the new row. Unarchiving showed `Archived · 1` over "No archived threads.", and then the whole section vanished in one frame. 3. Rows other than archived ones, the archived heading and the empty state had no exit, so they disappeared abruptly while neighbours moved. ## Fix (mobile only) - `ThreadArchiveSwipe`: a committed swipe slides the row off on `motion.quick` with `smoothOut`, and the row stays off. With reduced motion it only fades. The gateway update then removes the row, and the cells below glide into place (`SidebarOrderCell` `LinearTransition` on `fast`). A failed request or a confirmation dialog brings the row back. `useThreadActions.commit()` returns the outcome; `run()` behaves as before. - `useArchivedThreads`: the count follows the rows it describes (`saved?.totalCount ?? page.totalCount`). Row and counter now change in the same frame, and the section's visibility uses the same value. - `SettingsThreadList`: every leaving entry fades out (`rise.exiting`). That covers active rows, the archived heading and status, and the empty state. `LayoutAnimationConfig skipExiting` stops those exits when the whole list unmounts (Threads/Bots switch). - `useSettleThread` (overview): the archive/unarchive response, and the response to Undo, carries the saved thread. It applies immediately when the stream isn't live, else after 2 s without an echo. It uses the same path as a stream `thread` event (saved archive cache `reconcile` + overview upsert), so a swiped row never stays an empty slot. A response whose archive state the list already shows is dropped. A later echo is a no-op: `mergeArchivedThread` keeps a known row at its index and leaves the count unchanged, and the overview upsert replaces the row in place. The pager refetch that follows returns the same rows. - No optimistic list mutation: the server echo is the only move, so there is no double move. The pager's refetch, triggered by the same update, matches the saved rows: same keyset order, and the row already in place keeps its index. The web sidebar takes rows and count from the same pager state, so it was not affected and is unchanged. ## Checks - `bun install`, mobile `typecheck`, `bun run lint`, `bun run format:check`: clean. - Native fingerprint (`@expo/fingerprint`, ios + android) compared against `origin/dev`: all source hashes are identical. Only TS sources changed; no native modules and no config-plugin changes, so this ships over OTA. - Device: not checked. The MacStudio device hub timed out (40 s), and the EAS cloud simulators would need a new build. ## Copy audit (docs/copy.md §8) No UI text added or changed. Related: #549 Related: #423
nixuuu
added a commit
that referenced
this pull request
Nov 22, 2026
## Changes - Align Archived above the mobile sidebar footer when the thread list is short. On longer lists, the archive follows the inbox in the same virtualized list. - Reduce the space above Snoozed from 24 to 8 dp and keep its 48 dp touch target. - Use the existing motion preset for changes to the Archived header position. ## Verification - Passed mobile typecheck, lint on the edited files, and `git diff --check`. - Checked the layout geometry in Yoga with short, long, expanded, archive-only, and archive-free lists. - Native visual and interaction checks are pending. The Android device tool could not verify ownership of the emulator runtime. - UI copy is unchanged. Repository-wide checks run in GitHub CI. Fixes: #423 Fixes: #1064
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.
Tapping Archived on mobile waited for the sidebar setting to reach the gateway. It now changes local disclosure state immediately, displays saved archive pages before the request starts, and refreshes them in the background. A cold cache displays compact row skeletons.
Archive rows, pagination cursors, and project/worker labels use a separate pairing-scoped persistent cache. Archive/unarchive/delete events update it incrementally; stale requests cannot resurrect changed rows. Unpair/revocation clears it. Active and archived rows share a windowed FlatList with stable keys and the existing reduced-motion-aware row/disclosure presets. Loaded pages survive collapse and restart, and scrolling loads the next page.
Scope and coordination
perf/client-N: transcriptthread-cache.tsandthread-cache-native.tsare unchanged. The archive uses the existing storage adapter in an independent namespace; session initialization/cleanup and overview event handling are the integration points.Verification
bun install,bun run gen:check, fullbun run typecheck,bun run lint,bun run format:check, and the production web build. Mobile/integration typechecks also passed after the final cache adjustment.bun run check:tmp --timeout 30000 --retry 2: 1921 passed, 161 skipped, 1 failed across 343 files; temp-dir hygiene passed. The unchangedlinked-timeouts.test.tsslow-live-read scenario failed after both retries (the test did not observe the expected peer read refresh). Earlier interrupted runs encountered plugin timeouts under concurrent exports and a config-sync cursor assertion race; both passed in this final full run. No unrelated gateway/test code was changed to suppress failures.bun run check:tmp tests/integration/linked-timeouts.test.ts --timeout 30000: 6 passed, 1 failed in the same slow-live-read scenario; temp-dir hygiene passed.The failing test is
linked computer read deadlines and recovery > slow live reads time out without declaring the computer dead or repeating on every poll. Its polling assertion returnedfalsewheretruewas expected: the peer did not reachreadState === "stale"within 20 seconds, or the next assertion did not observe a newerGetComputerUpdatesrequest within 10 seconds (linked-timeouts.test.ts:160–161). Two additional isolated runs on this head both passed 7/7, without retries (78.46s and 78.31s); temp-dir hygiene passed in both.Maintainer comparison: 7/7 on dev
4dfb2f85and two consecutive 7/7 runs on head5bac8ae3under less load. Their confirmation: “on your head 5bac8ae passes 7/7 twice in a row on a less loaded run here, and 7/7 on dev. So it's load-related, not your change.” Changed code is confined to mobile cache/sidebar behavior and the shared archive pager; the gateway, linked listings, BFF transport, and this fixture are unchanged and do not import the changed archive modules. No unrelated code was changed to suppress the failure. Publication with the local load failure documented is explicitly authorized; CI remains the merge gate.bunx [email protected] fingerprint:generate --platform <ios|android> --build-profile production --json --non-interactive: iOS2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3, Androidc5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d; both unchanged.Copy audit
Could not load archived threads.. After, when saved rows exist:Showing saved threadsquietly explains their source, withRetryon failure; four words, sentence case, standard glossary, no punctuation or humor needed for a status.Could not load archived threads.+Retry, empty-state text, andLoad more/Loading…remain. The retry action supplies the next step without exposing transport details.Related: #375