mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 05:30:16 +01:00
"Who produces gallium?" now carries a ranked bar chart, not a list. chatkit
stays dependency-free: it defines the data contract (`ChartBlock`, mirroring
@bitbaum/chartkit's props for line, bars, share, timeline, tiles) and a
renderer slot (`renderers={{ chart }}` on ChatScreen, ChatThread, ChatMessage,
Markdown and RichAnswerBlock); the app injects the drawing.
- Parser: each kind validated field by field (bounded lists, finite numbers,
safe links). A malformed block is rejected by the parser and degrades to
its caption and a table of the safe rows; without a renderer, or when one
returns null, chatkit draws that table itself. A chart is never a blank.
- Instruction: when to draw (ranked 3+ rows -> bars, shares -> share, 3+
points over time -> line, 3+ dated events -> timeline, 2-4 figures ->
tiles), figures only from tool results, hrefs copied from the result.
- Copy and Listen read the figures as lines, never the wire JSON.
- Tests: node tests per kind, the fallback and the renderer paths; the
browser test renders a bars block through a stub renderer and a line block
through the fallback in demo/screen.html at 320/390/1280, with the
broken-word scan and no horizontal overflow.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 line
649 B
Plaintext
1 line
649 B
Plaintext
{"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/react/Screen.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE1E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAe,EACf,SAAS,EACT,SAAS,GACV,EAAE;IACD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kEAAkE;IAClE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAmDA"} |