Skip to content

LH-144, LH-149, LH-150, LH-151: shared page sizes, half steps of the type scale, whole ratios, drawn metric color in validate - #1016

Closed
michaeljgrimm wants to merge 2 commits into
mainfrom
codex/lh-149-sizing-fixes
Closed

michaeljgrimm wants to merge 2 commits into
mainfrom
codex/lh-149-sizing-fixes

Conversation

@michaeljgrimm

@michaeljgrimm michaeljgrimm commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Four sizing fixes of the layout harvest (docs/programs/layout-harvest/), from PR #767's slide-design audit (mapping in C:/opf-work/pr767/mapping.md, rows N3, N4, N5) and #1009. Status for the catalog (burndown.md not edited, as the wave rules ask): LH-149 done (FAQ), partial for the dense comparison (see below); LH-144 done; LH-150 done; LH-151 done.

LH-149: half steps of the type scale for fitted body text

Rule (one rule, documented in docs/layout-templates.md and at scaleStep in composition.ts): fitted body text takes LH-17's steps and the half step between each two (the floor times (28/16)^(k/8), rounded to whole reference px): 16, 17, 18, 20, 21, 23, 24, 26, 28, 30, 32 px at the default floor. LH-17's scale stays the backbone (every old step is still a step; sizes stay few and are shared by siblings); a set of siblings sized jointly now loses at most half a step of what it fits, not a whole one.

  • It is a guarded rule, half-steps, first in GUARDED_RULES (so in CORE_RULES), fired when a fit or a joint trial (stack, grid rows, paragraph columns, long-text rows, parallel regions with the block below, the LH-17 snap in sharePeerSizes) settles on a half step. Reason: a joint trial at a half step gives the rows other heights than the full step under it, and on b03 s39 and the hero slides an unguarded version set some blocks smaller (28 to 26, 18 to 17). Guarded, no block is smaller anywhere (sweep below).
  • Half steps never change which arrangement wins (review fix). A paragraph or list that shrank onto a half step is marked (HALF_STEPPED) and counted at the LH-17 step under it in every comparison of arrangements: trackQuality (so the guard's rule sets, LH-07's step badges, LH-80/LH-49 tracks, LH-48 growth) and LH-83's recompose-at-floor (wholeStepSmallest, and bodyReadability's at-floor test). A gain of half a step alone (16 to 17 px) keeps the slide's arrangement: agenda 3 and 4 long keep their template and step badges (identical to main), and the hero slides b10 s49 and b14 s02 keep their recomposition at 18 px. A paginated page with maxFontSize decides its step badges on the slide without the cap, as its first page did.
  • Arrangements: compared with main, 0 of the 976 sweep slides and 0 of the 468 template-golden slides (templates, features, paginated pages) change arrangement (regions, recomposition, tracks, step badges, list columns, cards, metric and timeline arrangements); only sizes and row heights move.
  • FAQ six pairs (PR767 P07/P27): 21 to 23 px with the office font pack and with estimates (candidates/faq/short-6-before).
  • Dense comparison options (P06): unchanged, 18 px options and 28 px verdict. With the office fonts the options fit 20 to 21 px only if the verdict under them drops from 28 to 21 px (the second option needs 415 px at 20 px, the row has 404 and the verdict's row 41 at 28 px). An unguarded build did exactly that (options 20, verdict 21), which the size guard forbids, so the guard keeps main's layout. Reaching 20 px there needs the verdict to give height (a decision between the verdict's size and the options'); not done here.

LH-144: the pages of one paginated slide share their type sizes

  • New composition.maxFontSize (reference px, 8 to 200, inherited by groups like minFontSize; schema, docs/schema-reference.md, docs/dynamic-composition.md, the layout skill's geometry reference). Paragraphs, lists, quotes, metrics and timelines are never set larger: no block grows past it (LH-48's fillLone, LH-41/LH-129's timeline growth), and a block composed larger is laid out again in its own box at the cap (capSizes after sharePeerSizes; a timeline by offsetting every role until its largest label fits; a list in columns keeps the columns its role size chose and is set at the cap). Never under minFontSize. Headings, tables, code and charts keep their sizes.
  • paginate (and so the export's continueOverfull, LH-90) writes it on every page after the first: the largest size the first page draws for the kinds of block that page holds. Breaks are chosen as before (a cap only lowers sizes, so a page that fits fits with it). One number per page, so a kind the first page does not have is capped with the others (documented).
  • Paginated goldens: process 6 long page 5 34 to 24 px (page 1: 24), agenda 5 long page 3 30 to 24, list 5 long page 3 30 to 24, agenda-split 5 long page 4 32 to 24, table 6 long page 5's lone note 42 to 28 (page 1: 28). No other page changes size from the cap.

LH-150: a ratio never breaks at its slash

  • line-break.ts: a figure, a spaced slash and a figure ("4.6 / 5", "$2 / $3", the division and fraction slashes) is one token for the breaker, bindNoBreak writes both spaces as U+00A0 for PowerPoint (table cells and native text) and unbindNoBreak gives them back; an unspaced ratio ("3/4") is not cut beside its slash inside an over-long word. "Q1 / Q2", "and/or" are untouched.
  • LH-39/LH-127: a metric value the no-break rules bind into one word ("4.6 / 5", "26 %") is a figure (oneFigure), in the metric layout and in readsAsWellFigure's split count.
  • PR767 columns/homogeneous-table-3col: "4.6 / 5" now draws on one line (was "4.6 /" over "5"). The fixture in table-content-widths.test.mjs takes 24 px instead of 25 to keep the ratio whole (the next size down for a split figure, as the wave 6 size guard allows); updated.

LH-151: text-contrast judges a metric value in the drawn color

rules-accessibility.ts calls core's metricValueColor (the function the preview's renderMetric and the PPTX addMetricPayload call) with the primary, the card fill (neutrals.card) or slide/emphasis background, and the text color, for the value and an inline unit. The audit's homogeneous-metric-2col, homogeneous-metric-3col, mixed-quote-metric-text and both scorecard decks no longer report "#2874A6 on #172C52, 2.73:1"; a pale accent on a light slide still warns (test).

Evidence

Sheet: C:/opf-work/harvest/wave6/lh-149/sheet.png (before = main, after = this branch, Claude Design where it exists; for the LH-144 rows the third column is the slide's first page). Rows: agenda 3 and 4 long (review fix, identical to main); narrative n14, n23, n30; corpus b07 s07, b08 s26, b03 s06; PR767 FAQ short-6 and dense options (office fonts); paginated process 6 long p5, agenda 5 long p3, table 6 long p5; PR767 homogeneous-table-3col. Nothing new is drawn, so no PowerPoint COM export.

Size-guard sweep (976 slides: 844 corpus + narrative 44+1 AR, mixed 48+2 AR, charts 35+2 AR; catalogs dropped, estimated measurement)

main this branch
compose errors 0 0
findings (text-overflow, small-cell, layout-unplaced) 523 523
slides with a finding 90 90
  • No slide gains a finding; smallest body size down on 0 slides, up on 38 (35 corpus, narrative n14 24 to 26, n23 18 to 20, n30 24 to 26); blocks smaller: 0; item paths and arrangements identical on all 976 slides.
  • Compose time (min of runs, after the review fix, on a quieter machine): main 7.3 s, branch 6.4 to 6.8 s, so no measurable cost (earlier runs under load were noisy, 1.1 to 1.3x). The half steps add trial sizes to the joint fits and the guard composes a slide again when half-steps fired.

Goldens and pinned files

  • Core composition goldens regenerated (OPF_UPDATE_GOLDENS=1): no area or region line changes against main (agenda 3 and 4 long are identical to main); sizes move in agenda-split 3, 4 long, list 3, 4 long, faq 4 long, pillars 5 long (same size, other row heights), metrics 5, 6 long, chart 5, 6 long, chart-beside 6 long, code 5 long, table 5, 6 long, table-beside 5, 6 long: every moved size goes up (16 to 17, 18 to 20, 21 to 23, 24 to 26). No case gained a finding.
  • The golden workflow must run (not regenerated here): render layout-template-goldens moves 25 of 468 slides locally (main moves 0 here): 18 template slides (the half steps: agenda-split 3, text 4, list 3, pillars 5, comparison 4, timeline 4, metrics 5, image-beside 4, chart 4 and 5, chart-beside 4, table 4 and 5, table-beside 4 and 5, code 4 and 5, hero 6, all long) and 7 paginated pages (LH-144). golden.mjs / golden-gate.mjs move 3 example slides: grid-spans slide 2 (32 to 37/35 px), product-roadmap-decision-review slide 6 and airline-disruption-recovery-review slide 6 (24 to 26 px).
  • Not touched: chartex fixture, rr-54 byte locks, catalog-free budget, generated gallery examples (check:catalog-free, check:examples, check:examples-convert, check:stability pass).
  • Changelog: changes/lh-149-sizing-fixes.md (drawing: lists the layouts whose template goldens move).

Checks

  • pnpm check:changed: build, biome, typecheck, catalog-free, changes, examples, examples-convert, font-hotlinks, registry-golden, schema-docs, schema-examples, schema-strict, skill-commands, skill-glossary, spec and stability pass. Fail as known on Windows: check:browser-safe (path separator), check:text (docs/evidence not in the blobless checkout). Core tests stopped at table-content-widths (fixed, see LH-150).
  • Every core test file run afterwards: 3426 of 3432 *.test.mjs passed before the last four updates (sibling-sizes and floor-recompose follow the half steps, overfull-continuation expects the page cap, finding-text-rules the larger size); they pass now; only script-width-estimates fails (docs/evidence). Every other core test script passes.
  • render 140 of 143 (golden.mjs, golden-gate.mjs, layout-template-goldens.mjs: the golden workflow); pptx 193 of 194 (keynote-registry-runtime, symlink EPERM); gallery 13 of 13.
  • Browser suites (file by file after setup, Edge/Chromium through Playwright): render 25 of 27 (measure-web-delivery needs Playwright's headless shell, harfbuzz-measurement-browser reads docs/evidence, as on waves 3 to 5), pptx 2 of 2. Core has no browser suite.
  • New test: packages/javascript/test/lh-149-sizing-fixes.test.mjs (16 cases, left to right and right to left; 13 of them fail on main; the agenda case guards the review fix). After the review fix: core 3431 of 3432 *.test.mjs (script-width-estimates, docs/evidence), every core test script passes.

🤖 Generated with Claude Code

michaeljgrimm and others added 2 commits November 4, 2026 01:59
…ratios, drawn metric color in validate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… whole ratios

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michaeljgrimm

Copy link
Copy Markdown
Contributor Author

Landed through the wave 6 integration, #1021 (squash 1c5292d), together with the review fixes made there. Closing without merging.

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