Skip to content

Let the author's markup stand: native video controls, link targets, field sizes, summary markers, open call-tree roots - #6640

Merged
max-sixty merged 8 commits into
mainfrom
agent-a185cf4dbfda08050
Nov 21, 2026
Merged

max-sixty merged 8 commits into
mainfrom
agent-a185cf4dbfda08050

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

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
Firefox

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".

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

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
Firefox

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

A page's `<video controls>` now plays through each browser's own controls.
Leaf no longer takes `controls` off the video and stands its own bar (play,
timeline, full screen) over its foot. Max chose this on 20 Nov, among six
places where Leaf's code overrode what an author wrote: an author who writes
good HTML gets the page they wrote, and Leaf leaves the controls to the
browser rather than replacing them.

What users lose: one look for a recording in every engine, and a first play
that looks like a replay. Each engine draws its own bar, with the volume
control Leaf's bar left out. In Firefox 159, the first play's centre button
grows from about 50px to about 120px wide and fades out over about 400 ms; a
replay shows no centre button. In Chromium 159 and Firefox 159 a press on
the picture plays the recording, and Space on the focused video plays and
pauses it, as Leaf's bar did.

Deleted with the bar: `runtime/video-controls.js`, its styles in
`integration.css`, the `data-lf-player` paint attribute and its press
selector, the iPhone full-screen declaration, and `nameable`'s export,
which only the bar imported. The bar's full-screen test, its runtime test
and the revision test that kept the bar through a revision go with it. The
recorded-media journey plays the video by the browser's controls again, as
it did before the bar.
A link the page's author wrote now opens where its `target` says, in the
page's own tab when it has none. Leaf no longer writes `target="_blank"`,
`noopener` and a hidden "opens in a new tab" description over every link
that leaves the page's origin, an author's `target="_self"` included. Max
chose this on 20 Nov, among six places where Leaf's code overrode what an
author wrote: an author who writes good HTML gets the page they wrote.

Links Leaf builds from Markdown, in a thread's messages and in a Markdown
file a page shows, are Leaf's own markup, and Markdown can't say where a
link opens. The renderer now writes `target="_blank"` on each such link
that leaves the page, as it builds it, so following one leaves the page
and the thread open behind it. `target="_blank"` implies `noopener` in
every engine Leaf supports, so the renderer writes no `rel`. Raw HTML
links in an agent's message keep the attributes the agent wrote.

What stays: the mark after a link that leaves the page, which prepaint
seats and the arrival watch carries through revisions, generated content
and shadow stages. The `g` link hint still announces "Opened … in a new
tab", now for any link whose target is `_blank`.

What users lose: a link the author left without a target navigates the
page's tab, so the reader comes back to the page with Back. A screen
reader no longer hears "opens in a new tab" on any link, Leaf's own
new-tab links included, such as an All pages row, a Markdown link or a
trace's image link.

Tests: the external-link journey now checks that the link keeps its
author's description and opens in its own tab, and the addressed-link
journey gives its new-tab link a `target`. The focus-preview journey,
which read the deleted description on an All pages row, now checks that a
preview adds to a description the author wrote and gives it back. The
journey's mark check reads the mark as the empty inline box #6631 made it,
which the old `inline-block` assertion no longer matched.
On a touch screen, a field the page's author sized now keeps the size its
author gave it. Leaf's rule set every input, textarea and select on the
page to at least 16px and at least the surrounding type, with a layered
`!important` no page rule could outrank, so a field the author set at 13px
drew at 17px in a 17px paragraph. Max chose this on 20 Nov, among six
places where Leaf's code overrode what an author wrote: an author who
writes good HTML and CSS gets the page they wrote.

iOS Safari zooms the page onto a text field set under 16px as it takes
focus and leaves it zoomed. Two places now hold the 16px floor against
that, and neither overrides the author:

- Leaf's own fields: its composers (`leaf-text`) and every field in its
  chrome or offered by a widget (`.lf-ui`) keep the `!important` floor,
  which outranks Leaf's own 13px and 14px field faces.
- A page field with no size of its own: Leaf's default control face
  (control-face.css), which sets such a field in its 14px ui font, now
  gives it the floor on a touch screen, at the face's zero weight, so any
  size the page sets wins. Without it an unsized page field drew at 14px
  and iOS zoomed onto it.

What users lose: on iOS Safari, focusing a page field its author set under
16px zooms the page, as it does on any web page.

Tests: the phone test now holds a page field set at 13px, which keeps
13px, and an unsized one, which stays at 16px or more with each of Leaf's
fields. With the old rule the sized field draws at 17px; without the
default face's floor the unsized one draws at 14px.
A `<summary>` the page's author wrote now draws the browser's own marker.
Leaf's stylesheet took the marker off every summary, on a page with no
theme too, and drew Leaf's chevron in its place. Max chose this on 20 Nov,
among six places where Leaf's code overrode what an author wrote: an
author who writes good HTML and CSS gets the page they wrote.

Leaf's chevron stays on `.lf-disclosure-marker`, which Leaf's own
disclosures wear, in the document and in widget shadow trees. The
summaries Leaf draws that relied on the summary rule now wear the class:
the contents' "On this page" toggle, a sample's failure, a trace's Saved
elements and the About dialog's sections, so each of Leaf's disclosures
keeps one arrow. `module-input.md` says the class gives a widget the arrow
Leaf's own disclosures show, no longer the one every disclosure shows.

On paper nothing changes: Leaf prints every shut disclosure open, so the
print rule now takes the browser's marker off a summary there, as it
takes Leaf's arrow off, rather than print a "closed" marker over content
that shows.

What users lose: one disclosure marker on every page. A page's summary
shows each engine's own marker, which in Firefox is a triangle a few
pixels wide beside small type.

`page-disclosure`, a new stills state, shows the incident report's shut
disclosure, whose marker this changes.
`lf-call-diff` now opens every root of its call tree as it arrives. It
opened only the first, with no attribute an author could set, so a
capture's second and later trees stood folded behind their rows. Max chose
this on 20 Nov, among six places where Leaf's code chose for the author:
the widget shows the whole capture, and its Collapse all folds a long one.

A root the user folded stays folded across a new capture, as before; only
a root arriving for the first time opens. A row holding the user's focus
still opens the folded root a capture moves it into.

What users lose: a capture of many roots opens long, until the reader
presses Collapse all.

Tests: the projection test now finds the second root open when a capture
adds it, with the toolbar offering Collapse all; the spaced-paths test
reaches each call's link without first expanding; and the focus test
closes the roots its calls move into before moving them, since they no
longer arrive closed.
leaf-agent
leaf-agent previously approved these changes Nov 21, 2026
The touch floor that Leaf's default control face gives an unsized page
field (this PR's field-size change) sat between the face's font rule and
its ink rule, and repeated four of the face's selectors, so
test_the_injected_control_face_is_one_default_in_both_trees failed in CI:
it reads control-face.css as the one default every tree shares, in order.
The floor now follows the ink rule, and the test names it as the
default's last part.
leaf-agent
leaf-agent previously approved these changes Nov 21, 2026
max-sixty added a commit that referenced this pull request Nov 21, 2026
)

Skim now folds an `<aside>` like any other block. The dial still
promises that Skim shows the gists "and nothing else", but until now it
never folded an aside. This is the sixth override from #6640 (which
removes five places Leaf overrode a page's markup). That PR left it out
because deleting the `aside` entry alone broke the sidebar Layout. Max
asked on 20 Nov to "simplify a lot and delegate to the wise agent, not
to add more folds". So instead of adding a rule that spares the sidebar,
the dial now governs the element it stands in.

### Why deleting the entry alone broke the sidebar

The `aside` entry began as `aside.sidebar` in #4506, the sidebar
Layout's region, and became every `aside` in #4724. The dial walked the
whole view or `main` holding it, so on a `main.layout-sidebar` page it
took the Layout's regions for blocks. Without the entry, Skim folded the
sidebar's contents map and set its ⋯ as a flex item of `main`. That
moved the body from x=104 (1272px wide) to x=628 (748px) in a 1400px
window, in both Chromium and Firefox (third column below).

### What changed

The dial governs its parent element. That is also the box its `position:
sticky` keeps it within, so where the author writes the dial now decides
both what it folds and where it travels with the reader. What it governs
on each Layout, when written as its registry entry says:

- column page: `main`, as before;
- sidebar page: the body (a `.layout-column` or a plain `div`), never
the sidebar beside it;
- tab, or a part's Layout element: that element, as before;
- `main` with no Layout: `main`, where an aside now folds;
- agent message: the message's markup, as before.

An aside with a gist inside it keeps the gist and folds the rest. The
`aside` entry, the three cases in the scope getter, and the dial's
imports of `viewDocument` and `authoredScope` are gone. The dial's
registry entry, which authors read, replaces "It governs the nearest tab
or part containing it, or the whole main" with "It governs the element
it stands in and sticks within it, so write it directly in the element
whose text it governs, such as the `layout-column` element, a sidebar
page's body or a tab, not in a `header` holding the title."

#6640 suggested governing "the flow it stands in, the Layout column". I
didn't build that version. The browser can only find a Layout's column
by its class or by reading the Layout's internal properties
(`--lf-layout-box`, `--lf-prose-measure`). Neither would cover the
commonest shape of an agent's sidebar page, where the title and lede sit
in a `header` spanning both regions.

### Stills, all at Skim in a 1400×900 window

**A sidebar page:** the `sidebar-contents` test page, plus a dial, four
gists and one aside in its body ("Last quarter's rotation overlapped the
payout batch…"). On main and on this branch, the contents map and the
body stand in the same place (x=104, 1272px wide). The body's aside
folds on this branch only.

| | main | this PR | `aside` deleted alone |
|---|---|---|---|
| Chromium | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/sidebar-chromium-main.png"
width="300"> | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/sidebar-chromium-this-pr.png"
width="300"> | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/sidebar-chromium-aside-deleted-alone.png"
width="300"> |
| Firefox | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/sidebar-firefox-main.png"
width="300"> | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/sidebar-firefox-this-pr.png"
width="300"> | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/sidebar-firefox-aside-deleted-alone.png"
width="300"> |

**A column page with asides in its sections.** The Cause aside folds
whole. The Fix aside keeps its gist and folds its other sentence.

| | main | this PR |
|---|---|---|
| Chromium | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/column-chromium-main.png"
width="380"> | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/column-chromium-this-pr.png"
width="380"> |
| Firefox | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/column-firefox-main.png"
width="380"> | <img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/column-firefox-this-pr.png"
width="380"> |

The Fix ⋯ stands inside the aside, because that is where its gap starts.
Pressing it opens the aside's other sentence, the paragraph after the
aside and the gist-less Timeline section, as below (Chromium). That
follows the dial's existing rule for a gap that starts inside a box, as
it already does for a list item. A framed aside makes the rule easier to
see.

<img
src="https://gist.githubusercontent.com/max-sixty/ed117622b65dac6b2d9a37b57724effb/raw/5cab0ac5b02d9219dad256006d76cbdfa5f9e80a/column-chromium-fix-gap-pressed.png"
width="380">

### What users lose

- **A dial written inside a wrapper governs only that wrapper.** If the
dial sits in the `header` holding the title, for example, Skim folds
nothing below the header. On main such a dial governed the whole `main`,
but its sticky box scrolled away with the header. Of 180 recent pages
under `~/.tmp` that have a lede, 167 hold it in a `header` or `hgroup`,
so this is where an author is likeliest to go wrong; the registry entry
now says where to write the dial (eval below).
- **A sidebar page's spanning header no longer folds.** Where a `header`
spans both regions, it stays whole at Skim, byline and tags included,
because a dial in the body doesn't govern it.
- **An aside counts toward reading time, and Everything opens its
disclosures.** An aside's words count toward each depth's minutes, and
Everything opens a closed `details` inside an aside.

### Eval of the registry entry

In the dial's eval (`skim-carries-the-argument`), three runs per arm,
every run read its arm's dial entry, and every author on both arms wrote
the dial directly in a sidebar page's body. This branch passed 3 of 3
and main 2 of 3; main's miss was a gist given to background material,
unrelated to placement. The eval ran on an earlier wording of the entry
("directly in `main`, a sidebar page's body, a tab or a part"), which I
reworded after review because a part holds a single Layout element.

### A ⋯ inside a grid, unchanged

Skim still sets its ⋯ among the items of a grid or flex box it walks
into, such as `layout-tiles`. With a tile holding a gist beside one that
doesn't, main and this branch both put a third item in the tiles grid,
which narrows the kept tile from 348px to 224px. That doesn't depend on
asides or on the dial's scope.

### Tests

The two changed dial tests, plus
`test_depths_fold_keep_the_place_and_restore`,
`test_a_section_without_a_gist_folds_whole` and
`test_a_folded_block_that_sets_its_own_height_takes_no_room`, all pass.
`pnpm run test:runtime` (1078 passed) and `pnpm run check:browser` pass.
Each new assertion was also run against a control: the aside assertions
fail with main's dial, and the sidebar test fails with the one-word
deletion, where the contents map is hidden.

> _This was written by Claude Code on behalf of max-sixty_
# Conflicts:
#	browser/styles/components/controls.css
@max-sixty
max-sixty merged commit 93eceba into main Nov 21, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-a185cf4dbfda08050 branch November 21, 2026 07:00
max-sixty pushed a commit that referenced this pull request Nov 21, 2026
…changed (#6660)

Four of the failures in scheduled `ci` run
[44896279165](https://github.com/max-sixty/leaf/actions/runs/44896279165)
on `c72a8ad03` are tests that weren't updated when a recent change moved
what they read. None of them catches a defect a user would see, so each
fix updates the test and keeps what it asserts. Each test failed locally
on `c72a8ad03` and passes with this change.

- **`test_the_page_holds_still_under_the_user[dial-*]`** (8 cases, Linux
and macOS). #6612 put each depth's reading time under its word, so the
dial's radios are now named `Skim 2 min` and so on. `turn()` was still
waiting for a radio named exactly `Skim` and timed out after 120 s. It
now matches `^Skim \d+ min$`, the same pattern
`tests/browser/widgets/test_dial.py` uses. The six cases now pass, and
the two `dial-grown-after-glide` cases fail as their `MOVES_ON_MAIN`
entry expects.
- **`test_a_link_s_preview_shows_only_what_the_page_draws[browser]`**
(teardown error, Linux and macOS). #6654 wraps each line of a
reading-face `<pre>` in a `<span data-lf-pre-line>`. That means `#code >
span` now selects the first line's wrapper rather than the hidden span.
The `COPY CONTROL` words the test inserts after it became an extra line,
which pushed the rows below down 20 px with no input, and the shift
watch reported that. The test now inserts the words after `#code
span[style]`, the hidden span it meant, so they stay on the first line.
- **`test_every_restore_case_a_user_can_return_to_is_arrived_in`**
(Linux and macOS). #6641 adds ` (fails the check so that …)` to each
finding. The test split the `returned holding a,b` list on commas only,
so the suffix stuck to the last key. Whenever storage listed the restore
case's own key last, the parse dropped it. The order of keys in storage
is what made this pass locally and fail on CI. The test now reads the
list up to the first space.
- **`test_arrangement_retains_linked_pages_per_phase`** (`dev-tests`).
#6640 stopped Leaf writing `target="_blank"` over cross-origin links.
The test's authored links now open in the same tab, so `expect_popup`
timed out. The test now follows both links in place and checks the
restored addresses and the kept decision as before.

Refs #6659 — automated triage. The report's other failures are owned
elsewhere: the long-thread card width is #6139, the Firefox
`ResizeObserver` loop is #6604, and the macOS-only failures are tracked
in their own cause issue.

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