Repository navigation
feat(threads): persist and hand off drafts on mobile - #666
Merged
Merged
Conversation
nixuuu
force-pushed
the
feat/thread-drafts-mobile
branch
7 times, most recently
from
November 13, 2026 20:15
ff28092 to
236048e
Compare
nixuuu
force-pushed
the
feat/thread-drafts-mobile
branch
4 times, most recently
from
November 14, 2026 00:21
8868be1 to
6deadd3
Compare
This was referenced Nov 14, 2026
nixuuu
force-pushed
the
feat/thread-drafts-mobile
branch
from
November 14, 2026 00:57
6deadd3 to
0aee651
Compare
nixuuu
force-pushed
the
feat/thread-drafts-mobile
branch
3 times, most recently
from
November 14, 2026 02:10
cc3cc75 to
4693f4e
Compare
nixuuu
force-pushed
the
feat/thread-drafts-mobile
branch
from
November 14, 2026 02:50
4693f4e to
b10d1f8
Compare
nixuuu
marked this pull request as ready for review
November 14, 2026 03:01
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
## Change Thread/new-thread/side-thread composers retain bounded local drafts, including mentions, citations/notes, uploaded IDs and explicit choices. Per-target storage/subscriptions preserve other tabs' drafts and avoid rerendering every sidebar row. Markers reserve their width. Generic snapshot/restore preserves Edit from here / Swap drafts and workspace tabs. Open drafts lists other-device prompts. Continue here appends without re-uploading; replacement is explicit. One shared page cache and resumable stream serve mounted composers. Stream failures back off from 2 to 60 seconds without re-listing on reconnect. Newer hints compare gateway clocks. Source conflicts fork draft/send IDs while preserving text. Send/create uses **one RPC instead of Save + Send (2 → 1)**. Navigation does not abort the send. Acknowledged sends clear their captured durable state even after navigation. Reopened pending drafts query GetComposerDraftDelivery before showing recovery; confirmed receipts/native admission clear them without resending. The unknown-send banner and Edit/Discard actions stay hidden while this client sends or the gateway reports an active attempt. Definite rejection preserves editable text; a truly unknown outcome exposes explicit recovery. ## Verification - Production browser review after rebasing onto visuals bcc07e0: desktop/light and 390px/dark. Holding HTTP200, switching threads and releasing the response left the request un-aborted and removed its persisted draft. Reopening showed an empty editable composer. - Reloading a persisted pending request after admission made one read-only recovery call and zero message calls. The draft cleared without the unknown-send banner. An injected unknown network outcome exposed Edit/Discard only after reconciliation; Edit preserved the prompt and restored editing. Phone layout had no horizontal overflow. - Current gateway /goal recovery follow-up passed drafts **17/17**, slow/lost linked send **2/2**, gateway/integration typechecks, lint and format:check with nice. Recovery now checks every native SendMessage receipt, including goals without turns/steers. Web sources are unchanged. Migration/schema **1/23** passed before this follow-up. Each layer previously passed install, gen:check, full typecheck, lint, format:check and web build with nice. - Before the final /goal follow-up, full check:tmp passed: **2959 pass, 175 skip, 0 fail**, 561 files; private temp directory clean. Diagnostics boundary tests passed **7/7**. The full suite was not repeated locally for the narrow follow-up. - CI and final re-check of the gateway follow-up are pending. The stack stays draft as requested. Native device coverage is tracked in #666. ## Copy audit (docs/copy.md §8) - Draft, Open drafts, Continue here and Replace local draft use shared terminology. Markers reserve width and do not rely on colour. - Before: the unknown-send warning appeared on ordinary sends. After: it appears only after recovery establishes an unknown outcome, without an extra row during normal sends. - Edit draft / Discard draft describe recovery. The warning states possible prior delivery and that editing starts a new message. No protocol or revision terms appear in product copy. - Short/typical/long text and actions were reviewed at desktop and phone widths, light/dark. No UI tests added. Part of **stack 667**, depends on #664. Rebased onto **bcc07e0db**; migration 0140. Do not merge separately.
This was referenced Nov 16, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 24, 2026
) ## Summary - Keep one new-thread draft across project and worker changes in web, desktop, iOS, and Android. Reopening New thread restores the prompt. - Recover the most recent draft saved under a workspace in an earlier version. Keep any pending send bound to its original request. - Bind new sends to the selected workspace and keep receipt retries tied to the submitted request. ## Verification - Browser with two projects and two workers. Verified project and worker changes, leaving and returning, a reload, recovery of an earlier draft, and delivery to the selected worker. - 24 integration tests across composer drafts, linked delivery, and sandbox draft selections. - Web, mobile, and gateway type checks. Formatting and lint for edited sources. - Native iOS and Android runtime verification remains open. Repository-wide checks run in CI. ## Copy audit Added “Could not save this draft. Retry before sending.” for a recovered draft whose updated target could not be saved. The message names the failure and gives one recovery action. Fixes: #665 Fixes: #666
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.
Change
Mobile persists drafts in per-target Documents files scoped to pairing/certificate. Text, mentions, citations/notes, upload IDs/states and choices survive restart. Markers use memoized per-target subscriptions. The Drafts sheet supports append/replace with existing attachment IDs; one session cache/watch resumes from the gateway revision.
Send/create uses one RPC (2 → 1) without saving first. Navigation changes only the screen lifetime; it does not abort HTTP delivery. The captured persistent draft clears before stale-screen guards run. On reopen, read-only recovery checks the receipt and native admission. The unknown-send warning stays hidden during active sends/reconciliation and appears only for unresolved outcomes. Edit/Discard then recover explicitly. Definite rejection restores editing, including Edit from here / Swap drafts. Late save responses cannot resurrect sent/forked drafts.
Workspace tabs and visuals' thread view are retained after rebasing onto bcc07e0. BackgroundTasksChip keeps its offline/away disabled condition. Migration remains 0140, after visuals' 0139. Polish mobile docs cover persistence, handoff and recovery. No native dependency/configuration changes.
Verification
74705db3a68907bc28379bb9b1080a227bc0755b, Android7d38be8f5c9bf842d62060c75820a206f99c87e3.Copy audit (docs/copy.md §8)
Part of stack 667, depends on #665. Do not merge separately.