Skip to content

Diagrams: fixes, checks and a paint benchmark (batch A) - #126

Merged
bmjcoding merged 7 commits into
mainfrom
claude/diagrams-fixes
Nov 23, 2026
Merged

bmjcoding merged 7 commits into
mainfrom
claude/diagrams-fixes

Conversation

@bmjcoding

@bmjcoding bmjcoding commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Batch A of the diagram backlog (DECISIONS 301). These are engineering changes inside decided designs, built by Opus.

What changed

  • Motion checks not yet written (2aa2cca3):

    • the send queue;
    • the flow cut's clearance and the under-48px rule;
    • the data flow, flowchart and schema totals;
    • more contrast under a theme chosen with the toggle;
    • the fit rule counting a mark's padding;
    • React and the skill drawing the same pixels at rest, for the five examples and the kit, in both themes;
    • a failed motion-module load: the figure settles with its lines whole.

    A flaky test that also fails on main ("mid-entrance, narrowed…") is fixed.

  • Leftovers from Diagrams: architecture, flowchart, data flow, sequence and schema (DECISIONS 281, 282) #122 (8369de9d):

    • one-column schemas with a foreign key now draw, keeping space-5 padding on the end side;
    • assignSlots no longer double-assigns a slot;
    • development checks and their wording are gone from production builds, about 3.2 KB less per diagram;
    • labels snap to whole pixels.
  • Decision diamonds no taller than wide (8369de9d): where the 62% wrap would make one taller, the words' box widens first. The 5:1 floor stays.

  • A paint benchmark (bda448e1): packages/react/test/diagram-paint-bench.mjs. First numbers:

    • six animated figures in view: p95 frame 16.8ms, none over 20ms;
    • still figures paint nothing.

Sizes

  • Each diagram is 4.6% smaller (ArchitectureDiagram 70,763 → 67,536), and the whole package up front is 0.4% smaller.
  • The skill's diagram module grows to 92,386 bytes, so its budget goes from 91,250 to 92,400. It carries the fixes and keeps the development checks, which compose reports.

Tests (each file run alone)

File Result
React diagram-fixes.test.mjs (new) 7/7
React diagrams.test.mjs 45/45
React diagram-motion.test.mjs 72/72
React bundle.test.mjs 103/103
Skill diagrams.test.mjs 15/15
Skill diagram-motion.test.mjs 14/14
compose.test.mjs 112/112
html-skill.test.mjs 288/288

Lint, both typechecks, the build and sizes pass. npm run check and ci:local were not run.

Open: with the decider, Fable

The builder chose these where the decision is silent:

  1. The diamond ceiling can't be met at figure widths 972–975. There, "Risk medium or lower?" stays about 195 × 210.
  2. Space-5 padding for the one-column schema. Space-4 fails by 0.5px.
  3. How lines share a side beside a straight one.

Neon's review: 7/10, with 2 blocking findings, both fixed in 0d9017c7:

  • Two turn-backs could lie on one lane. Turn-backs now share a gutter's lanes, and a drawing refuses lines lying on one another unless they end on the same point. The shared geometry check now catches this everywhere.
  • A failed motion load on a hidden figure left its lines pending. The figure now settles them when it's shown.

The polish is also fixed:

  • three development checks moved behind dev;
  • the paint benchmark's counting;
  • the parity test cut from about 61s to 3.5s per theme.

The fixes weren't re-reviewed by a seat. Fable has since ruled on the three open calls (DECISIONS 306). The diamond ceiling becomes a fit failure. The space-5 padding stands, stated as a rule. The slot sharing stands, with two fit conditions. The two changes are built with batch B.

Gate on the combined tree: main (d1217fb3, with #125's 104 marks) was merged in at 3cbc662c. There were no conflicts, and no committed file or size changed. Each file run by name:

File Result
React diagram-fixes 7/7
React diagrams 46/46
React diagram-motion 72/72
React bundle 103/103
Skill diagrams 15/15
Skill diagram-motion 14/14
Skill compose 113/113
Skill html-skill 288/288

🤖 Generated with Claude Code

bmjcoding and others added 7 commits November 23, 2026 11:32
- Slots on a side (Neon 13): beside a straight line, two or more lines toward
  one end share that half of the side evenly, nested; one alone keeps the
  decided quarter point. Two lines no longer leave one point.
- Development checks (Neon 14): every check and warning in diagram-core is
  written behind process.env.NODE_ENV, declared first in its function so a
  minifier folds it, and motionErrors returns nothing in production. An app's
  production build drops them and their words; the HTML skill bundles the
  engine as a development build, so compose.mjs still reports them.
- A one-column schema with a foreign key (Neon 12) is drawn: its turn-back
  takes the end side and the drawing keeps space-5 there; the fit rule counts
  it. The old test that pinned it stacked now uses a turn-back named off a
  first column, which is still refused.
- Labels on whole pixels (Fable P3): a seated label's box moves to the nearest
  whole page pixel that passes the same seat test; the seat is still chosen
  against the line's own centre.
- A decision no taller than it is wide (Fable P4): where 62% makes the diamond
  taller than wide, the words' box widens to the narrowest width that fits it
  under that ceiling (--_ww); where none does, 62% stays.

Tests: packages/react/test/diagram-fixes.test.mjs (new) and diagrams.test.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neon's item 7 from round 65's code review, as listed in #124:
- the packet's sends: with one in flight, one waits and a second is dropped,
  in React and through Basalt.diagram in the skill;
- a flow line's cuts stop space-1 short of its head, and a line with under
  48px showing has none;
- the data flow's, the flowchart's and the schema's entrance totals are 1.3's;
- more contrast under a theme chosen with the toggle, the system the other way;
- the fit rule counts a mark's padding (space-6 a column);
- React and the skill draw the same pixels for the five animated examples and
  the kit at rest, in both themes (the React page shares the skill core's text
  rendering and language);
- the motion code failing to load (an app's split build whose motion chunk is
  refused): the figure settles, lines whole, no control, no error.

Also fixes a flake in "mid-entrance, narrowed to a layout with no lines" (it
failed on main too): a participant's border transition when its head becomes
a chip was sampled inside its 100ms; the test now lets it end first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
packages/react/test/diagram-paint-bench.mjs: the five CIMIP examples animated
and the marks kit on one React page (production build), every entrance ended,
then 10s of frame times (requestAnimationFrame) and Chromium's timeline counts
(paints, layouts, style recalcs, raster tasks, layer updates), against the
same page still. Every figure in view by default; --height 900 for a laptop's
window. Reports only; not a gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The five diagrams drop 3,227 bytes each (70,763 to 67,536 for
ArchitectureDiagram): the development checks no longer ship in a production
build. The whole package up front drops 0.4%. The skill's diagram module rises
from 91,250 to 92,400 (92,386 measured): it bundles the engine as a
development build, so it keeps the checks, and it carries the four fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…load (Neon on #126)

- Blocking 1: two turn-backs to different keys were drawn on one lane. In a
  gutter, turn-backs beside each other now take its lanes as jogs do (a
  turn-back alone keeps its place); with no gutter (a one-column schema) the
  drawn layout refuses lines laid on one another that are not a bus, and the
  figure stays stacked. The geometry check (diagram-geometry.mjs) now reports
  any such pair in every test that uses it.
- Blocking 2: when the motion code failed to load while the figure was hidden,
  the lines it drew once shown stayed pending. The failure is kept, and lines
  drawn later are settled in the frame they are drawn. The load-failure test
  covers a hidden figure shown afterwards.
- Polish: the three checks left running in a production buildModel (the type
  list, a twice-used id, a sequence's participants) are behind `dev`.
- Sizes: the five diagrams +44 bytes; the skill's diagram module budget
  92,400 to 92,650 (92,603 measured).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er parity test

- diagram-paint-bench.mjs: the window is its final height from the first frame;
  it waits for every figure in view to settle; it reports the figures moving
  (pulses and packets are finite legs, so endless animations undercounted), and
  layer updates (complete events only) apart from pre-paints, which every drawn
  frame has, the benchmark's own included.
- The React and skill parity test bundles React's page once per theme and
  compares the screenshots' files, decoding only on a difference: 61s a theme
  down to 3.5s, so more marks cannot push it past the 120s limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bmjcoding
bmjcoding marked this pull request as ready for review November 23, 2026 18:58
@bmjcoding
bmjcoding merged commit 7db2064 into main Nov 23, 2026
0 of 2 checks passed
@bmjcoding
bmjcoding deleted the claude/diagrams-fixes branch November 23, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant