fix(runtime): off-spec display value hides, aligning Ink (drop A21 divergence) (#128)

Ink's applyDisplayStyles hides any present `display` that isn't 'flex'
(DISPLAY_NONE); vue-tui hid only on exact 'none', leaving off-spec values
(reachable via TS-bypass — the prop type is 'flex'|'none') visible. Align: the
yoga display setter now hides any present (non-null) value except 'flex',
matching Ink even for non-string junk (display={5}). The blessed A19 divergence
is preserved — a removed/undefined display (null) still resets to the visible
default (Vue can't distinguish display={undefined} from an omitted prop).

Removes the now-obsolete A21 entry from .agents/docs/ink-divergences.md (the
A19 "removed display resets to visible" entry remains).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yunfei He
2026-06-03 02:19:48 +08:00
committed by GitHub
parent 1bad1014da
commit d7c62f9b3a
3 changed files with 55 additions and 12 deletions
-11
View File
@@ -302,17 +302,6 @@ unsubscribe(){}}`) — a `useAnimation` rendered outside an Ink tree never ticks
diverge from Ink in the _opposite_ (unrelated-sibling) direction, where Ink drops the cursor.
Keep the reactivity-tied behavior. Maintainer decision (2026-06-01): KEEP.
### An off-spec `display` value stays visible instead of hiding
- **Ink:** `applyDisplayStyles` sets `DISPLAY_NONE` for **any** present `display` that isn't
`'flex'` — so a typo or off-spec value (`display="block"`, `display=""`, reachable via a
TS-bypass) **hides** the box.
- **vue-tui:** `toDisplay` hides only on the exact value `'none'`; every other value (including
off-spec) falls back to the visible default `DISPLAY_FLEX`.
- **Why:** an unknown/typo `display` shouldn't silently delete content — failing visible is the
safer default. It's also consistent with the removal-reset above: a withdrawn `display` returns
to visible, and so does an unrecognized one. (The only honored hide is the documented `'none'`.)
### Out-of-type style values are forwarded, not defensively coerced
- **Ink:** several flex/align setters coerce a runtime junk value to a default — `flexShrink`