Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): restore reverted messages to composer #6044

Closedamitray007(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/6044/headopened View on GitHub

Showing 6 changed files with 150 additions and 0 deletions (loading 3).

x
0 of 6 viewed, 6 left
10 additions and 0 deletionsapps/web/src/components/chat/ChatComposer.tsxModified
View file
@@ -460,6 +460,8 @@
expandedCursor: number;
terminalContextIds: string[];
+ /** Stash the current text and images, returning whether the initial write succeeded. */
+ stashCurrentPrompt: () => boolean;
/** Reset composer cursor/trigger/highlight after external prompt mutations (e.g. onSend). */
resetCursorState: (options?: {
cursor?: number;
@@ -980,6 +982,7 @@
* thread) can still be stashed while an earlier encode is running.
const stashInFlightRef = useRef<Set<string>>(new Set());
+ const stashInitialWriteSucceededRef = useRef(false);
/**
* Count of pasted images still being compressed, per thread. Reserved
* against the attachment limit so concurrent pastes can't overshoot it,
@@ -2065,6 +2068,7 @@
const stashCurrentPrompt = useCallback(async () => {
+ stashInitialWriteSucceededRef.current = false;
// Terminal-context placeholders reference live sessions the stash can't
// round-trip, so they are stripped from the stashed prompt.
const prompt = promptRef.current.split(INLINE_TERMINAL_CONTEXT_PLACEHOLDER).join("").trim();
@@ -2137,6 +2141,7 @@
setComposerCursor(0);