Repository navigation
Conversation
Skim folded every block the author hadn't marked `.gist`, so a chart, a diagram or a screenshot vanished from a quick pass, though a skimmer often reads a page by its pictures. Skim now keeps each picture with its caption: a figure, an image, an inline drawing, a video or canvas, or a widget whose entry declares `visual` (painted `data-lf-visual`), such as a chart. A heading stands at Skim when a lede, gist or picture follows it, so a section whose only content for a skimmer is a picture keeps its heading. A line of text holding a picture, or a table holding one, stays whole rather than being taken apart, and nothing inside a closed `details` counts, since Skim shows nothing Read doesn't (a gist in a closed disclosure was laid out by the walk before, and its summary folded). Pictures a Leaf element draws inside itself stay that element's, as its children always were. Skim stopped taking each section's first paragraph in #5588; this change leaves the author's gists as they were. The detail package's developer page becomes the catalog example `incident-report`, with a latency chart in Impact that Skim keeps, and the catalog lists it as "Incident report · Skim, then read". The Extending page's Detail card opens it. The place journeys build the report without its chart, the geometry they were measured on: with the chart, the begun turn's reading line fell between two lines, and the image that grows after the glide no longer moved the place, since the browser anchored on the chart. `leaf-dev site previews` checked the panel placeholder's font on the placeholder element alone, whose words now stand in an inner span, so it refused every capture; it reads the fonts of the element and everything inside it. The author instructions and registry entries change only where they state what Skim shows; no scoring, as they correct a fact.
…tes them Review of the previous commit found four places Skim still took a block apart or misread a picture. The walk entered any element that held something Skim keeps, so an open `details` holding a figure lost its summary to a fold, and a paragraph whose words sit in an `em` beside an image had its words folded and a ⋯ put inside it. It now enters only HTML's sections and groups of blocks (`section`, `div`, a list and the like) with no words of their own, and keeps anything else whole. A picture inside any Leaf element counted as the element's own, so a figure in a tab or an `lf-motion` folded its section, heading and all. Now only a widget that draws its own content (`content` `data` or `empty`) owns its pictures; one holding the author's markup stays whole at Skim around a picture, as around a gist. What HTML marks as decoration (`aria-hidden`, an empty `alt`, a presentation role) is no picture, so an icon in a heading no longer keeps a gist-less section. The record of the disclosures Everything opened is the dial's own set again, read through a method rather than a module-level copy, and the walk takes the dial's document once per pass instead of per block.
…alog previews Entering only sections and groups left out a list item, a definition and a quote, so a gist in one kept the paragraphs beside it at Skim, where before they folded: a list of findings, each a gist and its support, showed the support too. The walk lays those out in place again, still keeping one with words of its own whole. The catalog previews are recaptured after the incident report's chart and duration changed.
…o widgets Laying out list items in place split one whose words sit in a link and an `em` beside an image: the image stayed and the words folded, with a ⋯ inside the item. The dial read a line of text only by its own loose words. It now reads one as an element with words of its own or a child that stands in a line of words other than a picture, the passage reader's `phrasing` rule (HTML's phrasing content, or a widget declaring `inline`), and lays out in place any other plain structure except a table or a disclosure. The list of sectioning tags the walk could enter goes. `phrasing` was private to passages.js; widget-api.js exports it so a package reads the passage reader's rule rather than a copy of the tag list, and module-reading.md says what it answers.
leaf-agent
left a comment
There was a problem hiding this comment.
Skim's new PICTURE list is a third definition of what Leaf counts as a picture, and it disagrees with the two already in the tree. The runtime has one: GENERIC_VISUALS = ["svg", "img", "figure"] plus every widget declaring visual, in browser/runtime/anchor-resolution.js (visualTags), which decides what a reader can comment on as a picture. The default theme's option layout has another: :is(figure, img, svg, table, video, [data-lf-visual]) in packages/default/styles/options.css. Root AGENTS.md, "Fix the underlying issue", asks for one owner when packages and the runtime share a concept, and this PR now has the dial export phrasing from the runtime for exactly this kind of reason.
The disagreement is visible. A <video> or <canvas> stays at Skim but isn't a picture you can comment on as one. An <img alt=""> or an aria-hidden drawing matches the comment-target list but not Skim's. A later change to either list leaves the other one behind. A cheaper end state would be for the runtime to own one picture rule, the tags plus HTML's decorative exclusions, exported through widget-api.js beside phrasing. The dial and anchor resolution would then both read it, and the dial would keep only its own scoping (closed details, widgets that draw their own content). Whether video, canvas and picture belong in that rule, and whether decoration should stop being a comment target, is your call. I'm not approving yet because this PR is the point where the third copy goes in.
Counting any inline child as the mark of a line made a section holding a gist beside a `script`, a block-level `button` or a link in its header a line, so Skim kept the whole section, support included. A line is now an element with words of its own, or one whose children all stand in a line of words, as an image beside a link and an `em` does; one block among its children makes it structure, and its stray inline children fold as blocks do. Leaf's chrome and scripts don't count either way.
Skim kept its own list of picture tags beside the runtime's, which decides what a reader can comment on as a picture (`visualTags` in anchor-resolution.js): Skim counted `video`, `canvas` and `picture`, and comments didn't. `widget-api.js` now exports `visualTags`, and the dial reads it once at setup, so a picture is `svg`, `img`, `figure` or a widget declaring `visual` in both. A video or canvas folds at Skim until the runtime's list takes them, which would make each one a comment target too. The dial keeps only its own scoping on top: HTML's decoration, closed disclosures and widgets that draw their own content. `options.css` keeps its own reading in CSS, which can't call the runtime, and counts a table as a picture for card layout.
# Conflicts: # browser/runtime/widget-api.js
A chart or image the author marked inside a `figure` lost its caption at Skim: the dial entered the figure, kept the marked picture and folded the `figcaption`, with its ⋯ between them. The tag list from #6543 had kept every figure whole, so the goal-oriented rule regressed this. A figure's caption labels all it holds, so the dial keeps a figure whole, as it does a table and a disclosure. A heading inside a closed `details` no longer makes the dial enter its section. `#holds` skipped a gist there but not a heading, so a section whose only gist sat under a heading in a closed disclosure stayed as an empty box holding a ⋯ rather than folding whole. The extending page's Detail card no longer says Skim keeps pictures, and the eval's picture rubric counts a picture as shown at Skim by the author's marks rather than claiming an unmarked picture never shows, which a gist sharing its tab, table or figure disproves. Found by a cold review of #6578.
…luded (#6578) The detail dial's Skim now shows the lede, each block the author marks `.gist`, of any kind, and the headings above them. #6543 kept every picture by a list of tags (`visualTags`: `svg`, `img`, `figure` and widgets that draw one), whether or not a skimmer needed it, so a video or a canvas folded unless marked and a picture that only illustrated stayed; the list had already grown exceptions for decoration and widget icons. This deletes the list and its exceptions. The detail package's author instructions and registry text now say a gist is whatever a reader needs to understand the page at a high level, often a picture, and that a picture showing the argument is a gist while one that only illustrates is not. A figure holding a gist stays whole at Skim, so a chart marked inside one keeps its caption. The incident report marks its latency chart. Max asked for this on the Skim decision page: "skim should be goal-orientated, it shouldn't have some list of stuff it has to keep. It should optimize cut what isn't needed to understand things at a high level. Very often we'll want to keep video & canvas etc!" To weigh: a picture the author doesn't mark now folds at Skim, so what Skim shows rests on the author's judgment. The postmortem eval `skim-carries-the-argument` now offers a decline chart a skimmer needs and a pool diagram she doesn't, and a new rubric checks that every picture of the failure shows at Skim and none of skipped material does. Against main on Claude Code (6 head and 5 base pages), every head author marked the decline chart, head's Skim folded every timeline widget, which main's tag list kept on 4 of 5 pages, and the two existing metrics didn't move. Authors also marked the diagram of the failing host and filled its caption with pool background, which Skim shows. A last instruction sentence, that a gist picture's caption says what the picture shows, took that from 3 of 5 gist captions to 0 of 5 in a second comparison of 6 pages each, and the folds-what-it-skips rubric from 3/6 to 5/6. Tests: `test_skim_keeps_what_the_author_marks_whatever_it_is` (`tests/browser/widgets/test_dial.py`) keeps a marked figure, chart, video, canvas and tab figure at Skim, keeps a figure's caption with a picture marked inside it, and folds unmarked pictures; it fails on main's dial. `pnpm run check:framework` passes. > _This was written by Claude Code on behalf of max-sixty_
The detail dial's Skim folded every block the author hadn't marked
.gist, so charts, diagrams and screenshots vanished from a quick pass, though a skimmer often reads a page by its pictures. Skim now keeps every picture with its caption, and a heading stands over a section whose only skim content is a picture. A picture is what Leaf already reads as one for comments (visualTags, now exported throughwidget-api.js):svg,img,figureor a widget declaringvisual. On top of that the dial skips HTML's decoration (aria-hidden,alt="") and pictures a widget draws as its own content (contentdata/empty). Skim stopped taking each section's first paragraph in #5588; gists are unchanged here.Worth a look: the walk now lays out in place only plain structure, and keeps whole a line of text (words of its own, or only inline children), a table, a
detailsand a Leaf element, so an open disclosure keeps its summary and a list item its link and caption. A line is read with the passage reader'sphrasingrule, whichwidget-api.jsalso exports;module-reading.mddocuments both exports. Nothing inside a closeddetailscounts, since Skim shows nothing Read doesn't.The detail package page becomes the catalog example
incident-report, with a latency chart, listed as "Incident report · Skim, then read"; the Extending page's Detail card opens it.leaf-dev site previewsrefused every capture since the panel placeholder's words moved into an inner span; it now reads the fonts of the element's descendants too. The place journeys build the report without its chart, the geometry they were measured on.Requested by max-sixty. Ran
test_dial.py,test_page_holds_still.py -k dial,test_product_page.py,pnpm run check:frameworkandleaf page checkon the example.