Repository navigation
Let Skim fold an aside: the dial governs the element it stands in - #6642
Merged
Merged
Conversation
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).
leaf-agent
approved these changes
Nov 21, 2026
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theasideentry 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
asideentry began asaside.sidebarin #4506, the sidebar Layout's region, and became everyasidein #4724. The dial walked the whole view ormainholding it, so on amain.layout-sidebarpage 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 ofmain. 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: stickykeeps 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:main, as before;.layout-columnor a plaindiv), never the sidebar beside it;mainwith no Layout:main, where an aside now folds;An aside with a gist inside it keeps the gist and folds the rest. The
asideentry, the three cases in the scope getter, and the dial's imports ofviewDocumentandauthoredScopeare 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 thelayout-columnelement, a sidebar page's body or a tab, not in aheaderholding 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 aheaderspanning both regions.Stills, all at Skim in a 1400×900 window
A sidebar page: the
sidebar-contentstest 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.asidedeleted aloneA column page with asides in its sections. The Cause aside folds whole. The Fix aside keeps its gist and folds its other sentence.
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
headerholding the title, for example, Skim folds nothing below the header. On main such a dial governed the wholemain, but its sticky box scrolled away with the header. Of 180 recent pages under~/.tmpthat have a lede, 167 hold it in aheaderorhgroup, so this is where an author is likeliest to go wrong; the registry entry now says where to write the dial (eval below).headerspans both regions, it stays whole at Skim, byline and tags included, because a dial in the body doesn't govern it.detailsinside 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 inmain, 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_wholeandtest_a_folded_block_that_sets_its_own_height_takes_no_room, all pass.pnpm run test:runtime(1078 passed) andpnpm run check:browserpass. 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.