Conversation
Selecting an option for a pending user-input question replaced the custom answer with an empty string, so anything the user had typed into the composer while the question was active was discarded. The typed text now moves into the thread draft and comes back once the question resolves. The composer also resyncs its shared prompt ref from the thread draft when the question clears; before, Send read the stale answer text instead of the draft shown in the editor. Fixes pingdotgg#12569. Done with Claude Code, model Claude Fable 5.1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, self-contained web bug fix that preserves typed text when selecting a pending-question option and keeps the composer’s send state consistent afterward. Its runtime impact is confined to that composer interaction, with no schema, deployment, security, billing, or static-analysis configuration changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe pending-user-input flow now preserves typed custom answers when an option is selected. It merges the answer into the thread draft and restores that draft in the composer after the pending question clears. Unit tests cover the merge behavior. ChangesPending answer preservation
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
Clicking an option in a pending user-input question no longer discards text typed into the composer.
pendingUserInput.ts: new pure helpercarryDisplacedCustomAnswerIntoPromptwith tests.ChatView.tsx:onSelectActivePendingUserInputOptionmoves a non-empty custom answer into the thread draft before the option replaces it.ChatComposer.tsx: when the question clears, the shared prompt ref is resynced from the thread draft.Why
While a question is active the composer edits the question's custom answer. Selecting an option rebuilds that answer with
customAnswer: "", because a custom answer outranks selected options. Anything the user typed in the meantime is gone: not in the answer, not in the draft, not in any message. Fixes #12569.The second change closes a related gap: after the question resolved, the composer showed the thread draft but the prompt ref still held the last answer text, so Send without further typing read the wrong value.
Text moved into the draft comes back in the composer once the question resolves and is sent as the next message, same as text typed before the question arrived. Mobile keeps the answer in its own input on the question card and is not affected.
UI Changes
No visual change. Interaction below: typing while a question is open, then clicking an option.
Before:
After:
Checklist
Validation:
dfbb11bdd: type while a single-choice question is open, click an option. The composer empties and the text is not in the draft, the answer, or any message.typecheckforapps/web, targeted lint with only pre-existing warnings.Tests cover the new helper only. There is no regression test that fails on
main: the drop happens inside theChatViewhandler, and a test there costs more than the fix. We chose to skip it on purpose for now, not sure yet whether it would be overengineering for a change this size. Feedback welcome.lovely composed in pair with Claude Fable 5.1 in Claude Code
Summary by CodeRabbit