Repository navigation
Conversation
… baseline Declares `tufteCharts` (label "Tufte charts", on by default) next to `animations` and reads it in the page the same way: `useSettings`, with the off state kept in localStorage so a fresh page draws in the chosen style before BB answers. Nothing reads it yet. Chart.test.tsx draws each chart gallery example, plus shapes the gallery lacks, with the setting off and compares the markup with files written by the renderer as it is now. Later commits must leave them unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Tufte charts setting on, line, area and bar charts drop their dashed gridlines. The y axis becomes a range frame: a line from the ink's low to its high, ticked and labeled at both ends and at up to two round values between. Lines span their data; bars and areas stand on zero, so their frame reaches it. A faint line stays at zero when zero is in range. Numbers, dates and times along the bottom get the same treatment; categories keep every label that fits. The tick math (rangeTicks, frameLabelIndices) is pure and tested in chartMath.ts; the frame's drawing lives in tufte.tsx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…egend With the Tufte charts setting on, a line or area chart with two to six series drops its legend and writes each series' name at the end of its line (a stacked area at the middle of its band), in the series' color. Names of lines that end close together are pushed apart, as little as they need, by spreadLabels in chartMath.ts. The chart keeps the legend when there are more than six series, the names would take more than a third of the width, or the plot is too short to set them apart. Bar charts keep their legend. Also widens the least gap between range-frame labels to 22 px: at 14 px a round value next to an end (40 GB under 46 GB) read as clutter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Tufte charts setting on, Chart("pie", …) draws one horizontal
bar per slice, largest first, each named and labeled with its share and
value. Lengths along one baseline compare far better than angles, and
the labels make a legend and per-slice colors unnecessary, so every bar
is one muted ink. The slices are the donut's own (pieSlices): past
eight, the rest fold into "Other", which stays last and quieter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arts With the Tufte charts setting on, an untoned single-series line or area is drawn in the foreground ink and its latest point keeps the accent; single-series bars are one muted ink. Several series and toned series keep their colors: there color tells things apart or means something. A neutral sparkline is drawn in ink with its latest point in the accent, and every sparkline rings its lowest and highest points (left out when the latest point is the extreme, and for a flat line). It stays 80 by 20 pixels. Two follow-ups from the visual check: share bars say a value once when it is already a percentage (unit "%"), and leave room for both labels after the longest bar; a framed x axis names only labels that fit whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first line of the shape list in AGENT_INSTRUCTIONS now says many
series go in a Grid of small Charts, and shares go in a SegmentedBar or
a sorted bar, never a pie. The section was 10 characters under BB's
4,096-character cap, so the shape list drops its articles ("a level vs
a limit", "options vs criteria", "file tree", …) to make room; it is
now 4,093 characters (4,091 with web lookups off). skills/ui/SKILL.md
carries the same text.
Also documents the Tufte charts setting in docs/architecture.md and the
changelog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setting is about to cover tables, metrics, cards and meters and to
add guidance for agents, so `tufteCharts` ("Tufte charts") becomes
`tufteStyle` ("Tufte style"), with a description that says what it
changes in each. `useTufteCharts` becomes `useTufteStyle`, and the
localStorage key and the docs follow. No migration: the setting has not
shipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tufteStyle.test.tsx draws the gallery examples of Table, Metric, Card, Gauge, Progress, Badge, Callout, SegmentedBar, KeyValue, List, CalendarHeatmap, the heatmap Chart and Treemap with the Tufte style setting off, and compares the markup with files written by the renderers as they are now. Later commits must leave them unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fte style
With the Tufte style setting on, components shed ink that carries no
data. No component's parameters change.
- Table: columns of numbers written as text ("210 ms", "18.2k", "−31%")
are right-aligned in tabular figures like columns of numbers, and
rows are denser.
- Badge: no pill; a dot only where the tone means something, then the
word at the size of the text around it.
- Gauge: a bullet bar (a thin bar of ink over a faint band, the value and
the range's ends as text) instead of a half-disc dial. Progress draws
the same bar.
- Card: the title in plain type; a nested card is a hairline over the
tile instead of a filled box. The outer card keeps its hairline frame,
so a block still reads as one unit in the chat.
- Callout: no wash and no icon, which only repeated the tone; a rule in
the tone's color carries it.
- SegmentedBar: untoned parts in shades of one hue instead of a hue each,
and no track behind the parts. Toned parts keep their tones.
- List: icons without a tile, and none when every row has the same one.
- Treemap: every group in one hue. Success and warning hues meant
"another folder" there, and good and bad everywhere else.
Left alone: Metric and KeyValue (already label, value and note without
boxes or fills), CalendarHeatmap and the heatmap Chart (already one
hue from the theme, light to full).
tufteStyle.test.tsx holds the setting-off markup of every touched
component's gallery examples (and the Sparkline table, whose number
column now aligns) against the baselines, and checks what each
component sheds with the setting on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Tufte style setting on, sessions that get the UI instructions also get "Inline UI: Tufte style" (1,025 characters), contributed after the code-work section and so right before the Inline UI rules it refines. It asks for numbers in context (a comparison in the Metric's note or a Sparkline), labels on the graphic instead of a key, small multiples instead of one crowded Chart, a lone number in the sentence instead of a Metric, ink only for data, a source for every Chart, Table and Metric, and a Diagram for why. Rules it would contradict or repeat are swapped while it is on, following the web-lookups variant: "In doubt, add the block." becomes "In doubt, add one block.", "Wrap each block in one Card." gains "titled with its finding", and the shape list drops the small-multiples clause the section says in full. Every variant (Tufte style and web lookups, on and off) stays under the 4,096-character cap. With automatic instructions off, the /ui skill carries the section behind a check of the setting, with the swaps spelled out. Tests cover the eight combinations of automaticInstructions, tufteStyle and webLookups, a live toggle, the swaps and the skill's sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The changelog and docs/architecture.md now cover what Tufte style does beyond charts and the guidance it adds for agents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Tufte style setting (
tufteStyle, on by default) to genui. When it's on, charts and other data components follow Tufte's data-ink rules, and agents get a short section on how to show data. When it's off, every component renders byte for byte whatfeat/genuirenders today, and agents get no style guidance. That keeps the change ready to offer upstream as an opt-in. This PR builds on #466, which adds the genui plugin.Charts
SeriesLegend. Bar charts keep their legend.Other components (no parameter or API changes)
Agent guidance
With the setting on, sessions that get the UI instructions also get "Inline UI: Tufte style" (1,025 characters), contributed after the code-work section:
The section would otherwise conflict with or repeat some lines in
AGENT_INSTRUCTIONS. While the setting is on, those lines are swapped, the same wayAGENT_INSTRUCTIONS_WEB_OFFswaps the Map example (TUFTE_SWAPS):All four rule variants (Tufte style on or off × web lookups on or off) fit under the 4,096-character cap: 4,093, 4,091, 4,089 and 4,087 characters. With Automatic UI instructions off, the
/uiskill can't read the setting, so it carries the section behind a check ofbb plugin config genui, with the two behavioural swaps spelled out.The shape list in
AGENT_INSTRUCTIONS(both variants) also steers shares to SegmentedBar or a sorted bar instead of a pie. To fit that clause, the list drops some articles.How it's built
server.tsdeclaresSTYLE_SETTINGSnext toMOTION_SETTINGS. The page reads it the same waymotion.tsreadsanimations, keeping the off state inlocalStorage. The server reads it to choose the instructions.ui/components/tufte.tsxholds the hook and the shared Tufte pieces: range frames, direct labels, share bars,BulletBar,numberLikeandoneHueShade. Each component callsuseTufteStyle()and branches only where the two styles differ, so no component is forked.chartMath.tsholds the pure frame and label math:rangeTicks,frameLabelIndicesandspreadLabels.Toggle
Visual changes apply live. Guidance changes reach new sessions.
Things to check
Charthas no y-range parameter, so the charts in a Grid scale independently. The guidance says "small Charts" and doesn't promise a shared scale.Tests
Chart.test.tsxandtufteStyle.test.tsxrender the gallery examples of every chart and component this PR touches, plus extra chart shapes, with the setting off. They compare the markup to baseline files written by the renderers before each layer changed them. Other cases in the same files check what each component drops with the setting on.chartMath.test.tscovers the frame and label math.instructions.test.tscovers the cap for every variant, the 2,000-character section budget, the swaps and the skill sync.server.test.tscovers all eight combinations ofautomaticInstructions,tufteStyleandwebLookups, plus a live toggle.npm run typecheck: cleannpm test: 101 files, 1,221 tests passedbb plugin build: succeeds🤖 Generated with Claude Code