Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(grok): make the mascot readable in the light theme and pin its art with real assertions

enes6d0a29efac58
diff --git a/docs/grok-agent.md b/docs/grok-agent.md
index 1f30111e5..2c3d1e46c 100644
--- a/docs/grok-agent.md
+++ b/docs/grok-agent.md
@@ -294,7 +294,7 @@ in the node menu, the pane menu and the command palette; there is no header butt
| Context meter | **not implemented for grok** (§1) | idem | idem |
| Managed accounts | **deliberately N/A** — accounts are a claude config-dir mechanism. `createAgentNode` never stamps an `accountId` onto a non-claude node, and `CLAUDE_CONFIG_DIR` is irrelevant to `~/.grok/hooks`. A grok node in a managed-account project must still report status (checklist 7) | idem | idem |
| Brand logo | `AGENT_LOGO.grok` → `renderer/assets/grok.svg` — a **placeholder monogram** (§8) | same asset, for free | the phone draws its own icons — **follow-up owed** |
-| Notch mascot | yes — its own slate-300 critter through the shared `buildQuadrantSprite`; the CSS rule block is *shared* with claude's, so the geometry cannot drift | **N/A** — there is no notch there; the canvas badge mascot works | the phone has its own SwiftUI renderer |
+| Notch mascot | yes — its own mid-slate (`#8494a8`) critter through the shared `buildQuadrantSprite`; the CSS rule block is *shared* with claude's, so the geometry cannot drift | **N/A** — there is no notch there; the canvas badge mascot works | the phone has its own SwiftUI renderer |
| Fullscreen TUI setting | **N/A** — grok runs full-screen by default, so `claude-tui.ts` has no grok analogue | idem | idem |
| Deterministic hook-reply approvals (phone Approve/Deny) | **claude-only** — `pty-manager` arms `NODETERM_PERM_WAIT_SECS` only for claude, and grok does not subscribe `PermissionRequest` at all | idem | a grok node's approvals are not answerable from the phone |
| Kanban card + card modal | badges and the 💬 comments panel work (derived from the same nodes and the same status store); the meter row has nothing to show for grok | same | the iOS board is a separate read/move mirror |
diff --git a/docs/mascot-sprites.md b/docs/mascot-sprites.md
index aba481567..f9efc0b2b 100644
--- a/docs/mascot-sprites.md
+++ b/docs/mascot-sprites.md
@@ -39,8 +39,11 @@ frame 0: "▘ ▐███▌ ▝" / " ▙█████▟ " / " ▘▘ ▝
frame 1: "▝ ▐███▌ ▘" / " ▙█████▟ " / " ▝▝ ▘▘ "
```
-- Color: slate-300 `rgb(203, 213, 225)` — the node color (`#64748b`) is too dark to read at
- 16 px on the black canvas badge and on the notch strip.
+- Color: `#8494a8`, a mid-tone. The badge lives in the node HEADER (`--panel-header`), which is
+ `#323232` dark but `#eae5db` LIGHT, so the sprite must survive both themes plus the notch
+ capsule's black. Measured contrast (dark / light / notch): this `4.14 / 2.47 / 6.78` vs Claude
+ coral's `4.11 / 2.49 / 6.73` — same balance. A light slate-300 reads 8.64 dark but **1.18
+ light**, i.e. invisible in a shipped theme; the node color `#64748b` reads only 2.69 dark.
- Both sprites go through `buildQuadrantSprite(frames, color)` in `src/renderer/lib/mascot.ts`
and reuse `CLAUDE_FRAME_WIDTH/HEIGHT`, so they cannot drift on aspect ratio or smoothing.
diff --git a/src/renderer/hud/main.ts b/src/renderer/hud/main.ts
index 0fdec61bd..b6b1ca6e0 100644
--- a/src/renderer/hud/main.ts
+++ b/src/renderer/hud/main.ts
@@ -127,7 +127,8 @@ function reltime(ts: number): string {
// and the Codex pet at 26px; these are the sensible defaults — NAIL EXACTLY ON A MAC (the notch
// bar height varies by model, and 26px overflows a short bar). Aspect ratios are preserved from
// the sprite geometry, so only the height matters.
-const HUD_CLAUDE_H = 13
+/** Height of every quadrant-block sprite (claude, grok) — they share the frame aspect. */
+const HUD_QUADRANT_H = 13
const HUD_CODEX_H = 17
/** A quadrant-block sprite mascot (claude, grok) — the sizing math is shared so the notch strip
@@ -138,7 +139,7 @@ function quadrantMascot(
): HTMLElement {
const el = document.createElement('span')
el.className = `mascot mascot--${variant}`
- const h = HUD_CLAUDE_H
+ const h = HUD_QUADRANT_H
const w = Math.round((h * mascot.frameWidth) / mascot.frameHeight)
el.style.setProperty('--mascot-w', `${w}px`)
el.style.setProperty('--mascot-h', `${h}px`)
diff --git a/src/renderer/lib/mascot.test.ts b/src/renderer/lib/mascot.test.ts
index 4d6923b54..b8600216f 100644
--- a/src/renderer/lib/mascot.test.ts
+++ b/src/renderer/lib/mascot.test.ts
@@ -99,9 +99,42 @@ describe('grok mascot', () => {
}
})
+ it('draws an actual critter in both frames (not a blank sheet)', () => {
+ // Without this, blanking the art to a single stray pixel passes every other assertion here.
+ for (const frame of GROK_FRAME_ART) {
+ expect(decodeFrame(frame).pixels.some(Boolean)).toBe(true)
+ expect(countOn(decodeFrame(frame))).toBeGreaterThan(20)
+ }
+ })
+
+ it('is written only from glyphs the decoder knows', () => {
+ // Hand-authored art's realistic regression: a typo'd or look-alike block (e.g. the half-block
+ // ▀, absent from QUADRANT_BITS) decodes SILENTLY to nothing, leaving holes no other test sees.
+ for (const frame of GROK_FRAME_ART) {
+ for (const ch of frame.join('')) {
+ expect(QUADRANT_BITS[ch]).toBeDefined()
+ }
+ }
+ })
+
it('alternates the feet, so it walks instead of sliding', () => {
+ // "Walks" = the FEET move while the body stays put. Whole-bitmap inequality is not enough:
+ // grok's antennae already differ between frames, so it would pass with identical feet.
const [a, b] = GROK_FRAME_ART.map(decodeFrame)
- expect(a.pixels).not.toEqual(b.pixels)
+ const fa = footRegion(a)
+ const fb = footRegion(b)
+ expect(fa).not.toEqual(fb)
+ // The walk moves the feet, it does not remove them.
+ expect(fa.some(Boolean)).toBe(true)
+ expect(fb.some(Boolean)).toBe(true)
+ // The body (art row 1 → sub-pixel rows 2–3) is identical, so the critter does not slide.
+ expect(a.pixels.slice(2 * SUB_COLS, 4 * SUB_COLS)).toEqual(
+ b.pixels.slice(2 * SUB_COLS, 4 * SUB_COLS)
+ )
+ // The head row DOES differ, by design: the two antennae swap sides so it bobs as it walks.
+ // (This is why the body slice above stops at row 2 instead of covering rows 0–3 like
+ // claude's equivalent test.)
+ expect(a.pixels.slice(0, 2 * SUB_COLS)).not.toEqual(b.pixels.slice(0, 2 * SUB_COLS))
})
it("is a DIFFERENT critter from claude's, not a recolor", () => {
diff --git a/src/renderer/lib/mascot.ts b/src/renderer/lib/mascot.ts
index 6323a3dc4..86a70dff1 100644
--- a/src/renderer/lib/mascot.ts
+++ b/src/renderer/lib/mascot.ts
@@ -133,9 +133,20 @@ export const CLAUDE_MASCOT = {
// --- Grok critter ---------------------------------------------------------------------------
-/** Slate-300. The node color (#64748b) is too dark to read at 16 px on the black canvas badge and
- * on the notch strip, which is the one thing this sprite has to do. */
-export const GROK_COLOR = 'rgb(203, 213, 225)'
+/**
+ * The sprite color — a MID-tone, deliberately not the node color and not a light slate.
+ *
+ * The badge is NOT on the canvas: `AgentMascot` renders inside `.term-node__status` in the node
+ * HEADER, whose background is `--panel-header` — `#323232` in the dark theme but `#eae5db` in the
+ * LIGHT one. So the sprite has to survive both, plus the notch capsule (`--capsule-bg: #000`).
+ * One color, chosen to match Claude coral's balance across the two themes rather than to win on
+ * either (measured contrast vs `--panel-header` dark / light / vs the notch black):
+ * coral #d97757 → 4.11 / 2.49 / 6.73 this #8494a8 → 4.14 / 2.47 / 6.78
+ * A light slate-300 measures 8.64 dark but 1.18 LIGHT — a ghost in a shipped theme, which is why
+ * it is not used here. Single color on purpose: the component sets `background-image` inline, so a
+ * CSS `[data-theme]` override could not win, and two sprites is more machinery than this needs.
+ */
+export const GROK_COLOR = '#8494a8'
/**
* Grok's two walk frames. A different silhouette from Claude's rounded blob — narrower body with
@@ -150,8 +161,8 @@ export const GROK_FRAME_ART: readonly string[][] = [
/** The two decoded grok walk frames. */
export const GROK_FRAMES: MascotBitmap[] = GROK_FRAME_ART.map(decodeFrame)
-/** Grok walk spritesheet — same grid and display geometry as Claude's, so the CSS `steps(2)`
- * walk animation and the HUD sizing math are shared verbatim. */
+/** Grok walk spritesheet — same grid and display geometry as Claude's, so the CSS walk animation
+ * (`steps(1)` over three keyframes) and the HUD sizing math are shared verbatim. */
export const GROK_MASCOT = {
/** data: URI PNG, or '' outside a DOM (tests). */
src: buildQuadrantSprite(GROK_FRAMES, GROK_COLOR),
diff --git a/src/renderer/nodes/AgentMascot.tsx b/src/renderer/nodes/AgentMascot.tsx
index 9c54cfbd6..1c85841dc 100644
--- a/src/renderer/nodes/AgentMascot.tsx
+++ b/src/renderer/nodes/AgentMascot.tsx
@@ -5,7 +5,8 @@ import codexPet from '../assets/pet-codex.webp'
/**
* The walking mascot shown inside the RUNNING badge (docs/mascot-sprites.md):
- * - claude → the runtime-drawn coral pixel critter (data-URI spritesheet, CSS `steps(2)` walk).
+ * - claude → the runtime-drawn coral pixel critter (data-URI spritesheet; the walk is CSS
+ * `steps(1)` over three keyframes, NOT `steps(2)` — see .term-node__mascot--claude).
* - grok → its own slate critter, same quadrant machinery and walk geometry.
* - codex → pet-codex.webp, first-row walk cycle (CSS `steps(8)`).
* - anything else (gemini/opencode/custom/plain) → the plain pulsing dot, unchanged.