@devries-cameron20 / t3code-1 / commits / 8f778615f9
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): queued follow-ups show the quoted text instead of the citation link (#18999)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Igor Makowski committed Oct 20, 2026 at 02:09 UTC 8f778615f97210a8e9fc32250b61f4e227dffe1c
2 files changed +56 -2
apps/web/src/components/chat/QueuedRunsControl.browser.test.tsx
+51
@@ -1,6 +1,9 @@
1 +import { EnvironmentId, MessageId, ThreadId } from "@t3tools/contracts";
2 +import { serializeAssistantCitation } from "@t3tools/shared/assistantCitations";
3 import { act, type ComponentProps } from "react";
4 import { createRoot, type Root } from "react-dom/client";
5 import { afterEach, describe, expect, it, vi } from "vite-plus/test";
6 +import { page } from "vite-plus/test/browser";
7
8 const state = vi.hoisted(() => ({
9 projection: null as unknown,
@@ -162,3 +165,51 @@ describe("QueuedRunsControl attachments and edit mode", () => {
165 expect(view.textContent).toContain("Queued with a screenshot");
166 });
167 });
168 +
169 +it("previews assistant quotes as readable text and preserves the citation when editing", async () => {
170 + const quotedText = "Cache the parsed config per worktree.";
171 + const quote = serializeAssistantCitation({
172 + version: 1,
173 + environmentId: EnvironmentId.make("environment:test"),
174 + threadId: ThreadId.make("thread:test"),
175 + messageId: MessageId.make("message:assistant"),
176 + text: quotedText,
177 + start: 0,
178 + end: quotedText.length,
179 + prefix: "",
180 + suffix: "",
181 + });
182 + const quoteAndText = `${quote}\n\nWhy per worktree?`;
183 + state.projection = { projection: { messages: [] } };
184 + state.workflow = {
185 + activeRun: { id: "run:active" },
186 + canPromoteToSteer: true,
187 + canReorder: true,
188 + queuedRuns: [
189 + {
190 + run: { id: "run:quote-only", userMessageId: "message:quote-only" },
191 + text: quote,
192 + attachments: [],
193 + },
194 + {
195 + run: { id: "run:quote-and-text", userMessageId: "message:quote-and-text" },
196 + text: quoteAndText,
197 + attachments: [],
198 + },
199 + ],
200 + };
201 + const onEditQueuedRun = vi.fn();
202 + await render({ onEditQueuedRun });
203 +
204 + await expect.element(page.getByText(quotedText, { exact: true })).toBeVisible();
205 + await expect
206 + .element(page.getByText(`${quotedText} Why per worktree?`, { exact: true }))
207 + .toBeVisible();
208 +
209 + await act(async () => {
210 + await page.getByRole("button", { name: "Edit queued message", exact: true }).nth(1).click();
211 + });
212 + expect(onEditQueuedRun).toHaveBeenCalledExactlyOnceWith(
213 + expect.objectContaining({ text: quoteAndText }),
214 + );
215 +});
apps/web/src/components/chat/QueuedRunsControl.tsx
+5 -2
@@ -1,5 +1,6 @@
1 import { scopeThreadRef } from "@t3tools/client-runtime/environment";
2 import { deriveThreadQueueWorkflowState } from "@t3tools/client-runtime/state/thread-workflows";
3 +import { assistantCitationsToPlainText } from "@t3tools/shared/assistantCitations";
4 import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences";
5 import type {
6 ChatAttachment as ContractChatAttachment,
@@ -246,8 +247,10 @@ export function QueuedRunsControl({
247 <ComposerBanner.Scroll className={cn("max-h-32", !expanded && "hidden")}>
248 <ComposerBanner.Children render={<ol />} id={queueListId}>
249 {items.map((item) => {
249 - const previewText = replaceComposerContextReferences(item.text, (reference) =>
250 - reference.kind === "image" && item.thumbnails.length > 0 ? "" : reference.label,
250 + const previewText = assistantCitationsToPlainText(
251 + replaceComposerContextReferences(item.text, (reference) =>
252 + reference.kind === "image" && item.thumbnails.length > 0 ? "" : reference.label,
253 + ),
254 ).trim();
255 const rowRunId = item.runId;
256 const rowServerIndex = item.serverIndex;