From 9b7e9dfb26b79d2c24ad182911797b7c446aa7a6 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Mon, 8 Jun 2026 22:42:59 +0800 Subject: [PATCH] docs(divergences): correct display={undefined} note (Codex review) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An explicit `display={undefined}` is applied as DISPLAY_NONE and hides on mount (verified against real Ink v7.0.4) — only an omitted `display` stays visible. The previous parenthetical conflated the two. Co-Authored-By: Claude Opus 4.8 (1M context) --- .agents/docs/ink-divergences.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.agents/docs/ink-divergences.md b/.agents/docs/ink-divergences.md index 70ca89f..e3c4e57 100644 --- a/.agents/docs/ink-divergences.md +++ b/.agents/docs/ink-divergences.md @@ -250,10 +250,11 @@ current-props model, or API conventions. prop diff carries a `display` that is not `'flex'`, and Ink's reconciler diff emits a withdrawn key as `display: undefined`. So clearing a previously-set `display` (`'none'` or `'flex'` → removed) **hides** the box: Ink treats the withdrawn prop as `none`, neither - keeping the prior value nor restoring the default. (`display={undefined}` on a box that - never set `display` is a no-op and stays visible — the diff registers no change.) In the - common toggle `display={hidden ? 'none' : undefined}`, Ink stays hidden on the `undefined` - branch; you must set `display="flex"` to show it again. + keeping the prior value nor restoring the default. (A box that simply **omits** `display` + stays visible — `'display' in style` is false, so no `setDisplay` runs; but an explicit + `display={undefined}` is itself applied as `DISPLAY_NONE` and hides, like any non-`'flex'` + value.) In the common toggle `display={hidden ? 'none' : undefined}`, Ink stays hidden on + the `undefined` branch; you must set `display="flex"` to show it again. - **vue-tui:** a removed/undefined `display` resets to the Box default `DISPLAY_FLEX` (visible): the same state as if the prop had never been set. - **Why:** render = f(current props): no `display` set means the default (visible).