fix(desktop): preserve snapshot attachment URLs (#1905)

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Wes
2026-07-15 09:42:52 -07:00
committed by GitHub
co-authored by Pinky
parent 54e174b5e1
commit 1ab7bbfe45
2 changed files with 8 additions and 3 deletions
@@ -227,18 +227,23 @@ test("resolveSnapshotCard: uppercase .AGENT.JSON classifies as snapshot card", (
// ── snapshot card thumbnails ─────────────────────────────────────────────────
test("resolveSnapshotCard: .agent.png uses its own URL as thumb", () => {
test("resolveSnapshotCard: keeps canonical PNG URL for actions", () => {
const card = resolveSnapshotCard(
{ m: "image/png", size: 2048, filename: "bot.agent.png", x: SHA256 },
PNG_URL,
"",
);
assert.ok(card !== null);
// PNG attachment URL is rewritten by rewriteRelayUrl — just verify it's set
assert.equal(card.href, PNG_URL);
assert.ok(
card.thumb != null,
"PNG card must have a thumb set from its own URL",
);
assert.notEqual(
card.thumb,
card.href,
"only the display thumbnail may use the local media proxy",
);
});
test("resolveSnapshotCard: .agent.json without thumb field yields undefined thumb", () => {
+1 -1
View File
@@ -86,7 +86,7 @@ export function resolveSnapshotCard(
const snapshotKind: "agent" | "team" = isJson || isPng ? "agent" : "team";
return {
href: rewriteRelayUrl(href),
href,
filename,
size: entry.size,
sha256,