Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): count tile-only images in image-only thread titles #48229

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

Showing 4 changed files with 53 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
19 additions and 0 deletionsapps/mobile/src/lib/projectThreadStartTurn.test.tsModified
View file
@@ -6,6 +6,7 @@
import {
buildProjectThreadStartTurnInput,
deriveThreadTitleFromPrompt,
+ deriveUnsentThreadTitle,
type ProjectThreadStartTurnSpec,
} from "./projectThreadStartTurn";
​
@@ -111,4 +112,22 @@
`${"a".repeat(68)}...`,
});
+​
+ it("counts all attachments for unsent drafts with only an inline image chip", () => {
+ expect(
+ deriveUnsentThreadTitle({
+ text: "![first.png](t3-context://v1/image/image_one)",
+ attachments: [{ name: "first.png" }, { name: "second.png" }],
+ }),
+ ).toBe("2 attachments");
+ expect(deriveUnsentThreadTitle({ text: "", attachments: [{ name: "first.png" }] })).toBe(
+ "1 attachment",
+ );
+ expect(
+ deriveUnsentThreadTitle({
+ text: "Compare ![first.png](t3-context://v1/image/image_one)",
+ attachments: [{ name: "first.png" }, { name: "second.png" }],
+ }),
+ ).toBe("Compare");