Skip to content

fix(web): preserve composer draft during worktree setup - #9197

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
maria-rcks:t3code/preserve-composer-during-setup
Sep 2, 2026
Merged

fix(web): preserve composer draft during worktree setup#9197
maria-rcks merged 1 commit into
pingdotgg:mainfrom
maria-rcks:t3code/preserve-composer-during-setup

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-5.6-sol on behalf of Maria

Draft promotion deleted composer state when setup completed, so follow-up text typed while a remote worktree action was running disappeared. This moves the draft to the canonical scoped thread key when promotion finalizes and covers edits made during promotion in the existing store tests.

Verification: 101 focused store tests, web typecheck, targeted lint, and a real app flow with an eight-second worktree setup passed. Real T3 Code verification video.

Implemented with gpt-5.6-sol in the Codex harness.


Note

Medium Risk
Touches composer draft lifecycle during promotion finalization; wrong key handling could duplicate or leak drafts, but scope is limited to the promoting-draft cleanup path with added test coverage.

Overview
Fixes composer text disappearing when a draft thread finishes promoting (for example while a remote worktree setup is still running). Finalizing promotion used to drop the draft’s composer state when cleaning up draft-thread mappings; it now relocates that state onto the canonical scoped thread key from promotedTo instead of revoking attachments and deleting the draft entry.

removeDraftThreadReferences accepts an optional destination ref for that move. finalizePromotedDraftThread only runs when a promoting draft exists and passes promotedTo through. Store tests now assert prompts survive on the real thread after finalize, including text typed on the draft id after markPromotedDraftThread.

Reviewed by Cursor Bugbot for commit b080411. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix finalizePromotedDraftThread to preserve composer data on canonical thread

  • Composer text written while a draft is being promoted was lost when the draft thread was removed during finalization.
  • removeDraftThreadReferences now accepts an optional canonical destination; when supplied, it re-keys the draft's composer data to the canonical thread instead of revoking preview URLs.
  • finalizePromotedDraftThread passes the promoted destination to the helper so the composer data survives cleanup.
  • Risk: removals without a destination still revoke preview URLs, but any caller that previously relied on composer data being discarded during promotion will now see it retained under the canonical key.

Macroscope summarized b080411.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 2, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b080411

Macroscope's review found this PR approvable — This is a narrowly scoped web bug fix that moves composer state from a promoted draft ID to the existing canonical scoped thread key, preserving text entered during worktree setup. The accompanying test covers the promotion-time edit scenario, with no schema, configuration, security, billing, or deployment impact.

You can add or adjust custom eligibility rules. Learn more.

@maria-rcks
maria-rcks merged commit f14f41b into pingdotgg:main Sep 2, 2026
23 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 2, 2026
## What's Changed
* feat(updates): continue active threads across server restarts by @maria-rcks in pingdotgg/t3code#9167
* fix(mobile): prevent message and composer overlap by @juliusmarminge in pingdotgg/t3code#9195
* fix(web): preserve composer draft during worktree setup by @maria-rcks in pingdotgg/t3code#9197
* fix(web): prevent two-digit list markers from being clipped by @G-R3 in pingdotgg/t3code#9101

## New Contributors
* @G-R3 made their first contribution in pingdotgg/t3code#9101

**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260902.1256...v0.0.39-nightly.20260902.1257

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260902.1257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant