Give the app a mark that survives being 16 pixels tall
The icon is now a container with its right wall opened, so the enclosure itself is the letter C, holding a >_ prompt: the two things the app is, in one closed shape. It carries no type, so nothing goes illegible when the shell draws it small, and it uses the app's own accent tokens rather than a saturated orange field that fights the chrome behind it. icon.ico contained a single 16x16 image, which Windows was upscaling into the taskbar and every other slot — the likely cause of the artefact in screenshot_for_fix/. It now carries 16, 24, 32, 48, 64, 128 and 256, each rendered from vector rather than downsampled from one bitmap, and the entries at 32 and below come from a separate optical source: at that size the cursor bar closes up against the chevron, so the small variant drops it, widens the mouth and thickens the strokes. A test asserts the .ico keeps its small sizes so this cannot regress silently. Also adds the icon.icns that macOS bundles have been building without, points the favicon at our own mark instead of the missing /vite.svg, and puts the SVG sources, the lockups and the regeneration script in branding/. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,4 +33,33 @@ describe("Window icon configuration", () => {
|
||||
expect(config.bundle.icon).toContain("icons/icon.ico");
|
||||
expect(config.bundle.icon).toContain("icons/icon.png");
|
||||
});
|
||||
|
||||
it("icon.ico carries the small sizes Windows draws in the taskbar", () => {
|
||||
// A single-image .ico is the taskbar bug: Windows upscales 16x16 into every
|
||||
// other slot. Regenerate with `python3 branding/build-icons.py`.
|
||||
const ico = readFileSync(resolve(srcTauriDir, "icons/icon.ico"));
|
||||
const count = ico.readUInt16LE(4);
|
||||
expect(count).toBeGreaterThan(1);
|
||||
|
||||
// Directory entries start at byte 6; width/height of 0 means 256.
|
||||
const widths = new Set<number>();
|
||||
for (let i = 0; i < count; i++) {
|
||||
const w = ico[6 + i * 16];
|
||||
widths.add(w === 0 ? 256 : w);
|
||||
}
|
||||
for (const size of [16, 24, 32, 48, 256]) {
|
||||
expect(widths).toContain(size);
|
||||
}
|
||||
});
|
||||
|
||||
it("icon.icns exists and is bundled for macOS", () => {
|
||||
const icnsPath = resolve(srcTauriDir, "icons/icon.icns");
|
||||
expect(existsSync(icnsPath)).toBe(true);
|
||||
expect(readFileSync(icnsPath).subarray(0, 4).toString("ascii")).toBe("icns");
|
||||
|
||||
const config = JSON.parse(
|
||||
readFileSync(resolve(srcTauriDir, "tauri.conf.json"), "utf-8")
|
||||
);
|
||||
expect(config.bundle.icon).toContain("icons/icon.icns");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user