Skip to content

Draw the external mark as an empty inline box, from one rule the field shares - #6631

Merged
max-sixty merged 1 commit into
mainfrom
link-icon-nowrap
Nov 21, 2026
Merged

max-sixty merged 1 commit into
mainfrom
link-icon-nowrap

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

#6626 kept the external-link mark on its word's line with a word joiner in a zero-size inline box, sized through a registered @property, plus a copy of the rule in the draft field's closed shadow root. This replaces both with one shorter rule. An empty inline ::after adds no line break opportunity, so its padding, which holds the icon, stays with the link's last character, as USWDS's external-link mark does. The field's mark widget exposes part="lf-external-mark", so the same rule draws it through ::part(), which reaches a closed root in Chromium, Firefox and WebKit. The field's copy of the rule goes.

The trade to weigh: the icon is now centred in a box as tall as the link's font rather than anchored to the baseline, so it sits 0–2px lower depending on the font. A thread card's 14px system-ui draws identically in Firefox. Left is #6626, right is this change, in Firefox at 2x:

The same caption in five fonts, #6626 left and this change right; the icon sits up to 2px lower on the right

Two rules carry the remaining cost. A second, transparent mask layer stops WebKit 27.2 from painting the whole box under a single smaller no-repeat mask; this is recorded with a repro in notes/browser-support.md. height: 0.75em, which an inline box ignores, keeps the mark drawn on a link laid out as a flex container, such as the trace gallery's Playwright link.

Max asked whether the follow-ups could be simpler. Codex reviewed it twice: its first review moved the field back to a point widget, and its second restored the field mark's accent colour. Tests run: the presentation, go-to, draft-placement and reply-markdown browser tests; test:runtime; pnpm run check; and Firefox stills. The draft-placement test fails without the ::part selector. The draft field draws every link shape I tried (plain, emphasised, empty, escaped, entity, two-line) pixel-identical to #6626.

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

…d shares

#6626 kept the mark after an external link on its word's line with a word joiner in a
zero-size inline box sized through a registered property, and a copy of that rule in
the field's closed shadow root. An empty inline ::after does the same job: it adds no
line break opportunity, so its padding, which holds the icon, stays with the link's
last character, as USWDS's external-link mark does. The word joiner, the zero font
size, the registered --lf-external-em and the user-select lines go. A height of
0.75em, which an inline box ignores, keeps the mark drawn in a link laid out as a flex
or grid container, where the ::after is a block, as the trace gallery's Playwright
link is.

The field's mark is drawn by the same rule: its widget's span carries
part="lf-external-mark", and surfaces.css styles ::part(lf-external-mark)::after,
which reaches the field's closed root in Chromium, Firefox and WebKit. The field's
copy of the rule and declared-words.js's externalMark() go. The widget stays a point
before the link's end, where CodeMirror adds no buffer image between it and the
link's words, so it keeps an entity-ending, entity-only, image-only or empty label's
mark where the message draws it; a mark decoration on the words lost those.

The icon is centred in the box, which is as tall as the link's font, rather than
anchored 0.03em above the baseline, so it sits 0 to 2px lower than before depending
on the font; a thread card's 14px system-ui in Firefox draws identically. A second,
transparent mask layer stops WebKit 27.2 painting an inline box's whole background
under a single smaller no-repeat mask (notes/browser-support.md).

Max asked whether the follow-ups could be simpler.
@max-sixty
max-sixty merged commit b40349d into main Nov 21, 2026
6 checks passed
@max-sixty
max-sixty deleted the link-icon-nowrap branch November 21, 2026 01:21
max-sixty added a commit that referenced this pull request Nov 21, 2026
…ale engine claims (#6634)

After #6631, Max asked for a scan for other code made more complicated
by a mistaken assumption. Four scans checked about 78 engine claims in
the runtime, the theme and the packages against Playwright 1.65.2's
Chromium 159, Firefox 159 and WebKit 27.2, each with a minimal repro.
Nearly all still hold. This change acts on the ones that don't:

- **A wrong diagnosis.** #3095 moved the text field's overflow mark to
`data-lf-overflows` because "WebKit retains style from a removed custom
state". In fact WebKit garbage-collects `ElementInternals.states`, after
which `has()` reads a new, empty set while `:state()` still matches. The
field skips a write `has()` says is done, so `:state(more-above)` stayed
on a one-line draft in WebKit on main. The field now holds the set, and
the overflow mark is a state again. The new note records the gap.
- **Gaps engines have closed.** The `::-webkit-details-marker` rules go
(Safari 18.4 made `summary` a list item), as do two notes entries no
code rested on.
- **Corrected records.** Comments and notes that named the wrong engines
or a wrong cause are rewritten with dated evidence.
- **A guard built on a wrong reading of the spec.** A diff header hid a
folder only when its box was narrower than an ellipsis, assuming a box
with room for one draws it. A box's first character is clipped rather
than ellipsed, so Firefox showed `skconfig.py` for `skills/config.py` at
folder widths up to 17px. The guard now measures a wide letter and the
ellipsis.
- A surface grip's hint moves from a `title` to Leaf's preview, as
`browser/AGENTS.md` requires. A screen reader no longer hears it as a
description; the drag has no keyboard route either way.

Codex reviewed the branch and found that two prototypes were wrong: the
preview's workaround for Firefox's stale popover source still reproduces
once a show is held (Firefox 159 and 160.0.1), and dropping a
view-timeline guard would strand annotations in an engine without view
timelines. Both are reverted.

Tests: `test:runtime`, `pnpm run check`, pre-commit, the preview, margin
and diff path browser tests, the comment box test in Chromium and
WebKit, and three floating panel field tests.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 21, 2026
…ield sizes, summary markers, open call-tree roots (#6640)

Deletes five places where Leaf's code overrode what a page's author
wrote, so the author's markup and the browser's defaults stand. Max
picked this on 20 Nov: "the goal here should be to simplify a lot and
delegate to the wise agent, not to add more folds". One commit per
deletion; the branch removes 919 lines and adds 221, 107 of them in
tests. A sixth deletion, Skim folding asides, is left out because it
breaks the sidebar Layout (below).

### 1. A video draws the browser's own controls

`runtime/video-controls.js` and its styles, wiring and tests are gone
(code −440, tests −159). `<video controls>` now plays through each
engine's controls, which add the volume control Leaf's bar left out. In
Chromium 159 and Firefox 159 a press on the picture plays, and Space on
the focused video plays and pauses.

| | Before | After |
|---|---|---|
| Chromium | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/video-chromium-before.png"
width="380"> | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/video-chromium-after.png"
width="380"> |
| Firefox | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/video-firefox-before.png"
width="380"> | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/video-firefox-after.png"
width="380"> |

What users lose: one look in every engine, and a first play that looks
like a replay. The bar's claim about Firefox still holds in Firefox 159:
on the first play its centre button grows from about 50px to about 120px
wide and fades out over about 400 ms, and a replay shows no centre
button. The frames below were sampled at 0, 167, 333 and 417 ms; the top
row is the first play, the bottom row a replay. The "0:00 / 0:00" at
rest is the gallery's `preload="none"`.

<img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/firefox-first-play.png"
width="652">

### 2. A link opens where its author's `target` says

The rewrite in `declared-words.js` that wrote `target="_blank"`,
`noopener` and a hidden "opens in a new tab" description over every
cross-origin link is gone (code −141). On `pr-walkthrough`, the first
external link reads `target="_blank" rel="noopener"
aria-describedby="lf-external-description-1"` on main and none of the
three on this branch; both draw the external mark, which stays. Markdown
can't say where a link opens, so Leaf's renderer now writes
`target="_blank"` on each link that leaves the page as it builds it, in
messages and Markdown files. Raw HTML links in an agent's message keep
the agent's attributes.

What users lose: a link written without a target navigates the page's
tab. A screen reader no longer hears "opens in a new tab" on any link,
Leaf's own new-tab links included (All pages rows, Markdown links, a
trace's image link). That is a decision for you, below.

### 3. A page's own field keeps its author's size on a touch screen

The touch rule forced every field to `max(16px, 1em) !important`, so an
author's 13px field drew at 17px. Now the `!important` floor covers only
Leaf's own fields (`leaf-text`, and fields in its chrome or offered by a
widget). An unsized page field takes the floor from Leaf's zero-weight
default control face (`control-face.css`), so it still doesn't trigger
iOS Safari's zoom on focus, and any size the page sets wins. Phone
viewport, author's 13px "Owner" field above an unsized "Team" field:

| Before | After |
|---|---|
| <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/field-phone-before.png"
width="285"> | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/field-phone-after.png"
width="285"> |

What users lose: on iOS Safari, focusing a field its author set under
16px zooms the page, as on any web page. The default-face floor is a
call I made, not a deletion: without it, an unsized page field drew at
Leaf's 14px ui size and iOS zoomed onto it. `draft.css`, `--lf-msg-size`
and `wa-input` already build the floor in the same way.

### 4. A page's summary draws the browser's marker

Leaf's chevron no longer replaces the marker on every `<summary>`. It
stays on `.lf-disclosure-marker`, and the summaries Leaf draws itself
(contents toggle, sample failure, trace's Saved elements, About dialog)
now wear that class, so Leaf's own disclosures keep one arrow. On paper
nothing changes: Leaf prints shut disclosures open, so the print rule
drops the browser's marker there too.

| | Before | After |
|---|---|---|
| Chromium | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/summary-chromium-before.png"
width="300"> | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/summary-chromium-after.png"
width="300"> |
| Firefox | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/summary-firefox-before.png"
width="300"> | <img
src="https://gist.githubusercontent.com/max-sixty/370bd125073a96cb195c958d3abc1c20/raw/c2d00d4675add740c4026cf3b5520a1ff7453d27/summary-firefox-after.png"
width="300"> |

What users lose: one marker across engines and across a page's and
Leaf's disclosures. Firefox's triangle is about 5px wide.

### 5. Every call-tree root opens

`lf-call-diff` opened only its first root. It now opens each root as it
arrives; Collapse all folds a long capture, and a root the user folded
stays folded. The walkthrough's capture has one root, so no still
changes; the projection test now finds a second root open when a capture
adds it. What users lose: a capture of many roots opens long.

### Left out: Skim folding asides

Dropping `aside` from what the dial's Skim never folds breaks the
shipped sidebar Layout. On a `main.layout-sidebar` page with a dial,
Skim hides the aside's contents list, and its ⋯ lands as a grid item of
`main`, moving the column from x=104 (1272px wide) to x=628 (748px) at
1400px. The `aside` entry was standing in for "a Layout track". The
underlying fix is the dial's scope: it governs the whole `main`, so it
walks the Layout's tracks as if they were prose. If it governed the flow
it stands in, the Layout column, an aside inside the column would fold
like any block and the sidebar would never be walked. That changes what
the dial governs, so it's yours to decide.

### Decision for you: Leaf's own new-tab links

The deleted rewrite was also what gave Leaf's own new-tab links their
"opens in a new tab" description. Besides the Markdown renderer, the
panel's install link and All pages rows, the media viewer, the trace and
the visual review each write `target="_blank"` by hand. Either (A) leave
them as browsers draw them, which is what this PR does, or (B) give
Leaf's new-tab links the description from one shared home. WCAG asks for
the warning only at AAA (3.2.5, technique G201).

### Tests

`pnpm run test:runtime` (1077 passed) and `pnpm run check:browser`; the
smoke tier; `test_interact_layer.py` and `test_interface_fonts.py`; the
render gate on `feature-gallery`, `incident-report`,
`notification-playground` and `pr-walkthrough`; and each test the
commits touch, by node id, including the recorded-media, external-link
and focus-preview journeys. The phone-field test was run against each
old rule to confirm it fails there: the author's field draws at 17px,
and without the default-face floor the unsized one at 14px. The
external-link journey's mark check was already failing on main since
#6631 made the mark an inline box; it is fixed here because the commit
rewrites that test.

> _This was written by Claude Code on behalf of max-sixty_
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