Linora

0106. NodeColumns paint views follow intern-table growth

Status: Accepted (2026-11-30). Amends 0102 (interned paint) and the NodeColumns contract of 0024.

Context

Fill, stroke style and corner radius are interned (ADR 0024): each node stores a small index, and doc.cols exposes the tables as fillTable, strokeColor, strokeWidth and radiusTable. Three readers use them:

The tables are InternTables that start at 16 entries and reallocate their arrays as they grow (x1.5). doc.cols took its views in refreshCols(), which ran only when the node columns were allocated or grown. A table that grew afterwards left cols pointing at the old array. Every index past the old capacity then read 0, which is a transparent fill and no stroke. Freed and reused slots kept the old values, so some nodes showed another node’s stroke.

Decision

InternTable gets an onGrow hook, called after its arrays are replaced. Doc sets it on fills, strokes and radii to refreshPaint(), which re-points the four views; refreshCols() calls it too. So doc.cols always holds the tables’ current arrays. Readers keep reading cols.fillTable[...] and must not cache those arrays across edits, which is the rule they already follow for every other column.

Alternatives

Consequences