mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-09-14 13:41:32 +08:00
d69a59ea9d
* feat: add @json-render/ink terminal renderer and ink-chat example Adds a new `@json-render/ink` package that brings json-render specs to terminal UIs via Ink (React for CLIs). Includes 24 standard components (layout, text, inputs, markdown, etc.), context providers for state, validation, visibility, actions, focus, and repeat scopes, plus a streaming JSONL hook for progressive spec rendering. Also adds an `ink-chat` example app demonstrating an AI chat interface in the terminal with streaming responses, tool calls, and interactive wizard flows. Includes 76 tests (24 unit + 52 e2e), docs page, and web app integration. * feat: show live spec preview during streaming Render the spec progressively as JSONL patches arrive instead of only showing a spinner. The preview disappears when streaming completes and the finalized message replaces it in history. * feat: clip streaming preview to 6 lines * refactor: move spinner into input box, show full streaming preview * fix: skip spacer during streaming to prevent clipping tall previews * fix: strip invisible colors on dark terminal backgrounds Drop foreground colors like "black" and "#000000" from AI-generated specs so text remains readable on dark terminals. Removed hardcoded color="black" from Badge and added safeColor() guard to all components that accept user-specified color props. * fix: always show spacer to keep input pinned to bottom * fix: show dash placeholder for empty values in Table and KeyValue Empty or null values in Table cells and KeyValue now render as "—" instead of blank space. Also removed dimColor from ListItem subtitle and trailing for better readability on dark terminals. * fix: division by zero in Sparkline sampling when maxWidth is 1 * fix: Review feedback Signed-off-by: Alexis Rico <sferadev@gmail.com> * fix: Update readme Signed-off-by: Alexis Rico <sferadev@gmail.com> --------- Signed-off-by: Alexis Rico <sferadev@gmail.com>