Skip to content

Let Skim fold an aside: the dial governs the element it stands in - #6642

Merged
max-sixty merged 1 commit into
mainfrom
agent-abc5c93ea5712020e
Nov 21, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-abc5c93ea5712020e

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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
Firefox

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
Firefox

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.

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

Skim never folded an `aside`, though the dial promises that Skim shows the
gists and nothing else. The exemption began as `aside.sidebar` in #4506, the
sidebar Layout's region, and became every `aside` in #4724. It kept Skim off a
sidebar Layout's track: the dial walked the whole view or `main` holding it, so
it took a Layout's regions for blocks. Deleting the entry alone folded the
sidebar's contents and set a ⋯ in the Layout's flex row, which moved the body
from x=104 (1272px wide) to x=628 (748px) in a 1400px window, in Chromium and
Firefox.

The dial now governs its parent element, the box its `position: sticky`
already keeps it within. So where the author writes it says what it governs: a
column page's `main`, a sidebar page's body, a tab, a part's Layout element or
a message. It never walks a sidebar beside its body, and an aside in the flow
folds like any block, keeping a gist inside it. The `aside` entry, the scope
getter's three cases and the dial's imports of `viewDocument` and
`authoredScope` are gone.

Behavior that changes:

- A dial written inside a wrapper, such as the `header` holding the title,
  governs only that wrapper. Before, it governed the whole view or `main`, but
  stuck only within the wrapper. The registry entry now says to write it
  directly in the element whose text it governs.
- On a sidebar page whose `header` spans both regions, the header stays whole
  at Skim, since a dial in the body doesn't govern it.
- An aside's words count toward each depth's reading time, and Everything opens
  a closed `details` in an aside.

Rejected: finding the dial's region from the Layout's declarations
(`--lf-layout-box`, `--lf-prose-measure`). It couples the dial to the Layout's
internals and can't say what a dial in a header spanning both regions governs,
the commonest shape of an agent's sidebar page.

Tests: an aside folds and keeps its gist at Skim
(test_skim_keeps_what_the_author_marks_whatever_it_is, which fails on main's
dial), and a dial in a sidebar page's body leaves the sidebar's contents shown
and both regions where they stood
(test_a_dial_in_a_sidebar_page_s_body_governs_the_body_alone, which fails
against the one-word deletion).
@max-sixty
max-sixty merged commit eaceebc into main Nov 21, 2026
6 checks passed
@max-sixty
max-sixty deleted the agent-abc5c93ea5712020e branch November 21, 2026 06:44
leaf-agent added a commit that referenced this pull request Nov 22, 2026
… dead pieces (#6723)

Several comments and one shipped reference describe code that has since
changed. This corrects them and removes two pieces of dead code.
Behavior is unchanged, apart from one shipped sentence that no longer
points package authors at the wrong pattern.

- **`skills/leaf/references/module-reading.md`** gave the depth dial as
an example of a widget that reads its document with
`viewDocument(node)`. #6642 scoped `lf-dial` to `this.parentElement` and
dropped that import, so a package author copying the dial from this
sentence got the scope the dial stopped using. The contents list
(`toc-view.js`) is now the only example, and it is the only caller.
- **`src/leaf/todos.py`** and **`_todo_error`** in `event_contracts.py`
said a to-do needs a *live* widget. Since #6641,
`work.widget_seat_error` accepts any widget the newest revision
declares.
- **`browser/styles/floating-panel.css`**: the band comment said the
band is the shelf's tallest picture plus its gaps. The rule reserves the
most a picture may take, `--lf-media-h` (tokens.css), plus a gap on each
side, as #6686's own description says.
- **`browser/runtime/obligations/view.js`** sent readers to a passage in
`version.js`'s header that no longer exists. `carry.js` owns that rule
now ("Other unnamed elements and changed tags carry nothing"), and the
comment states the failure inline.
- **`browser/runtime/rendering.js`** cited
`scripts/leaf/render_checks.py`. The file is
`src/leaf/render_checks.py`.
- **Dead code:** `page-inspection.js` rendered a "Reading source…" line
in a branch that the early `return` above it already rules out;
`handOver` in `thread/replies.js` took a `target` argument it never
read; and `projection/authored.js` stated its header paragraph twice.

The browser type check (`tsc --project browser/types/tsconfig.json`)
passes. These are comment and dead-code changes with no behavior to pin,
so there's no regression test.

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