Skip to content

Commit 1ab7bbf

Browse files
wesbillmanPinky
andauthored
fix(desktop): preserve snapshot attachment URLs (#1905)
Signed-off-by: Wes <[email protected]> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
1 parent 54e174b commit 1ab7bbf

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎desktop/src/shared/ui/markdownFileCard.test.mjs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,23 @@ test("resolveSnapshotCard: uppercase .AGENT.JSON classifies as snapshot card", (
227227

228228
// ── snapshot card thumbnails ─────────────────────────────────────────────────
229229

230-
test("resolveSnapshotCard: .agent.png uses its own URL as thumb", () => {
230+
test("resolveSnapshotCard: keeps canonical PNG URL for actions", () => {
231231
const card = resolveSnapshotCard(
232232
{ m: "image/png", size: 2048, filename: "bot.agent.png", x: SHA256 },
233233
PNG_URL,
234234
"",
235235
);
236236
assert.ok(card !== null);
237-
// PNG attachment URL is rewritten by rewriteRelayUrl — just verify it's set
237+
assert.equal(card.href, PNG_URL);
238238
assert.ok(
239239
card.thumb != null,
240240
"PNG card must have a thumb set from its own URL",
241241
);
242+
assert.notEqual(
243+
card.thumb,
244+
card.href,
245+
"only the display thumbnail may use the local media proxy",
246+
);
242247
});
243248

244249
test("resolveSnapshotCard: .agent.json without thumb field yields undefined thumb", () => {

‎desktop/src/shared/ui/markdownFileCard.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function resolveSnapshotCard(
8686
const snapshotKind: "agent" | "team" = isJson || isPng ? "agent" : "team";
8787

8888
return {
89-
href: rewriteRelayUrl(href),
89+
href,
9090
filename,
9191
size: entry.size,
9292
sha256,

0 commit comments

Comments
 (0)