Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/inbox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Plannotator Inbox</title>
<title>Zosma Inbox</title>
<!-- No type: /favicon.ico is served by the Inbox server, which picks the
bytes from the persisted favicon style (Glass and Yellow are multi-size .ico
files, Face is a PNG), so the response Content-Type is the truthful
Expand Down
2 changes: 1 addition & 1 deletion docs/agent-guides/inbox-notifications-and-agents.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/agent-guides/inbox-window.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/agent-guides/server-and-storage.md

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions packages/core/favicon-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,28 @@
/**
* The favicon a person picks. The ids are what cookies (`plannotator-favicon`)
* and config.json (`favicon`) store:
* - 'glass': the Glass icon, the default for anyone with nothing stored.
* - 'zosma': this fork's own icon, the Zosma AI mark on the brand blue, and the
* default for anyone with nothing stored.
* - 'glass': the Glass icon.
* - 'yellow': the Yellow icon, the glass icon with a yellow glass.
* - 'totman': the Face icon. The id is older than the name: it is what people
* picked when this icon was the default, so it keeps meaning this icon.
* 'classic' (the P icon, offered in 0.28.57) is no longer a style: a stored
* 'classic' reads as nothing stored, so it shows the default, and nothing
* rewrites the file or the cookie that holds it.
*/
export type FaviconStyle = 'glass' | 'yellow' | 'totman';
export type FaviconStyle = 'zosma' | 'glass' | 'yellow' | 'totman';

export const DEFAULT_FAVICON_STYLE: FaviconStyle = 'glass';
export const DEFAULT_FAVICON_STYLE: FaviconStyle = 'zosma';

/** The choices, in the order they are shown, with the names people see. */
export const FAVICON_STYLE_CHOICES: readonly { id: FaviconStyle; label: string }[] = [
{ id: 'zosma', label: 'Zosma' },
{ id: 'glass', label: 'Glass' },
{ id: 'yellow', label: 'Yellow' },
{ id: 'totman', label: 'Face' },
];

export function isFaviconStyle(value: unknown): value is FaviconStyle {
return value === 'glass' || value === 'yellow' || value === 'totman';
return value === 'zosma' || value === 'glass' || value === 'yellow' || value === 'totman';
}
57 changes: 45 additions & 12 deletions packages/core/favicon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import {
CLASSIC_FAVICON_DATA_URL,
CLASSIC_FAVICON_SVG,
DEFAULT_FAVICON_STYLE,
ZOSMA_FAVICON_ICO_BYTES,
ZOSMA_FAVICON_ICO_DATA_URL,
ZOSMA_FAVICON_PNG_BYTES,
ZOSMA_FAVICON_PNG_DATA_URL,
FACE_FAVICON_PNG_BYTES,
FACE_FAVICON_PNG_DATA_URL,
FAVICON_ICO_BYTES,
Expand Down Expand Up @@ -106,36 +110,64 @@ describe("favicon style switcher", () => {
expect(view.getUint32(20)).toBe(64);
});

test("each stored id draws its icon: glass Glass, yellow Yellow, totman Face; classic (the removed P) the default", () => {
test("each stored id draws its icon: zosma Zosma, glass Glass, yellow Yellow, totman Face; classic (the removed P) the default", () => {
expect(faviconDataUrl("zosma")).toBe(ZOSMA_FAVICON_ICO_DATA_URL);
expect(faviconDataUrl("glass")).toBe(FAVICON_ICO_DATA_URL);
expect(faviconDataUrl("totman")).toBe(FACE_FAVICON_PNG_DATA_URL);
expect(faviconDataUrl("yellow")).toBe(YELLOW_FAVICON_ICO_DATA_URL);
expect(faviconBody("zosma")).toEqual({ body: ZOSMA_FAVICON_PNG_BYTES, contentType: "image/png" });
expect(faviconBody("glass")).toEqual({ body: FAVICON_PNG_BYTES, contentType: "image/png" });
expect(faviconBody("totman")).toEqual({ body: FACE_FAVICON_PNG_BYTES, contentType: "image/png" });
expect(faviconBody("yellow")).toEqual({ body: YELLOW_FAVICON_PNG_BYTES, contentType: "image/png" });
// Nothing stored, or a value from somewhere else: the default, Glass.
expect(faviconBody(undefined).body).toBe(FAVICON_PNG_BYTES);
expect(faviconBody("navy").body).toBe(FAVICON_PNG_BYTES);
// 0.28.57's P, still in some config.json files: the default, Glass, on both URLs.
expect(faviconBody("classic")).toEqual({ body: FAVICON_PNG_BYTES, contentType: "image/png" });
expect(faviconIcoBody("classic")).toEqual({ body: FAVICON_ICO_BYTES, contentType: "image/x-icon" });
expect(DEFAULT_FAVICON_STYLE).toBe("glass");
// /favicon.ico: Glass's and Yellow's .ico; Face has none, so its PNG.
// Nothing stored, or a value from somewhere else: the default, this fork's Zosma icon.
expect(faviconBody(undefined).body).toBe(ZOSMA_FAVICON_PNG_BYTES);
expect(faviconBody("navy").body).toBe(ZOSMA_FAVICON_PNG_BYTES);
// 0.28.57's P, still in some config.json files: the default, Zosma, on both URLs.
expect(faviconBody("classic")).toEqual({ body: ZOSMA_FAVICON_PNG_BYTES, contentType: "image/png" });
expect(faviconIcoBody("classic")).toEqual({ body: ZOSMA_FAVICON_ICO_BYTES, contentType: "image/x-icon" });
expect(DEFAULT_FAVICON_STYLE).toBe("zosma");
// /favicon.ico: Zosma's, Glass's and Yellow's .ico; Face has none, so its PNG.
expect(faviconIcoBody("zosma")).toEqual({ body: ZOSMA_FAVICON_ICO_BYTES, contentType: "image/x-icon" });
expect(faviconIcoBody("glass")).toEqual({ body: FAVICON_ICO_BYTES, contentType: "image/x-icon" });
expect(faviconIcoBody(undefined).body).toBe(FAVICON_ICO_BYTES);
expect(faviconIcoBody(undefined).body).toBe(ZOSMA_FAVICON_ICO_BYTES);
expect(faviconIcoBody("totman")).toEqual({ body: FACE_FAVICON_PNG_BYTES, contentType: "image/png" });
expect(faviconIcoBody("yellow")).toEqual({ body: YELLOW_FAVICON_ICO_BYTES, contentType: "image/x-icon" });
// The badge base is each style's one PNG.
expect(faviconPngDataUrl("zosma")).toBe(ZOSMA_FAVICON_PNG_DATA_URL);
expect(faviconPngDataUrl("glass")).toBe(FAVICON_PNG_DATA_URL);
expect(faviconPngDataUrl("totman")).toBe(FACE_FAVICON_PNG_DATA_URL);
expect(faviconPngDataUrl("yellow")).toBe(YELLOW_FAVICON_PNG_DATA_URL);
expect(faviconLinkType("zosma")).toEqual({ type: "image/x-icon", sizes: "16x16 32x32 48x48" });
expect(faviconLinkType("glass")).toEqual({ type: "image/x-icon", sizes: "16x16 32x32 48x48" });
expect(faviconLinkType("totman")).toEqual({ type: "image/png", sizes: "64x64" });
expect(faviconLinkType("yellow")).toEqual({ type: "image/x-icon", sizes: "16x16 32x32 48x48" });
});

test("the picker offers Glass, Yellow and Face, in that order; P is gone", () => {
expect(FAVICON_STYLE_CHOICES.map(({ id, label }) => `${id}:${label}`)).toEqual(["glass:Glass", "yellow:Yellow", "totman:Face"]);
test("the Zosma icon is a three-frame .ico (16, 32, 48) and the same mark as a 64 px PNG", () => {
const ico = ZOSMA_FAVICON_ICO_BYTES;
const view = new DataView(ico.buffer, ico.byteOffset, ico.byteLength);
expect(view.getUint16(0, true)).toBe(0); // reserved
expect(view.getUint16(2, true)).toBe(1); // an icon, not a cursor
expect(view.getUint16(4, true)).toBe(3); // three frames
expect([0, 1, 2].map((frame) => view.getUint8(6 + 16 * frame))).toEqual([16, 32, 48]);
// Every frame is a whole PNG: the signature, then IHDR width and height matching the entry.
for (const frame of [0, 1, 2]) {
const size = view.getUint32(6 + 16 * frame + 8, true);
const offset = view.getUint32(6 + 16 * frame + 12, true);
const png = ico.subarray(offset, offset + size);
expect(Array.from(png.subarray(0, 8))).toEqual([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
const entry = [16, 32, 48][frame]!;
const pngView = new DataView(png.buffer, png.byteOffset, png.byteLength);
expect(pngView.getUint32(16)).toBe(entry);
expect(pngView.getUint32(20)).toBe(entry);
}
const pngView = new DataView(ZOSMA_FAVICON_PNG_BYTES.buffer, ZOSMA_FAVICON_PNG_BYTES.byteOffset, ZOSMA_FAVICON_PNG_BYTES.byteLength);
expect(pngView.getUint32(16)).toBe(64);
expect(pngView.getUint32(20)).toBe(64);
});

test("the picker offers Zosma, Glass, Yellow and Face, in that order; P is gone", () => {
expect(FAVICON_STYLE_CHOICES.map(({ id, label }) => `${id}:${label}`)).toEqual(["zosma:Zosma", "glass:Glass", "yellow:Yellow", "totman:Face"]);
expect(FAVICON_STYLE_CHOICES.map(({ label }) => label).join(" ")).not.toContain("Totman");
});

Expand All @@ -144,6 +176,7 @@ describe("favicon style switcher", () => {
});

test("isFaviconStyle validates only known styles", () => {
expect(isFaviconStyle("zosma")).toBe(true);
expect(isFaviconStyle("glass")).toBe(true);
expect(isFaviconStyle("totman")).toBe(true);
expect(isFaviconStyle("yellow")).toBe(true);
Expand Down
106 changes: 95 additions & 11 deletions packages/core/favicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,86 @@ export const YELLOW_FAVICON_PNG_BYTES = /* @__PURE__ */ Uint8Array.from(
(character) => character.charCodeAt(0),
);

/**
* The Zosma favicon (the fork's own mark, zosma.ai: a white Z on the brand blue #017CF3),
* 16, 32 and 48 px PNG frames in one .ico, and the same icon as one 64 px PNG.
* Drawn from the site's own mark path; rounded square r = 0.22 of the side.
*/
export const ZOSMA_FAVICON_ICO_BASE64 = /* @__PURE__ */ [
"AAABAAMAEBAAAAEAIACpAQAANgAAACAgAAABACAAHwMAAN8BAAAwMAAAAQAgALAEAAD+BAAAiVBORw0KGgoAAAANSUhEUgAAABAA",
"AAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAWNJREFUOI2dkr9LAmEYxz/PeXpGDkUNbd1QCBFtDS0VThIl2BDR5JY0BG2BtgUt",
"jv2mJGiJtiAIWhv9C44kalcHrS47vbfBCPQuKZ/teZ/n+T6fL88roITs6waKNBAVIUiXUAoHsBD22Y2cCpnqtojsdRv6XUy2NIRU",
"L8MAiJvWUWIi7e9HCYP16XYnc2c2Dy/NDgQxNRGMTuHosMZJwSGWt4nlbayS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rlQwLkPOgshwA26/ReDE8w7c",
"pxHYtPoZC3cE8dKBcFJlTsoSOLragTHpxptg+BxQ9VQaltyZGNIevBDB8i9CaPV3VpeRRrjn1sRn4C6yYeXdiWVUNbbDvStkpFzj",
"3wKpKYlPac3eED76OTGi84UYRy4mBjtHLkYRUYFnu60NFJvxPUD6IejZVlWz8X3x3N4Qfrkub/aPId2A6AAGWLBbTCTjfT0sj8GT",
"YVAbIG8nsJNBbYAZjBhgtYDeIBPGwKA2wAxGDLBaQG+MvAVMYMQA2RVMHSMwLz/5Nde8fFvS/zPoD6b0gN1LFc39gZ6YNTEFu5cq",
"UjXFMHw5XHM6gtKp8cUqNuDgCgUNOg9Jp48TUDSU7Tpt/I6xlE3RwrECX7uVhFPi/nLxLxVPVAWlHJFJGQJNLSru2hTAgfMDf2IH",
"zkdQtDkg7XxQMMPYPaab3Agy5m8Poqw2uf2/rqw7HMb87UH4QnJ27pn5hgD4qpTSb/LW0TAe+jiA6wH9jWj1M2ZtC+CdY/03TxeE",
"q4Qybx2BiuXWNDhh4KgAqMFqIRbSIAD60moVlsEpOwXOpR9m4JTVWsyGgUbYHT8K1FAU4DetFmQ+7IGH1M4VZ5nvJAHTLdVkEgw0",
"ojKjCHGBENEKZuj/N+MQpeOjKXLHfncaUOFsAmFZx6dlw5OOtolSVDibYtfiQ+HKjN0AP3nzI8NhBYO9UMVjqHTWdr2uvev0urcA",
"gvYQocAsgTJh4AzApah0neuepr0Yett1FnZnITM93fEB8tCEmS8xaBVsziKtxkP3vuN632wQPTx0Pp/Hd+CU/dg46nhf+f4F3gzE",
"m10NZicAAAAASUVORK5CYII=",
].join("");

export const ZOSMA_FAVICON_ICO_DATA_URL = `data:image/x-icon;base64,${ZOSMA_FAVICON_ICO_BASE64}`;

export const ZOSMA_FAVICON_ICO_BYTES = /* @__PURE__ */ Uint8Array.from(
atob(ZOSMA_FAVICON_ICO_BASE64),
(character) => character.charCodeAt(0),
);

export const ZOSMA_FAVICON_PNG_DATA_URL = `data:image/png;base64,${ZOSMA_FAVICON_PNG_BASE64}`;

export const ZOSMA_FAVICON_PNG_BYTES = /* @__PURE__ */ Uint8Array.from(
atob(ZOSMA_FAVICON_PNG_BASE64),
(character) => character.charCodeAt(0),
);

/**
* Exact historical pre-Totman dark-navy favicon SVG with gold highlight.
* Byte-identical to the FAVICON_SVG that shipped at 5b91c543^.
Expand All @@ -626,46 +706,50 @@ export const CLASSIC_FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" view
export const CLASSIC_FAVICON_DATA_URL = `data:image/svg+xml;base64,${/* @__PURE__ */ btoa(CLASSIC_FAVICON_SVG)}`;

/**
* What a `<link rel="icon">` points at for a style: Glass and Yellow are their
* .ico (the tab picks the 16 or 32 frame), Face is its PNG.
* What a `<link rel="icon">` points at for a style: Zosma, Glass and Yellow are
* their .ico (the tab picks the 16 or 32 frame), Face is its PNG. Any value that
* is not a style reads as the default, Zosma.
*/
export function faviconDataUrl(style: FaviconStyle): string {
if (style === 'glass') return FAVICON_ICO_DATA_URL;
if (style === 'yellow') return YELLOW_FAVICON_ICO_DATA_URL;
if (style === 'totman') return FACE_FAVICON_PNG_DATA_URL;
return FAVICON_ICO_DATA_URL;
return ZOSMA_FAVICON_ICO_DATA_URL;
}

/** A style's icon as one PNG (what `/favicon.png` serves); the Inbox draws its tab-count badge over it. */
export function faviconPngDataUrl(style: FaviconStyle): string {
if (style === 'glass') return FAVICON_PNG_DATA_URL;
if (style === 'yellow') return YELLOW_FAVICON_PNG_DATA_URL;
if (style === 'totman') return FACE_FAVICON_PNG_DATA_URL;
return FAVICON_PNG_DATA_URL;
return ZOSMA_FAVICON_PNG_DATA_URL;
}

/** What a `<link rel="icon">` declares for a style: its type, and the sizes it holds. */
export function faviconLinkType(style: FaviconStyle): { type: 'image/png' | 'image/x-icon'; sizes: string } {
if (style === 'yellow') return { type: 'image/x-icon', sizes: FAVICON_ICO_SIZES };
if (style === 'totman') return { type: 'image/png', sizes: '64x64' };
return { type: 'image/x-icon', sizes: FAVICON_ICO_SIZES };
}

/** The frames in the Glass and Yellow .ico files, as a `sizes` attribute. */
/** The frames in the Zosma, Glass and Yellow .ico files, as a `sizes` attribute. */
export const FAVICON_ICO_SIZES = '16x16 32x32 48x48';

/** What `/favicon.png` answers for a style (any value that is not a style answers the default). */
/** What `/favicon.png` answers for a style (any value that is not a style answers the default, Zosma). */
export function faviconBody(style: unknown): { body: Uint8Array<ArrayBuffer>; contentType: 'image/png' } {
if (style === 'glass') return { body: FAVICON_PNG_BYTES, contentType: 'image/png' };
if (style === 'yellow') return { body: YELLOW_FAVICON_PNG_BYTES, contentType: 'image/png' };
if (style === 'totman') return { body: FACE_FAVICON_PNG_BYTES, contentType: 'image/png' };
return { body: FAVICON_PNG_BYTES, contentType: 'image/png' };
return { body: ZOSMA_FAVICON_PNG_BYTES, contentType: 'image/png' };
}

/**
* What `/favicon.ico` answers for a style, the URL every app page links first:
* Glass and Yellow are their .ico; Face has no .ico, so its PNG (a browser reads an
* icon by its bytes and Content-Type, not by the URL's extension).
* Zosma, Glass and Yellow are their .ico; Face has no .ico, so its PNG (a browser
* reads an icon by its bytes and Content-Type, not by the URL's extension).
*/
export function faviconIcoBody(style: unknown): { body: Uint8Array<ArrayBuffer>; contentType: 'image/png' | 'image/x-icon' } {
if (style === 'glass') return { body: FAVICON_ICO_BYTES, contentType: 'image/x-icon' };
if (style === 'yellow') return { body: YELLOW_FAVICON_ICO_BYTES, contentType: 'image/x-icon' };
if (style === 'totman') return faviconBody(style);
return { body: FAVICON_ICO_BYTES, contentType: 'image/x-icon' };
return { body: ZOSMA_FAVICON_ICO_BYTES, contentType: 'image/x-icon' };
}
Binary file added packages/inbox/assets/app-icon/zosma-180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/inbox/assets/app-icon/zosma-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/inbox/assets/tab-icon/zosma-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/inbox/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { newSessionTip } from '../compose/model';
import { PinnedRow, type PinnedAction } from './PinnedRow';
import { useStarredAbove } from '../starredPills';
import { useInboxTheme } from '../theme';
import { TaterMark } from './TaterMark';
import { ZosmaMark } from './ZosmaMark';
import { ProjectTip } from './ProjectRow';
import { Tip } from './Tip';
import { SectionSortToggle } from './SectionSortToggle';
Expand Down Expand Up @@ -651,8 +651,8 @@ export function Sidebar(props: SidebarProps) {
const bottom = layout.bottom.filter(shows);
const brand = shows('logo') && (
<div className="ib-brand" data-sidebar-item="logo">
<TaterMark />
<b>Plannotator</b>
<ZosmaMark />
<b>Zosma</b>
<span>Inbox</span>
</div>
);
Expand Down
Loading
Loading