Skip to content

fix: preserve composer drafts during pending user input#1082

Open
Githubguy132010 wants to merge 3 commits intopingdotgg:mainfrom
Githubguy132010:fix/preserve-composer-draft-pending-input
Open

fix: preserve composer drafts during pending user input#1082
Githubguy132010 wants to merge 3 commits intopingdotgg:mainfrom
Githubguy132010:fix/preserve-composer-draft-pending-input

Conversation

@Githubguy132010
Copy link

@Githubguy132010 Githubguy132010 commented Mar 14, 2026

What Changed

  • keep the main composer draft separate from pending custom-answer text while a plan-mode user-input request is active
  • route contenteditable edits and mention replacements to the active pending answer without overwriting the main draft
  • simplify digit-key handling for pending input choices and add browser coverage for draft preservation

Why

Pending custom answers were reusing the main composer state, which caused the user's normal draft to be replaced while answering follow-up questions. This change isolates those two editing flows so plan-mode responses remain predictable and the original draft is restored afterward.

Screenshots

Schermafdruk van 2026-03-14 17-02-23

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Preserve composer drafts during pending user input in ChatView

  • Adds resolveComposerDraftText in ChatView.logic.ts to select between a pending custom answer and the main prompt as the visible composer value.
  • Updates ChatView.tsx to display and edit the pending custom answer in the composer while keeping the main prompt draft intact, restoring it once the pending input is cleared.
  • Routes send/emptiness checks and applyPromptReplacement through the active visible value so edits target the correct state (custom answer vs. main prompt).
  • Adds an integration test in ChatView.browser.tsx verifying draft preservation, custom answer routing, and draft restoration across snapshot changes.
  • Behavioral Change: onPromptChange and readComposerSnapshot now route mutations to either the custom answer state or the main prompt store depending on whether a pending user input is active.

Macroscope summarized 49a1884.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a7e5da36-a858-44b6-9d80-f290ac0f1bb9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant