Repository navigation
feat(threads): sync drafts automatically and take over on receipt - #699
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 14, 2026 10:35
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
Drafts now appear as a counted tab attached to the composer's top edge, expanding into a compact dropdown. The tab exists only when another device has an unfinished draft for this composer's full target. Clicking a row takes it over; a nonempty composer offers **Append draft** or **Replace local draft** inline. Each row includes its preview, attachment count, source device, age and **Discard draft** action. The modal, sidebar **Open drafts** entry, manual refresh actions and separate incoming-draft indicator are removed on web/desktop and mobile. Cross-thread discovery stays with sidebar draft markers, keeping this panel focused and avoiding navigation from a composer dropdown. Source move notices and pending-send recovery remain available. Both clients reserve a fixed 32 px/point slot so arriving drafts never move the composer. Web uses the existing nonmodal top-layer popover; mobile anchors a nonmodal portal to the same edge. Both use existing motion tokens and respect reduced motion. The shared live cache finishes pagination up to the existing 100-draft limit so counts include later pages. Related: #699 Validation: - `bun install`, `gen:check`, workspace typecheck, lint and format checks passed. Web typecheck and production build passed after the final popover adjustment. - 35 focused domain/gateway/linked-draft tests passed through `check:tmp` (172 assertions), with no leftover test directories. - Browser review passed at 1280 and 390 px in light and dark: empty tab hidden, 22 drafts across pages, stable composer position, joined borders, append/replace, attachment/citation preservation, discard and live disappearance. No page errors. - iOS and Android exports passed; both native fingerprints are unchanged from dev. Device checks remain blocked by scope. Copy audit (§8): **Open drafts**, the explanatory modal sentence, empty state and **Refresh drafts** → **Drafts** with a count. Row previews replace the repeated take-over call to action; accessible row labels say **Take over draft: …**. **Append draft** and **Replace local draft** retain their explicit meaning; **Delete draft** → **Discard draft** matches the requested × action. Buttons use verbs and sentence case; the noun-only **Drafts** labels a disclosure. Errors explain the failure and retry action. No new glossary terms or decorative copy. Short and long drafts, attachment labels and device names were reviewed at desktop and phone widths in both themes.
This was referenced Nov 16, 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.
Unsent composer drafts now sync after 1.5 seconds of idle typing and on blur, backgrounding, or navigation. The receiving device chooses Take over, including attachments and citations. The source clears only an unchanged saved revision; later edits fork into a new draft and remain editable.
The incoming indicator replaces the computer label in the existing composer metadata slot. Open drafts moves to an icon in the sidebar footer, removing the permanent action row on web and mobile. Sidebar markers include drafts from other devices across every page. Nonempty composers offer Append draft or explicit Replace local draft.
Related: #664
The additive protocol returns content-free take-over receipts and thread IDs for sidebar markers. Migration 0142 stores receipts for 30 days, scoped to owner and source device, so source reconciliation still works after the receiver saves or sends. Existing CAS, fork-on-conflict, send fencing, recovery, and short delivery transactions remain intact. Cross-tab adoption retires stale composers; mobile refreshes again if an invalidation arrives during an outstanding read.
Validation:
bun install,bun run gen:check, full workspace typecheck, lint, formatting check, and the production web build passed. Focused runs useniceand private disk-backed temporary storage.check:tmp, with no leftover test directories. Coverage includes one save per typing burst, blur flush, delete, durable source receipts, owner scoping, edit/send races, and invalidation during a page read.138e0c6b171c82b4933e86808cdfef56da73b8c6; Android906dc944f94eb8333fa384ed9f198834fdd30d13. Native configuration and dependencies are unchanged. Device checks remain blocked as specified.Copy audit (§8): “Continue on another device” → automatic sync removes an unnecessary decision. “Continue” / “Continue here” → “Take over” makes the move explicit. “Append draft” / “Replace local draft” name the nonempty-composer choices. “Draft taken over on …” and “Your edits are kept here” explain the source outcome. Actions start with verbs, use sentence case, and convey meaning without color. Long device names truncate within one existing line; append/replace labels remain readable at phone width. No new glossary term or decorative copy.
Review follow-up:
Follow-up validation: 33 focused gateway/linked-draft/domain tests passed through
check:tmp, including full target isolation, input-change detection, bounded receipt requests and sending while a list transaction remains open. Workspace typecheck, lint, formatting, web build, and iOS/Android exports passed. Both native fingerprints still match the dev baseline recorded above. No new browser or device review was performed for this follow-up; the browser evidence above is from the original implementation. Device checks remain blocked.Copy audit follow-up (§8): mobile source notice without an action → source notice with Dismiss, matching web. The action uses a verb and sentence case, has a visible text label and adds no explanatory copy or extra row.