@devries-cameron20 / t3code Mirror · read-only / commits / 558790aae5
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 09:45 UTC

fix(web): stashed prompt previews show thread mentions by name, not as raw links (#37498)

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

tiliakoos committed Nov 16, 2026 at 00:48 UTC 558790aae54ac530b369bdc46905be1e4c466412
2 files changed +19 -1
apps/web/src/components/chat/ComposerStashMenu.test.ts
+13
@@ -1,3 +1,7 @@
1 +import {
2 + formatComposerContextReference,
3 + toComposerContextId,
4 +} from "@t3tools/shared/composerContextReferences";
5 import { describe, expect, it } from "vite-plus/test";
6
7 import { stashEntrySnippet } from "./ComposerStashMenu";
@@ -15,4 +19,13 @@ describe("stashEntrySnippet", () => {
19 expect(stashEntrySnippet(entry(`${"a".repeat(89)}😀 and more`))).toBe(`${"a".repeat(89)}…`);
20 expect(stashEntrySnippet(entry(`${"a".repeat(88)}😀 and more`))).toBe(`${"a".repeat(88)}😀…`);
21 });
22 +
23 + it("shows context chips by their label", () => {
24 + const file = formatComposerContextReference({
25 + kind: "file",
26 + contextId: toComposerContextId("readme"),
27 + label: "README.md",
28 + });
29 + expect(stashEntrySnippet(entry(`Summarize ${file} please`))).toBe("Summarize README.md please");
30 + });
31 });
apps/web/src/components/chat/ComposerStashMenu.tsx
+6 -1
@@ -1,6 +1,7 @@
1 import { BookmarkIcon, FileIcon, FileTextIcon } from "lucide-react";
2 import { memo, useEffect, useEffectEvent, useRef, useState, type RefObject } from "react";
3 import { assistantCitationsToPlainText } from "@t3tools/shared/assistantCitations";
4 +import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences";
5
6 import { RelativeTime } from "../RelativeTime";
7 import { cn } from "~/lib/utils";
@@ -14,7 +15,11 @@ function missingImageCount(entry: PromptStashEntry): number {
15 }
16
17 export function stashEntrySnippet(entry: PromptStashEntry): string {
17 - const trimmed = assistantCitationsToPlainText(entry.prompt).trim().replace(/\s+/g, " ");
18 + const trimmed = assistantCitationsToPlainText(
19 + replaceComposerContextReferences(entry.prompt, (reference) => reference.label),
20 + )
21 + .trim()
22 + .replace(/\s+/g, " ");
23 if (trimmed.length > 0) {
24 if (trimmed.length <= SNIPPET_MAX_CHARS) return trimmed;
25 // Never end on a lone high surrogate, the first half of an emoji.