test(runtime): full wrap-mode transition matrix; vouch the wrap re-measure divergence (#200)

Encode the declarative invariant for the runtime `wrap` re-measure fix
(PR #193) as a full matrix: for all 6 wrap modes and all 30 ordered
transitions, toggling `wrap` at runtime produces the exact same frame as
a fresh mount with that wrap (measure == paint). Ground-truth fresh-mount
frames are derived at runtime, not hardcoded. Reverting the one-line fix
in node-ops.ts turns 16 of the 30 transitions red, so the matrix
genuinely guards the fix.

Vouch the divergence: add [VOUCHED @hyf0] to the ink-divergences.md entry
and reword it to lead with correctness (Ink v7.0.4 has the latent stale
measure bug; vue-tui keeps the correct invariant). Drop "pending a human
vouch" from the node-ops comment.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yunfei He
2026-06-15 11:39:40 +08:00
committed by GitHub
parent 0ba8a5ff0e
commit 33cc9c3dcd
3 changed files with 136 additions and 9 deletions
+1 -1
View File
@@ -491,7 +491,7 @@ export function buildNodeOps(options: TtyRendererOptions): RendererOptions<TuiNo
// measured dimensions, so `wrap` is the sole case. NOTE: this also fixes a
// latent bug present in Ink v7.0.4 itself — Ink's applyStyles ignores
// textWrap and never markDirty()s, so a wrap-only change goes stale there too
// (a deliberate divergence pending a human vouch; see ink-divergences.md).
// (a deliberate, vouched divergence; see ink-divergences.md).
if (key === "wrap" && el.type === "tui-text") {
markTextDirty(el);
}