// --------------------------------------------------------------------------- // shell/icons.tsx — THE SHELL'S GLYPH VOCABULARY, in one file. // // WHY THIS FILE EXISTS (wave 53, contract C4). The rail's marks were defined // inline in `Shell.tsx`, and one of them — the database cylinder — was ALSO // hand-copied into `ViewSidebar.tsx` and into the Home page. Three hands drawing // one mark is how two rows that mean the same thing stop looking alike; the copy // nobody edits is the one a reader sees. So the shell's glyphs live here, are // imported by every shell surface, and are edited in exactly one place. // // S72-T05 (R111): sidebar rows draw from `@phosphor-icons/react` (outline // `regular`, active `fill`), imported per icon in `Shell.tsx`. A glyph here is // either one the library does not ship (`ArtifactsGlyph`, composed from its // shapes) or a hand-drawn mark another surface still mounts (`AgentIcon`, Home). // // THE RULES for a hand-drawn glyph, and they are not style preferences: // · ONE EXPORT PER GLYPH. No shared sub-components, no shared state, no // parameterised "icon factory" — a second glyph must be addable by appending // a function, without reading the one above it. // · EACH EXPORT CARRIES THE WAVE AND TICKET THAT DREW IT in its own comment, // so the next person changing a mark can find the instruction it answers // before they overrule it. // · 16x16 viewBox, stroke-only, round caps, vector paths — NEVER emoji // (owner constant). // · NO LOCAL PAINT. `.shell-nav-icon` in `index.css` owns `fill: none`, // `stroke: currentColor` and the shared `stroke-width: 1.2`. A glyph that // hardcodes any of those leaves the column the next time the rail's weight // is retuned, and nothing goes red — it just drifts. // ⛔ THAT LAST RULE HAS A TRAP THE FIRST GLYPH HERE ALREADY HIT. A CSS class // rule BEATS an SVG presentation attribute, so `fill="currentColor"` on a // shape inside `.shell-nav-icon` renders INVISIBLE: the class says // `fill: none` and wins. A "solid" dot is therefore drawn as a SMALL STROKED // CIRCLE whose own 1.2 stroke closes the hole, never as a filled one. // A library glyph wears `shell-nav-icon is-glyph`, which paints fill. // // Guarded by `verify_icons.py` (gate `icons`), which reads the glyphs from THIS // file and the mounts from `Shell.tsx`. // --------------------------------------------------------------------------- import { useId } from "react"; import type { IconWeight } from "@phosphor-icons/react"; import { Circle } from "@phosphor-icons/react/dist/csr/Circle"; import { Square } from "@phosphor-icons/react/dist/csr/Square"; import { Triangle } from "@phosphor-icons/react/dist/csr/Triangle"; /** ⭐⭐ WAVE 53 · T34 (owner instruction 4) — THE AGENTS ROW'S MARK: A SQUARE * WITH TWO EYES. Owner, verbatim: *"Agent module icon is still ugly. How about * just make it square and have two dots in side that looks like an eye."* * S72-T05: the rail row now draws the library's `Robot`; Home's Agents cards * still mount this mark. * * ⛔ IT REPLACES `FlowIcon`, THE TWO-NODE FLOW GLYPH WAVE 51 SHIPPED HERE — and * `FlowIcon` had itself replaced a robot, which R15 deleted. NEITHER COMES * BACK. The flow mark was the better ARGUMENT (an agent is a step, an edge, the * next step) and it lost anyway, because at 16px three loose outlined shapes * read as a diagram of nothing rather than as one thing. A face reads as one * thing at any size, which is the whole of what a 16px rail mark has to do. * * ⚠ THE DOTS ARE STROKED CIRCLES, NOT FILLED ONES, AND THAT IS THE POINT OF * FAILURE IF ANYONE "TIDIES" IT. `.shell-nav-icon` declares `fill: none`, and a * class rule outranks a presentation attribute, so `fill="currentColor"` here * paints NOTHING and the square renders empty. At r=0.95 under the class's own * 1.2 stroke the remaining hole is 0.7 units wide, which closes into a solid dot * at 16px while keeping the glyph's paint entirely delegated the way every * sibling mark's is. An inline style would also work and is the wrong trade: it * would be the one mark in the rail that does not follow the class. * ⚠ THE RADIUS AND THE SPACING ARE A PAIR, MEASURED ON THE SHOT, not tuned * independently. Under a 1.2 stroke r=0.95 draws a 3.1-wide dot, so the centres * are 4.6 apart to leave 1.5 of clear ground between them: closer and the two * dots blur into one bar at 16px, which is a squint, not a pair of eyes. * * Geometry: the square sits on the 2.4 to 13.6 box the old Sheet mark used, with * a wider corner radius so it reads as a head rather than as another sheet. The * eyes sit a touch above the box centre, which is where a face carries them; * dead-centre reads as a colon. */ export function AgentIcon() { return ( ); } /* ⛔ `DatabaseIcon` (W53-T35) LIVED HERE AND IS DELETED: the Data row draws the library's `Database` since S72-T05 and nothing else mounted it. Home and the View rail keep `iconShapes.ts::DATABASE_SHAPE_PATHS`. */ /** Where each library shape sits inside the 256-unit box, at 184 units (0.72 scale). Measured on * 1x and 2x shots: circle back left, triangle back right, square in front below. */ const SHAPE_BOX = 184; const CIRCLE_AT = { x: -16, y: -14 }; const TRIANGLE_AT = { x: 84, y: -16 }; const SQUARE_AT = { x: 44, y: 84 }; /** Mask stroke around a front shape, in glyph units: the gap that keeps two filled shapes apart. */ const HALO = 32; /** S72-T05 (instruction 21, R111) — the Artifacts row: a triangle, a square and a circle that * overlap, composed from the library's own `Triangle`, `Square` and `Circle`. * Phosphor's `Shapes` draws the three apart, which is why this is composed. * ⚠ The outline state draws the `bold` weight: at 0.72 scale it lands on `regular`'s 1px line. * ⚠ Masks cut each back shape around the ones in front, so the filled state stays three shapes. */ export function ArtifactsGlyph({ weight, className }: { weight: IconWeight; className?: string }) { const id = useId().replace(/[^A-Za-z0-9_-]/g, ""); const drawn: IconWeight = weight === "fill" ? "fill" : "bold"; const cut = { weight: "fill" as const, color: "black", stroke: "black", strokeWidth: HALO, strokeLinejoin: "round" as const, size: SHAPE_BOX }; return ( ); }