Skip to content

Give each copied UI size one token and derive the rest - #3200

Merged
max-sixty merged 16 commits into
mainfrom
ui-ink-room
Oct 20, 2026
Merged

max-sixty merged 16 commits into
mainfrom
ui-ink-room

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The theme and its components copied sizes from each other as literal numbers: a 48px row reserve for a 44px panel row, a 32px shadow reach a script hard-coded, a 34px coarse button beside a 28px answers line, left/right paddings that only held left to right. Each copy could drift from its source, and several had. This branch gives each of those sizes one token and derives the rest from it.

Visible fixes (each with a browser test that fails without it)

  • Right-to-left tables: outer-cell padding and cell alignment were physical (padding-left, text-align: left), so a right-to-left table's words stood 14px+ in from the prose edge. Now padding-inline-* and text-align: start.
  • Page foot room: the reserve under the floating panel is derived from the row it reserves (--lf-fp-line + 2 × --lf-fp-row-pad); the page used to end 4px further above it.
  • Answers line under a finger: --lf-fp-press sizes the answers line, buttons and reaches together, so an Undo arriving later no longer grows the line by 6px.
  • Phone panel width: --lf-fp-max / --lf-fp-gutter set the panel's width; the expanded phone panel kept 4px less than the collapsed one.

Visible without a test

  • Touch rail: --rail is derived from --rail-hang and --margin-gap, now in the theme; the touch rail shrinks 119 → 107px to what the markers take. Mouse is unchanged.
  • Attached image on the panel (from Draw the floating panel's attached images as pictures with a corner × #3190): its 0 4px 14px shadow was off the theme's ladder and fails test_every_lift_names_one_of_the_theme_s_heights_cast_in_the_scheme_s_ink on main; it now lies at --raise-1.

No visible change

  • Shadows are written from --raise-N-drop / --raise-N-blur; floating-panel.js reads the panel's shadow reach from them instead of SHADOW_REACH = 32. Lengths scripts read are registered with @property so they resolve to pixels.
  • lf-shot frame borders, lf-draft inset and corner, message-control and edit-button sizes, the primary reader's news-notice cap and the sample label word each read one token.
  • Dead or duplicated rules removed (an unused margin-entry rule, a duplicated [data-lf-focus] selector, -webkit- duplicates, a doubled input-type list).

Computed styles of every element on the corpus, an open thread and progress messages were diffed against main in Chromium and Firefox; nothing differed beyond the changes above. Touch changes were measured in Chromium's touch emulation, not on a device.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 16 commits October 19, 2026 17:21
The outer columns dropped their gutter with physical padding-left and
padding-right, so a right-to-left table kept 14px on its first column's
right and lost it on its last column's left: its words stood 14px in from
the prose at both ends. The rule now names the table's start and end.

Also drops a data block's `line-height: inherit`, which the `font: inherit`
before it already sets.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- The margin entry's label rule hid the label and the spacer, but a later
  rule of the same weight shows the label as its tooltip and hides the
  spacer itself, so it decided nothing.
- The root's bottom scroll padding took max(12px, the ring's room), which
  is always 12px, the landing room the top already reads; the focus
  margin adds the ring's room on its own.
- A field's focus face named the nine-type input list a second time; it
  nests in the field's rule at the same weight.

Computed faces on the corpus match the base in Firefox.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- lf-shot drew every frame and rail border at a literal 1px while the
  fitting consumer subtracted --lf-shot-frame-border, so the two agreed
  only by coincidence. Each border now reads the token, which retires the
  rule that reset the comparison's border width to it. A state caption's
  inset ring negates --focus-ring-w instead of writing -2px.
- lf-draft's editor gave up its corner by a calc that retyped the draft's
  14px inline padding and its corner radius retyped --r. The padding is
  --lf-draft-inset, read by both; the ring's inset is --focus-ring-room.
  In forced colors the ring keeps its geometry and only turns Highlight,
  rather than restating 2px and -5px; the test now holds that geometry.
- controls.css listed [data-lf-focus] twice and wrote every scroll-edge
  mask twice, prefixed for WebKit; every engine Leaf supports takes the
  unprefixed mask-image. A draft's source drops a line-height: inherit
  its font: inherit already sets.

Computed faces on the corpus match the base in Chromium and Firefox.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…om them

A box that clips has to leave a lifted thing room for its shadow, and two
readers worked that room out from a copy of the geometry: the capture
table's outer cells padded by --raise-1-reach, a token holding only the
blur, and the floating panel cut its ground to the box grown by a
SHADOW_REACH of 32, --raise-2's 8px drop and 24px blur typed into the
script. The theme now writes every height from --raise-N-drop and
--raise-N-blur; the cells read --raise-1-blur, the reach beside a box,
and the panel adds --raise-2's drop and blur from the ground's computed
style, so a change to a height moves the room with it.

The heights test asked for a lift by its three literal lengths, so it
now reads the drop and blur tokens as the lengths they hold.

The ground's clip on the corpus matches the base in Firefox.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The theme reserved the row at the window's foot as max(48px, aim floor +
8px), a number of its own, while the row is its 32px line and 6px padding
each side: 44px under a mouse, 48px under a finger against a reserve of
52px. So the page's end stopped 4px further above the row than the row
stands above the window's edge, and the held keys, centred on the
reserve, stood 2px off the row's middle.

The line and the row's padding now live in the theme beside the reserve,
which is written from them; the panel reads them as it did.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A line of answers holding only words is a press tall, so the Undo a
reading brings later moves nothing beside it. It said so with 28px, the
mouse's press, while a finger's presses are the row's 34px line, so under
a finger a press arriving grew the line by 6px. The panel's press height
is now --lf-fp-press, the row's line under a finger, read by the line, the
presses and the two reaches that floored at it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The panel's width was written out three times, each with its own gutter:
540px with 24px, the wider panel's 760px with 24px again, and a phone's
window less 20px. The wider panel's rule outranks the phone's, so on a
phone, pressing for more room to write narrowed the panel by 4px. The
measure and the gutter are now tokens the one width is written from; the
wider panel sets only its measure and a phone only its gutter.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The leaf stood 32px wide, a copy of --lf-fp-aim, so a finger's wider aim
needed a min-width patch to reach it and the folded leaf a min-width: 0
to undo the patch. The leaf is now as wide as --lf-fp-aim, which retires
both. Its corner's position joins its one rule.

Computed faces on the corpus match HEAD.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A sample's label wrote its word, quoted or live sample, into four rules
and the live sample's four copies, the last of which needed a :has() only
to win a tie. The word is now --lf-sample-word, set by the sample and by
a live one, and the four label rules read it.

The labels the corpus draws match HEAD in Chromium.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The size of a message's control, max(26px, the aim floor), was written
into five rules across controls.css and surfaces.css, and the room an
open rewrite's Cancel, gap and Save take was summed by hand in three
places beside the two presses that set it. They are now tokens beside the
message's other measures (--lf-msg-control-size, --lf-msg-edit-cancel,
--lf-msg-edit-save, --lf-msg-edit-gap and their sum, --lf-msg-edit-room),
and every room, press and gap reads them. A primary reader's news notice
reads its head's --lf-msg-head-room rather than a second 5rem.

Computed faces match HEAD on an open floating thread and on progress
messages.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The rail seats a resting cluster hung --rail-hang off the column, but it
wrote the hang as 22px, a copy of the mouse's value. Under a finger the
hang drops to 10px while the larger entries take that room, so the rail
reserved 12px no cluster used (119px for a cluster of 107px): the rail
needed a 12px wider window to stand, and a breakout got 12px less room.

The hang and the cluster's gap now live in the theme beside the rail,
which is written from them; the overlay's cluster and margin-layout.js
read them as before. Under a mouse nothing moves.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The cells and the caption aligned their words left, so with the gutter
gone a right-to-left table's short words, such as a heading over a wider
column, still stood far from the prose's right edge. They align to the
start, which is left in a left-to-right table. The test now measures the
first column's words, a short heading's included, not its padding box.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… read

A primary reader's news notice read its width cap from the message head's
room, which a notice moved into a reply part doesn't inherit, so there it
lost its cap. Both now read --lf-primary-news-width.

floating-panel.js and margin-layout.js parse --raise-2's drop and blur and
--rail-hang as pixels; they are registered as lengths, so a theme writing
them in rem or calc() still hands the scripts pixels.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/kernel/kernel.json
An image attached to the panel's field cast a shadow of its own, 4px down
with a 14px blur, a fourth height beside the theme's three, so the
heights test refuses it on main. It now lies at --raise-1, as an image
does, and the shelf's room for that shadow is --raise-1's drop and blur
rather than a 10px that the old shadow's 18px reach overran.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 45ee955 into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the ui-ink-room branch October 20, 2026 01:37
max-sixty added a commit that referenced this pull request Oct 20, 2026
…#3201)

Two authoring references stated sizes that are derived from the theme,
so they would go wrong silently when the theme changes:
`authoring-evidence.md` gave `lf-shot`'s column as "about 720px" (a copy
of `--col`), and `page-layout.md` gave the sidebar page's wrap point as
"about 870px" (the sum of its regions' flex bases, gap and padding). The
capture passage now names `--col` and states what follows from it; the
sidebar passage states when the regions stack rather than where that
currently lands.

The code-side copies are handled separately (#3200 and the
`table-edge-room` branch).

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 20, 2026
The [main CI
run](https://github.com/max-sixty/leaf/actions/runs/39349858182) failed
in two browser tests. Current `main` passes the theme-height test after
#3200. The data-publication test's original server 500 is also gone
after #3202 made an unreadable stored publication read as absent, but
#3202 added a `format` field to publication files and left this test
comparing the whole stored record to three browser fields.

Compare `run`, `updated`, and `value` on both sides. This keeps the
test's checks that each rerun reaches the widget and that corruption,
clearing, and recovery publish the expected states. On current `main`,
the focused data test failed at the mismatched `format` field before
this change; with this change, both tests from the failed run pass (`2
passed`).

---------

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants