fix(web): keep the typed prompt when a draft changes repo - #6393
Conversation
Picking a different repo in the draft hero used to land you in a fresh empty draft; the text you had typed stayed behind on the old project. Now the prompt and image attachments move with you. Session-bound extras (terminal/element contexts, annotations, review comments) stay on the source draft since they reference the old thread's sessions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Text typed during the env-mode await was left behind when the draft was empty at click time. Review finding from macroscope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Guards a racing repo change from overwriting a prompt an earlier carry already moved in. Review finding from macroscope. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved 41e3f33 Self-contained UX fix that keeps typed prompt content when a draft changes repo. Well-tested with appropriate guards against edge cases, and limited in scope to draft-to-draft content movement. You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * fix(web): cmd+click sidebar PR numbers open in the browser by @t3dotgg in pingdotgg/t3code#6378 * feat(web): project favicon and workspace icons in command subtitles by @gsimone in pingdotgg/t3code#6330 * web/settings: fix source control scan on relay environments by @dominic-r in pingdotgg/t3code#6230 * fix(web): make reset zoom hover visible by @t3-code[bot] in pingdotgg/t3code#6385 * fix(web): keep the typed prompt when a draft changes repo by @t3dotgg in pingdotgg/t3code#6393 ## New Contributors * @gsimone made their first contribution in pingdotgg/t3code#6330 * @dominic-r made their first contribution in pingdotgg/t3code#6230 **Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260812.1079...v0.0.34-nightly.20260813.1081 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260813.1081
Reported by dominicroy0: start writing a prompt, notice you are in the wrong repo, switch repos in the draft hero — and your text is gone. The switch minted a fresh empty draft and the typed prompt stayed behind on the old project.
Now the prompt and image attachments move with you to the new project's draft. Session-bound extras (terminal/element contexts, preview annotations, review comments) stay on the source draft because they reference the old thread's sessions; if nothing else remains there, the old draft empties out and drops its sidebar row.
Only the draft repo picker opts into the carry (
carryComposerContent). Explicit new-thread surfaces (button, hotkeys, palette, sidebar) keep their mint-fresh behavior.Store tests cover the move, placeholder stripping, and that blob preview URLs are not revoked.
Written by Claude Fable 5 via Claude Code.
Note
Low Risk
Localized draft/composer state changes with guards against clobbering invested destination drafts; no auth, API, or persistence schema changes.
Overview
Fixes losing composer text when switching projects from the draft hero: prompt and image attachments now move to the new project's draft instead of staying on the old one.
Adds
moveComposerPromptAndImageson the composer draft store to transfer prompt + images between draft targets without revoking blob preview URLs. Session-bound extras (terminal/element contexts, preview annotations, review comments) stay on the source; inline terminal placeholders are stripped from the moved text and re-applied for the destination's contexts.useHandleNewThreadgains optionalcarryComposerContent: when set and the user is on a draft route, it moves content after the destination draft is resolved (including async paths), and skips the move if the destination already has user content. OnlyDraftHeroHeadline's project picker passes this flag; other new-thread entry points stay mint-fresh.Store tests cover the move, placeholder handling, same-target no-op, and non-revocation of preview URLs.
Reviewed by Cursor Bugbot for commit 41e3f33. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep typed prompt and images when changing a draft's repo in the chat composer
moveComposerPromptAndImagestocomposerDraftStore, which re-anchors inline terminal context placeholders for the destination and clears the source without revoking image preview URLs.useHandleNewThreadinuseHandleNewThread.tswith acarryComposerContentoption that triggers the move after the destination draft is resolved, skipping it if the destination already has user content.Macroscope summarized 41e3f33.