Files
CatoandClaude Fable 5.1 b37c3d65ce feat(rich): chart blocks in answers, drawn by an injected renderer (0.15) (#28)
"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>
2026-10-23 11:09:15 +02:00

1 line
1.9 KiB
Plaintext

{"version":3,"file":"rich.d.ts","sourceRoot":"","sources":["../src/rich.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAExF,cAAc,YAAY,CAAC;AAE3B,qFAAqF;AACrF,MAAM,MAAM,SAAS;AACnB,oEAAoE;AAClE,UAAU,GACV;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;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