fix: improve business logic in prompt editor and fix cursor bugs in Plan mode#867
fix: improve business logic in prompt editor and fix cursor bugs in Plan mode#867nmggithub wants to merge 4 commits intopingdotgg:mainfrom
Conversation
…mptEditorHandle`
… prop-controlled updates
|
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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
What Changed
This makes four changes all related to the prompt editor (each in their own commit):
onChangedoesn't fire inComposerPromptEditorfor prop-controlled changes (better behavior, I believe)3 and 4 can be seen below. 1 and 2 are business logic changes that should (hopefully) not have any affect on the UI.
I could also add raising answer state to the
composerDraftStorehere, but I feel like that might be scope creep. It's all a bit intertwined, though, so separating them out is difficult.Why
Each change has its own motivations:
onChangehandler.UI Changes
Before
Screen.Recording.2026-03-10.at.19.39.17.mov
After
Screen.Recording.2026-03-10.at.19.40.18.mov
Checklist
Note
Fix cursor bugs and prompt sync logic in Plan mode composer
customAnswerinto the composer now tracks the last-syncedrequestIdandquestionId, updating the editor only when the active question/request changes or when the server-provided text differs from the current editor content.isApplyingControlledUpdateRefflag prevents programmatic value/cursor updates from triggeringonChangecallbacks, breaking the feedback loop that caused cursor bugs.Macroscope summarized a929143.