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(glyphgrid): draw the Misc-Technical line-art pieces geometrically — ⎿ keeps its foot

enes951b4211936d
diff --git a/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md b/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md
index 039fb02f2..c591b7509 100644
--- a/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md
+++ b/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md
@@ -68,6 +68,11 @@ Auto after you switched builds, that is why: re-select Shared and carry on.
match the renderer beside it. Known v1 approximations, not defects: **rounded corners
`╭╮╯╰` render SQUARE**, the diagonals `╱╲╳` still come from the font, and the double-line
tees `╠╣╦╩` keep the crossing rail continuous where the printed glyph breaks it.
+ Also run an agent CLI and check its tool-result connectors (`⎿`) and any `⎾ ⎯ ⏐`
+ line-extension pieces: the elbow's foot must be FULL WIDTH, matching GPU mode. A stub foot was
+ the 2026-08-04 device finding — those four Misc-Technical code points are now drawn
+ geometrically as aliases of `└ ┌ ─ │` instead of being drawn by the font and clipped to the
+ cell. (`⎸ ⎹` are deliberately still font-drawn; see L16.)
The round-3 report's "blockier / heavier than GPU mode" should be GONE for line and block art.
If PLAIN TEXT still reads heavier or softer than the per-terminal GPU renderer, that is a
**separate finding** — file it against 2.2/2.7, not here, since nothing in this change touches
@@ -559,6 +564,28 @@ Auto after you switched builds, that is why: re-select Shared and carry on.
through. (The node's OWN flyout/pill is fine — selection elevation lifts them with it, which is
what 3.9c tests.) Fixing this means feeding real chrome geometry into the rule — Phase 2, and
the same question the "chrome on the canvas" answer settles for free.
+- **L16 — A font-drawn glyph whose INK EXCEEDS ITS CELL is clipped; the overflow is lost.** The
+ rasterizer clips every `fillText` to the slot's own cell (`raster.ts` step 2), because a glyph
+ that reached into the gutter would land in a neighbour's mip neighbourhood. xterm's own
+ `TextureAtlas` has no such limit — it MEASURES each glyph's real bounding box, sizes the slot to
+ the ink and renders a quad of that size, so ink may overhang into the neighbouring cells. That is
+ why GPU mode can show shapes shared mode truncates.
+
+ The 2026-08-04 device round measured one instance: **U+23BF ⎿**, Claude Code's tool-result
+ connector, kept about a third of its horizontal foot (8 px against GPU mode's 28). The **escape
+ hatch used so far** is the geometric table — a glyph we DRAW is full-cell by construction, so the
+ clip has nothing to cut — and that finding was fixed by adding four Misc-Technical aliases
+ (`⎿ ⎾ ⎯ ⏐` → `└ ┌ ─ │`) to `box-glyphs.ts`. Line art is therefore covered; what remains is that an
+ unusual FACE could clip something else that is not line art (an ornate script face, a symbol font
+ with genuine side bearings), and no table entry helps there.
+
+ Deliberately still on the font: `⎸ ⎹` (U+23B8/U+23B9, LEFT/RIGHT VERTICAL BOX LINE) sit flush on
+ the cell EDGE rather than centred like `│`, so they are new geometry, not an alias.
+
+ **Escalation if a non-line-art glyph ever needs the overflow:** do what xterm does — per-glyph
+ bounding boxes, slots sized to the INK rather than to the cell, quads sized to the glyph. That
+ touches the atlas allocator, the slot-rect derivation and the shader's uv maths at once, and it
+ changes what the LOD/gutter argument defends. Phase 2.
---
diff --git a/src/renderer/glyphgrid/box-glyphs.test.ts b/src/renderer/glyphgrid/box-glyphs.test.ts
index ce67c1ec7..0f66165f5 100644
--- a/src/renderer/glyphgrid/box-glyphs.test.ts
+++ b/src/renderer/glyphgrid/box-glyphs.test.ts
@@ -332,6 +332,74 @@ describe('box drawing — doubles and dashes', () => {
})
})
+describe('Misc-Technical line-art aliases', () => {
+ // U+23BF ⎿ is Claude Code's tool-result connector. It is NOT in the box-drawing range, so before
+ // the alias map it fell through to `fillText` and the rasterizer's per-slot clip cut the ink the
+ // face draws past the cell — the device round measured the foot at 8px where GPU mode drew 28.
+ // Each pair below must stay BIT-IDENTICAL to its primitive: the alias delegates, it does not
+ // re-derive the geometry.
+ const ALIASES: [string, string, string][] = [
+ ['⎿', '└', 'U+23BF → U+2514'],
+ ['⎾', '┌', 'U+23BE → U+250C'],
+ ['⎯', '─', 'U+23AF → U+2500'],
+ ['⏐', '│', 'U+23D0 → U+2502']
+ ]
+
+ it('each alias produces exactly its primitive at an INTEGRAL cell', () => {
+ for (const [alias, primitive, label] of ALIASES) {
+ expect(ops(alias), label).toEqual(ops(primitive))
+ }
+ })
+
+ it('each alias produces exactly its primitive at a FRACTIONAL cell', () => {
+ // A fractional cell is where an alias that re-derived its own geometry would drift: `span`/
+ // `snap` treat the boundary and the interior differently, so any second copy of the arm code
+ // would have to reproduce that exactly.
+ for (const [alias, primitive, label] of ALIASES) {
+ expect(ops(alias, 10.5, 20.5), label).toEqual(ops(primitive, 10.5, 20.5))
+ }
+ })
+
+ it('⎿ reaches BOTH its edges — the foot the clip used to eat', () => {
+ const list = ops('⎿')
+ expect(list).toHaveLength(2)
+ const horizontal = list.find((o) => o.w > o.h)!
+ const vertical = list.find((o) => o.h > o.w)!
+ expect(horizontal.x + horizontal.w).toBe(W) // full-width foot, edge to edge
+ expect(vertical.y).toBe(0)
+ })
+
+ it('U+23B8 ⎸ and U+23B9 ⎹ are NOT aliases — they stay on the font', () => {
+ // Deliberate: these sit flush on the cell's left/right EDGE, not centred like │, so they are new
+ // geometry rather than a rename of something in the table.
+ expect(boxGlyphOps(0x23b8, W, H)).toBeNull()
+ expect(boxGlyphOps(0x23b9, W, H)).toBeNull()
+ })
+
+ it('a neighbour outside the map still falls through to the font', () => {
+ expect(boxGlyphOps(0x23fa, W, H)).toBeNull() // ⏺ — Claude Code's bullet, not line art
+ expect(boxGlyphOps(0x23ba, W, H)).toBeNull() // ⎺ horizontal scan line 1
+ })
+
+ it('the map changes nothing in the ranges it sits outside', () => {
+ // The alias gate runs BEFORE the two range gates, so a bug there could shadow a real code
+ // point. Sweep both ranges and the immediate neighbourhood of the aliases.
+ for (let c = 0x2500; c <= 0x259f; c++) {
+ if (c >= 0x2571 && c <= 0x2573) continue
+ expect(boxGlyphOps(c, W, H), c.toString(16)).not.toBeNull()
+ }
+ for (let c = 0x2300; c <= 0x23ff; c++) {
+ if (c === 0x23af || c === 0x23be || c === 0x23bf || c === 0x23d0) continue
+ expect(boxGlyphOps(c, W, H), c.toString(16)).toBeNull()
+ }
+ })
+
+ it('a degenerate cell still declines an alias instead of emitting NaN rects', () => {
+ expect(boxGlyphOps(0x23bf, 0, H)).toBeNull()
+ expect(boxGlyphOps(0x23bf, W, Number.NaN)).toBeNull()
+ })
+})
+
describe('block elements', () => {
it('▀ is EXACTLY the top half of the cell', () => {
const list = ops('▀')
diff --git a/src/renderer/glyphgrid/box-glyphs.ts b/src/renderer/glyphgrid/box-glyphs.ts
index 4178e26f1..9c379fb70 100644
--- a/src/renderer/glyphgrid/box-glyphs.ts
+++ b/src/renderer/glyphgrid/box-glyphs.ts
@@ -206,6 +206,42 @@ const SHADES: Readonly<Record<number, readonly (readonly number[])[]>> = {
]
}
+// ---------------------------------------------------------------------------------------------
+// Miscellaneous Technical — the line-art aliases
+// ---------------------------------------------------------------------------------------------
+
+/**
+ * Code points OUTSIDE U+2500–U+259F that are the SAME SHAPE as something already in the arm table,
+ * mapped onto their primitive. The map is consulted first in `boxGlyphOps`, so these are drawn by
+ * the geometry above rather than by the font — one copy of the geometry, reached by two names.
+ *
+ * WHY these are here and not left to `fillText` (device round, 2026-08-04). U+23BF ⎿ is Claude
+ * Code's tool-result connector, and in shared mode its horizontal foot rendered as a stub: measured
+ * off the two screenshots at the same content and zoom, GPU per terminal drew the foot from x 48 to
+ * 75 (28 px, about one cell) while shared drew x 51 to 58 (8 px). The foot was not missing, it was
+ * TRUNCATED — the face (or Chromium's fallback for it) draws this glyph's ink wider than the
+ * terminal cell, and `raster.ts` clips every font-drawn glyph to the cell so the overflow is
+ * discarded. xterm's own `TextureAtlas` never meets this: it measures each glyph's real bounding
+ * box and stores/renders it at true size, letting ink overflow into the neighbouring cells, which
+ * is why GPU mode shows the whole foot.
+ *
+ * So this is the same argument the module header makes for U+2500–U+259F, arriving from the other
+ * side: line art that a font draws at whatever size it likes does not survive a per-cell atlas.
+ * DRAWING it removes the dependency entirely — a `└` we generate is full-cell by construction. Do
+ * not "simplify" the map away on the grounds that the font can draw these characters; it can, and
+ * the cell is what cannot hold the result.
+ *
+ * DELIBERATELY NOT HERE: U+23B8 ⎸ and U+23B9 ⎹ (LEFT/RIGHT VERTICAL BOX LINE). They were considered
+ * and rejected — they sit flush on the cell's left/right EDGE, whereas U+2502 │ is CENTRED, so they
+ * are NEW geometry rather than a second name for a shape in the table. They keep using the font.
+ */
+const ALIASES: Readonly<Record<number, number>> = {
+ 0x23bf: 0x2514, // ⎿ DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM RIGHT → └ (up + right)
+ 0x23be: 0x250c, // ⎾ DENTISTRY SYMBOL LIGHT VERTICAL AND TOP RIGHT → ┌ (down + right)
+ 0x23af: 0x2500, // ⎯ HORIZONTAL LINE EXTENSION → ─
+ 0x23d0: 0x2502 // ⏐ VERTICAL LINE EXTENSION → │
+}
+
// ---------------------------------------------------------------------------------------------
// Geometry
// ---------------------------------------------------------------------------------------------
@@ -215,11 +251,15 @@ const SHADES: Readonly<Record<number, readonly (readonly number[])[]>> = {
* nothing to say about it — the caller then draws the glyph with the font, exactly as before.
*
* `null` is the important half of the contract: it is what keeps this module OPT-IN per code
- * point. Everything outside U+2500–U+259F, the diagonals, and any cell size that is not a
- * positive number falls through to `fillText`.
+ * point. Everything outside U+2500–U+259F and the four `ALIASES`, the diagonals, and any cell size
+ * that is not a positive number falls through to `fillText`.
*/
export function boxGlyphOps(code: number, cellW: number, cellH: number): PaintOp[] | null {
if (!Number.isFinite(cellW) || !Number.isFinite(cellH) || cellW <= 0 || cellH <= 0) return null
+ // The aliases resolve to a code point in the box-drawing range and then take the ORDINARY path,
+ // so an alias is bit-identical to its primitive at every cell size by construction.
+ const alias = ALIASES[code]
+ if (alias !== undefined) return boxOps(alias, cellW, cellH)
if (code >= 0x2580 && code <= 0x259f) return blockOps(code, cellW, cellH)
if (code >= 0x2500 && code <= 0x257f) return boxOps(code, cellW, cellH)
return null
diff --git a/src/renderer/glyphgrid/raster.ts b/src/renderer/glyphgrid/raster.ts
index b2fe0b963..fd8879d7b 100644
--- a/src/renderer/glyphgrid/raster.ts
+++ b/src/renderer/glyphgrid/raster.ts
@@ -185,6 +185,26 @@ function baselineIn(ctx: OffscreenCanvasRenderingContext2D, font: RasterFont): n
* The separation is unchanged either way: the pitch IS the whole-texel box plus two gutters, so
* the widened clip stops exactly where the gutter starts.
*
+ * THE GENERAL CLASS THIS CUT BELONGS TO — name it, because it keeps arriving one glyph at a
+ * time. A font-drawn glyph whose INK EXCEEDS ITS CELL is clipped here and the overflow is simply
+ * lost. xterm's own `TextureAtlas` has no such limit: it MEASURES each glyph's real bounding
+ * box, sizes the atlas slot to the ink, and renders a quad of that size — so ink may overhang
+ * into the neighbouring cells, which is why GPU mode shows shapes this path truncates. The
+ * 2026-08-04 device round measured one: U+23BF ⎿, Claude Code's tool-result connector, kept
+ * about a third of its horizontal foot (8 px against GPU mode's 28).
+ *
+ * THE ESCAPE HATCH USED SO FAR is `box-glyphs.ts`: a glyph we DRAW is full-cell by construction,
+ * so the clip has nothing to cut. That covers line art — the box-drawing and block ranges, plus
+ * the handful of Misc-Technical aliases the ⎿ finding added — and it is the right answer for
+ * that class, since those characters are DEFINED as fractions of the cell.
+ *
+ * THE REAL ESCALATION, if a NON-line-art glyph ever needs the overflow (an ornate script face, a
+ * symbol font with genuine side bearings), is to do what xterm does: measure a per-glyph
+ * bounding box, allocate slots sized to the INK rather than to the cell, and emit quads sized to
+ * the glyph rather than to the cell. That reaches into the atlas allocator, the slot-rect
+ * derivation and the shader's uv maths all at once, and it changes what the LOD/gutter argument
+ * is defending. Phase 2 — do NOT build it now.
+ *
* What the gutter then HOLDS is a separate question, and the answer changed in the 2026-08-04
* device round: it carries this slot's OWN EDGE-EXTENDED CONTENT — background wherever the ink
* does not reach the cell edge (all ordinary text, i.e. bit-identical to the old flat bg fill),