Skip to content

Add a detail dial: turn a page from each section's gist to every detail - #4506

Merged
max-sixty merged 5 commits into
mainfrom
detail-dial
Oct 27, 2026
Merged

max-sixty merged 5 commits into
mainfrom
detail-dial

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Adds an optional detail package whose lf-dial turns a page between three depths: Skim shows the headings, the lede and each block marked .gist; Read shows the page as written; Everything also opens every closed details. Each depth only adds to the one before, so turning the dial never swaps one wording for another. It is one of the reader UXs proposed on the Catch up design page, picked by the maintainer to try.

Keeping the place. Turning the dial keeps the block at the reading line, a quarter of the way down the window, where it stood. When Skim folds that block, its section's gist lands in its place. This runs through Leaf's place keeper (placeKeeper): the block at the line is the preferred reading, and each block's identity is the kept block its run follows, so a folded paragraph hands its place to its gist. Blocks still shown then glide from where they stood, and arriving ones fade in.

Folding. Skim folds with hidden="until-found", as lf-deck does for its cards, so find-in-page, fragments and travel to a comment still reach folded text and open its run. A ⋯ under each gist unfolds that run alone. The walk descends only into plain structure holding a heading or gist, treats a Leaf element as one block, never touches an element already hidden or the margin, and leaving Skim takes back exactly the folds and markers it made.

Where the dial lives. It sticks at the window's top, at the column's end, and registers as a root header, so it can be turned mid-read. While stuck, it covers the ends of the lines passing under it.

State. The depth is this tab's view (tabStore), like an open tab panel: no event, no protocol change, no core code.

Files:

  • packages/detail/: the widget, its registry entries (lf-dial, .gist), styles and author instructions.
  • tests/browser/widgets/test_dial.py: folding, the kept place (fails without the keeper), the ⋯, Everything and the restore.
  • examples/developer/detail.html: the package page, which also puts lf-dial and .gist in the corpus.
  • docs/extending.html, skills/leaf/references/packages.md, examples/layer.json, dev/leaf_dev/commands/corpus.py: list the package.

The author instructions ask for gists that state a section's conclusion, not its topic. No eval scores that wording yet, and it reaches only agents that select the package.

A new optional `detail` package. `lf-dial` sets how much of the page shows:
Skim shows the headings, the lede and each block marked `.gist`; Read the page as
written; Everything also opens every closed `details`. Each depth only adds to the
one before. Skim folds with hidden=until-found, so find-in-page, fragments and
travel still reach folded text and open its run, and a ⋯ under each gist unfolds
that run alone.

Turning the dial keeps the reader's place through Leaf's place keeper: the block at
the reading line is the preferred reading, and each block's identity is the kept
block its run follows, so a folded paragraph hands its place to its gist. Blocks
still shown glide from where they stood and arriving ones fade in. The dial sticks
at the window's top so it can be turned mid-read.

Prototype for review: no browser tests, developer example or eval yet.
The dial now holds the reading place through marks it keeps rather than writing
and removing them each turn, which the page's write check refused. A browser
test covers Skim folding all but headings and gists while the paragraph at the
reading line hands its place to its gist, the ⋯ showing one section, Everything
opening the closed details, and Read restoring the page exactly; it fails without
the place keeper. examples/developer/detail.html puts lf-dial and .gist in the
corpus, and docs/extending.html lists the package.
The browser build lists each package's modules for the type check, so the new
package needed its paths; the check then refused `open` on a querySelectorAll
match, which now reads every details element and skips the open ones.
@max-sixty
max-sixty merged commit 3ba5020 into main Oct 27, 2026
4 checks passed
@max-sixty
max-sixty deleted the detail-dial branch October 27, 2026 20:45
leaf-agent added a commit that referenced this pull request Nov 1, 2026
The detail dial introduced in #4506 reserved its height but left its
empty `fit-content` host at zero width. Its theme now measures the three
button labels invisibly in their interface font, including the buttons'
insets and the row's gaps, until the element is defined. The completed
dial keeps its existing size, controls and placement.

The existing detail-package widget-quality test fails before and passes
after in both column and workspace layouts, without changing its
allowances. The dial's folding/place-retention/restore journey and all
737 runtime tests pass. `git diff --check` passes; Prettier could not
run because it is unavailable in this checkout.

A served startup comparison reaches upgrade and presentation with the
same 33 code requests and 31 JavaScript requests, with unchanged
JavaScript bytes. The theme adds about 0.3 KB of CSS to reserve the
control's actual room before upgrade; no script or request is added.

<details><summary>Completed dial, base and candidate</summary>

Fresh served preview screenshots are pixel-identical. The change is to
the invisible pre-upgrade box: from zero width to the width of the
buttons that will occupy it.

Before:

![Base completed dial and
page](https://github.com/user-attachments/assets/50a0b0a0-fbd1-4282-9b74-2a9966ffea66)

After:

![Candidate completed dial and
page](https://github.com/user-attachments/assets/ec113efe-66e1-4b54-90fd-e3b7ef11c235)

The `detail-dial` stills comparison also ran: it reported a
selected-button border paint difference with no computed-style
differences. The fresh HTTP preview pair above was checked separately
and has no pixel difference.

</details>

Closes #4949 — automated triage

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