Skip to content

Commit 5b91c54

Browse files
committed
feat: use production Totman favicon
1 parent 6fecf25 commit 5b91c54

19 files changed

Lines changed: 183 additions & 31 deletions

File tree

apps/hook/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Plannotator</title>
7-
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
7+
<link rel="icon" type="image/png" sizes="64x64" href="/favicon.png">
88

99
<!-- Fonts -->
1010
<link rel="preconnect" href="https://fonts.googleapis.com">

apps/marketing/public/favicon.png

54.2 KB
Loading

apps/marketing/public/favicon.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/marketing/src/layouts/Base.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import '../styles/global.css';
2323
<meta charset="UTF-8" />
2424
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2525
<title>{title}</title>
26-
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
26+
<link rel="icon" type="image/png" sizes="256x256" href="/favicon.png">
2727
<meta name="description" content={description} />
2828

2929
<meta property="og:type" content="website" />

apps/pi-extension/server/handlers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { IncomingMessage } from "node:http";
99
import { tmpdir } from "node:os";
1010
import { join, resolve as resolvePath } from "node:path";
1111
import { saveDraft, loadDraft, deleteDraft, getDraftGeneration } from "../generated/draft.js";
12-
import { FAVICON_SVG } from "../generated/favicon.js";
12+
import { FAVICON_PNG_BYTES } from "../generated/favicon.js";
1313

1414
import { json, parseBody, send, toWebRequest } from "./helpers";
1515
import {
@@ -229,8 +229,8 @@ export function readDraftGenerationFromBody(body: unknown): number | undefined {
229229
export { readDraftGenerationFromUrl };
230230

231231
export function handleFavicon(res: Res): void {
232-
send(res, FAVICON_SVG, 200, {
233-
"Content-Type": "image/svg+xml",
232+
send(res, Buffer.from(FAVICON_PNG_BYTES), 200, {
233+
"Content-Type": "image/png",
234234
"Cache-Control": "public, max-age=86400",
235235
});
236236
}

apps/pi-extension/server/serverAnnotate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ export async function startAnnotateServer(options: {
609609
} else if (url.pathname === "/api/reference/files/stream" && req.method === "GET") {
610610
handleFileBrowserStreamRequest(req, res, url);
611611
return;
612-
} else if (url.pathname === "/favicon.svg") {
612+
} else if (url.pathname === "/favicon.png") {
613613
handleFavicon(res);
614614
} else if (url.pathname === "/api/exit" && req.method === "POST") {
615615
deleteDraft(draftKey, readDraftGenerationFromUrl(req));

apps/pi-extension/server/serverPlan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export async function startPlanReviewServer(options: {
324324
}
325325
} else if (url.pathname === "/api/agents" && req.method === "GET") {
326326
json(res, { agents: [] });
327-
} else if (url.pathname === "/favicon.svg") {
327+
} else if (url.pathname === "/favicon.png") {
328328
handleFavicon(res);
329329
} else if (url.pathname === "/api/save-notes" && req.method === "POST") {
330330
await handleSaveNotesRequest(req, res);

apps/pi-extension/server/serverReview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ export async function startReviewServer(options: {
23132313
}
23142314
} else if (url.pathname === "/api/draft") {
23152315
await handleDraftRequest(req, res, draftKey);
2316-
} else if (url.pathname === "/favicon.svg") {
2316+
} else if (url.pathname === "/favicon.png") {
23172317
handleFavicon(res);
23182318
} else if (await editorAnnotations.handle(req, res, url)) {
23192319
return;

apps/review/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Code Review</title>
7-
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
7+
<link rel="icon" type="image/png" sizes="64x64" href="/favicon.png">
88

99
<!-- Fonts -->
1010
<link rel="preconnect" href="https://fonts.googleapis.com">

packages/core/favicon.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { describe, expect, test } from "bun:test";
2+
import { createHash } from "node:crypto";
3+
import {
4+
FAVICON_PNG_BYTES,
5+
FAVICON_PNG_DATA_URL,
6+
FAVICON_SVG,
7+
} from "./favicon";
8+
9+
describe("production favicon", () => {
10+
test("embeds the canonical 64px PNG exactly", () => {
11+
expect(createHash("sha256").update(FAVICON_PNG_BYTES).digest("hex")).toBe(
12+
"8467d50dba314f3b72ab73ba37d406baabd8d74ed72529e853613442a8c65073",
13+
);
14+
expect(Array.from(FAVICON_PNG_BYTES.subarray(0, 8))).toEqual([
15+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
16+
]);
17+
18+
const view = new DataView(
19+
FAVICON_PNG_BYTES.buffer,
20+
FAVICON_PNG_BYTES.byteOffset,
21+
FAVICON_PNG_BYTES.byteLength,
22+
);
23+
expect(view.getUint32(16)).toBe(64);
24+
expect(view.getUint32(20)).toBe(64);
25+
});
26+
27+
test("keeps the SVG export as a wrapper around the canonical PNG", () => {
28+
expect(FAVICON_PNG_DATA_URL).toStartWith("data:image/png;base64,");
29+
expect(FAVICON_SVG).toContain(FAVICON_PNG_DATA_URL);
30+
expect(FAVICON_SVG).not.toContain("<text");
31+
expect(FAVICON_SVG).not.toContain("#070b14");
32+
});
33+
});

0 commit comments

Comments
 (0)