Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): recall sent prompts with the up arrow #9173

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 13 commits intomain fromrefs/pull/9173/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 99 additions and 1 deletion (loading 6).

x
0 of 7 viewed, 7 left
99 additions and 1 deletionapps/web/src/components/chat/ChatComposer.tsxModified
View file
@@ -803,7 +803,12 @@
} from "../../providerInstances";
import { type AppModelOption, getAppModelOptionsForInstance } from "../../modelSelection";
import type { UnifiedSettings } from "@t3tools/contracts/settings";
-import { type SessionPhase, type Thread, videoMimeType } from "../../types";
+import { type ChatMessage, type SessionPhase, type Thread, videoMimeType } from "../../types";
+import {
+ buildComposerPromptHistoryEntries,
+ stepComposerPromptHistory,
+ type ComposerPromptHistoryPosition,
+} from "./composerPromptHistory";
import type { PendingUserInputDraftAnswer } from "../../pendingUserInput";
import type { PendingApproval, PendingUserInput } from "../../session-logic";
import type { ContextWindowSnapshot } from "../../lib/contextWindow";
@@ -1172,6 +1177,8 @@
activeThreadId: ThreadId | null;
activeThreadEnvironmentId: EnvironmentId | undefined;
activeThread: Thread | undefined;
+ /** Timeline messages including optimistic sends, for ArrowUp prompt recall. */
+ promptHistoryMessages: ReadonlyArray<ChatMessage>;
isServerThread: boolean;
isLocalDraftThread: boolean;
forceExpandedOnMobile: boolean;
@@ -1312,6 +1319,7 @@
activeThreadId,
activeThreadEnvironmentId: _activeThreadEnvironmentId,
activeThread,
+ promptHistoryMessages,