Skip to content

Port lf-dial to Effect UI and preserve Skim gaps - #7591

Merged
max-sixty merged 5 commits into
mainfrom
port-lf-dial
Nov 29, 2026
Merged

max-sixty merged 5 commits into
mainfrom
port-lf-dial

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Port lf-dial’s depth controls and preview sheets to Effect UI. A data-only Model makes depth changes, saving the choice in the tab, and preview transitions testable in Stories. One Command holds the reading place, applies the depth and starts motion.

Each gap records its identity on the folded blocks and the ⋯, so changing a nearby disclosure leaves the button opening the text it originally hid. Refolding changes only the folds and buttons that moved. The button uses offerAction in the authored flow because Effect UI has no portal into those sections. A single Mount owns preview declarations and the DOM index. The view handles clicks and preserves focus on sheet presses.

Checked the gap regression, focused dial cases, both Stories, the browser build, and base/head preview interactions in Chromium and Firefox. The interface census found zero changes. A 400-section turn measured 723 ms of CPU versus 1,302 ms in the previous run.

This was written by Codex on behalf of max-sixty

Draw the depth controls, preview sheets, and gap buttons from component
state. The dial sends authored folds, focus restoration, reading-place
holds, motion, and preview aims through Commands. Retire the widget API
export of holdPlace after migrating its last caller to a service.

The turn and preview lifecycles can now be tested as Stories without Web
Awesome or a served page. Each gap has a scoped mount so its button
stays in the reading order of the section it unfolds.
The dial's Model now describes the reader's depth, partial fold, estimates and
preview with data. A turn can be inspected in a Story without constructing a
page or passing a DOM handle or restore closure through an update. The Command
keeps the reading place, restores it and starts motion in one transaction.

Use the DOM's fold marks to find runs at the point of use. Put each gap's
button in its authored section with offerAction, since the renderer cannot
portal there. One Mount delegates gap activation and beforematch. Use the
existing presentation functions and leave the package interface unchanged.

The benchmark grows the sections governed by one dial, so a turn measures
the cost of folding the page as it grows.
leaf-agent
leaf-agent previously approved these changes Nov 29, 2026
A disclosure can stop holding a visible gist while Skim is active. Mark each
fold and its button with the same gap token, so a press or a fragment reveals
the original run even after the disclosure changes. Cover both routes in a
browser regression. Reconcile the marked folds and buttons so another Skim
press only rewrites the gaps it changes.

Put tab persistence in KeepInTab so a Story can see the saved choice. One
Mount owns preview declarations and the DOM index for its lifetime. Let the
view handle clicks and preserve focus during sheet presses, and give revision,
find and press their own messages.
@max-sixty max-sixty changed the title Port lf-dial to Effect UI and test its reading turns Port lf-dial to Effect UI and preserve Skim gaps Nov 29, 2026
leaf-agent
leaf-agent previously approved these changes Nov 29, 2026
Measure from init and from the page-interface subscription, so a Story
can see the startup read without a synthetic mount event. Keep the preview
index, declarations and authored-node marks in one Mount and apply changes
from its arguments.

Keep turns, gap opening and re-aiming as individual Commands to preserve
scroll and focus during these acts. Use Leaf's focus-preserving move when
placing a retained gap marker and let the tab service return its own noop.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the latest commit, the preview's gap marks go stale after a turn. Details are inline.

Comment on lines +885 to +887
targets.gaps = lastGap
? targets.gaps.filter((gap) => gap.isConnected)
: gapMarkers(host, scope);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs when the render commits, which happens before TurnPage places or removes the buttons. So after a turn into Skim, gapMarkers finds none. I opened DIAL_PAGE, clicked Skim, then pointed at Read: 0 of 7 .lf-dial-more got data-lf-dial-ghost="comes". After a reload, or on 6fabde9970 with the same steps, all 7 do. The gap-press branch has the same ordering, so its isConnected filter runs while the pressed button is still connected.

The old code read the gaps inside the Command that wrote them. Doing that again would fix both branches: one way is to mark targets.gaps stale here and re-query on the next pointing. The pointing test turns no depth before it points, so it doesn't cover this.

@max-sixty
max-sixty merged commit 2dbb497 into main Nov 29, 2026
7 checks passed
@max-sixty
max-sixty deleted the port-lf-dial branch November 29, 2026 06:23
max-sixty added a commit that referenced this pull request Nov 29, 2026
Read’s preview lost the outlines around Skim gaps because the Mount read
the marker list before the turn Command placed the buttons. The same
ordering left removed buttons in the list after opening a gap. The
Commands now report the applied depth and opened gaps after changing the
DOM, so the Mount refreshes its scoped index from the completed change.
Gap buttons still belong inside the authored sections they fold.

The new browser regression turns to Skim before pointing at Read. It saw
zero of seven outlines on main and seven with the fix. Focused dial
tests and both Stories cover the turn, gap, and persistence paths.

Reported in the [dial port
review](#7591 (review)).

> _This was written by Codex on behalf of max-sixty_
max-sixty pushed a commit that referenced this pull request Nov 29, 2026
#7602)

Tonight's nightly review of the last day's commits and a survey of
existing files turned up text that now describes code that has moved or
changed, plus two exports nothing imports. This PR corrects them.
Nothing it touches changes behavior. `pnpm run check` and pre-commit
pass on the branch.

- **README:** the Claude Code band line now lists how much waits on the
user with the first item's name, the agent's status and the unread
threads, with a `more` button for On Me. #7560 dropped the open-threads
count the README still described, and #7566 added the button.
- **`docs/website.html`:** #7582 runs the plugin's hooks in the hosted
Codex, so a message sent during a turn now reaches that turn, as the
header of `worker/leaf_website/__init__.py` says. The page still said it
waits for the turn to end.
- **`packages/detail/defaults.css`,
`browser/runtime/readings/user-place.ts`:** these now point at
`dial.js`. Since #7591, `dial.js` holds the dial's layout, motion and
`holdPlace`, and `lf-dial.js` only registers the widget.
- **`lf-toc`:** it no longer exports `Toc` and `TocMessage`. Their only
importer outside the module was the story test that #7542 deleted.
- **Eval headers and `notes/agent-usability-evals.md`:** `needs_browser`
is now cited at `source/browser_judged.py` (#7253), not
`render_gate/page_code.py`. authoring-evidence.md's chart line is now
named by its subject, since that line no longer names `lf-chart`.
- **Small cleanups:**
- `src/leaf/commands/hooks.py` had the same `TYPE_CHECKING` import twice
in a row; one is removed.
- The docstring of `tests/browser/test_render_drafts.py` now says what
its one test protects.
- The header of `render-checks/scrollbars.js` no longer carries a
timing, which belongs in a commit message.

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