Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep typed text when a question option is clicked #12575

Closedmyfunc(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12575/headopened View on GitHub

Showing 4 changed files with 40 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
6 additions and 0 deletionsapps/web/src/components/chat/ChatComposer.tsxModified
View file
@@ -3080,6 +3080,11 @@
useEffect(() => {
const nextCustomAnswer = activePendingProgress?.customAnswer;
if (typeof nextCustomAnswer !== "string") {
+ // The question is gone and the editor shows the thread draft again. The
+ // ref still holds the last answer text, and Send reads the ref.
+ if (lastSyncedPendingInputRef.current !== null) {
+ promptRef.current = prompt;
+ }
lastSyncedPendingInputRef.current = null;
return;
@@ -3114,6 +3119,7 @@
activePendingProgress?.customAnswer,
activePendingProgress?.activeQuestion?.id,
activePendingUserInput?.requestId,
+ prompt,
promptRef,
14 additions and 0 deletionsapps/web/src/components/ChatView.tsxModified
View file
@@ -148,6 +148,7 @@
} from "./chat/timelineScrollAnchoring";
import {
buildPendingUserInputAnswers,
+ carryDisplacedCustomAnswerIntoPrompt,