Skip to content

Remove the experimental indicate() widget API - #4115

Merged
max-sixty merged 8 commits into
mainfrom
grind/s-remove-indicate
Oct 27, 2026
Merged

max-sixty merged 8 commits into
mainfrom
grind/s-remove-indicate

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

indicate() (browser/runtime/indication.js, experimental since #1129) let one widget mark elements in another that it names through x-refers. Its only caller was examples/rust-sort's film, which lit the Rust line each step executes in the lf-code excerpts beside it, and an inline script on the page scrolled that line into view. This PR removes the API, as Max decided.

What users lose: rust-sort no longer lights or scrolls to the source line the current step executes. The film, its narration, inputs and commentable parts are unchanged.

What goes

  • indication.js, its export from widget-api.js, the data-lf-indicated paint attribute in page-paint.js, the default contour in marks.css, lf-code's indicated-line face (code.css and the generated theme.css), the dependency-cruiser entry, the "Indicating (experimental)" section of module-reading.md, and the tests of indication itself: its union and per-driver keys, re-resolution on layout, lf-code's indicated face, and rust-sort following the line.
  • Mentions of indicate in the x-refers description in browser/registry.json, and in comments in references.js, stylesheets.js, floating-panel.css, annotation-marks.css and lf-code.js.
  • In rust-sort: the follow-the-line script, the film's sort-code, head-code and merge-code attributes and their x-refers, the sort-step event that nothing listens to any more, sort.js's LINES table and the per-step line names it mapped. The collapse() clauses now match by key instead of a c- line name.

lf-code keeps lfElementsFor, which navigateToDatum reads through addressedElements.

Tests kept

Some tests that went with indicate() also held code that stays. They are kept:

  • indication.test.mjs's tests of referencedProjection (message before page, never another message; a keyed reference in its own scope) move unchanged to tests/runtime/references.test.mjs. Its undeclared-attribute test now calls requireReference directly. navigateToDatum (anchor-travel.js) and widget data inputs (data.js) both use these functions.
  • The lf-code excerpt test asserted lfElementsFor's rows through the removed point() driver. It now reads #walk.lfElementsFor(key) directly: 1507-1550 gives rows 1507, 1508-1549, 1550; 1520 gives the elided row 1508-1549; 3 gives none.

Bug-back, each change reverted after: making referencedProjection's keyed branch ignore scope, making its id lookup skip the referrer's own message, or making requireReference a no-op each fails one test in references.test.mjs. Making lfElementsFor return [] fails the excerpt test.

Protocol bump: 29 → 30

layer-registry.md, "Page protocol", says whoever removes a widget-api.js export bumps the number, because a vendored module that imports it breaks. That happens here, so $events.protocol in browser/runtime/kernel-registry.json moves to 30, one past the 29 that #3897 landed with. Main's rust-sort, served by this branch's runtime, fails to start:

uv run leaf-dev probe .tmp/base/examples/rust-sort.html --base \
  --do 'focus:#sort-film .sort-scrub' --do press:ArrowRight ... --js '<collect [data-lf-indicated] through shadow roots>'
base (main runtime):  indicated ["while start > 0 && compa…"]
worktree:             "leaf: page failed to start: The requested module '…/runtime/widget-api.js'
                       does not provide an export named 'indicate'"

(.tmp/base/examples/ holds main's rust-sort.html and rust-sort.page/, from git archive.) With the bump, an older page is re-vendored by the session holding it instead of failing to start. The new rust-sort on this branch starts with no console errors, and stepping the film works.

Tests run

  • On the merge with main: pnpm run check (runtime 673 pass); test_render_pages.py -k sort and test_code_and_documents.py -k 'sort or excerpt or code_line' (4 pass)
  • Earlier: pnpm run test:runtime (560 pass), pnpm run check:browser (committed bundles match a fresh build)
  • tests/browser/test_render_pages.py and tests/journeys/test_render_pages.py -k sort (4 pass)
  • tests/browser/widgets/test_code_and_documents.py -k 'excerpt or code_line' (2 pass; -k excerpt re-run after the review fixes)
  • tests/model/test_interact_product.py, test_product_page.py, test_interact_layer.py, test_claims.py, interact_contract/test_layer_contract.py, test_registry_door.py, test_data_contracts.py (447 pass)
  • tests/model/test_interact_document.py -k declared_attribute (1 pass)

Not run: the full suite. Rust-sort's first screen changes (on main, the film's first step lights while end > 0 { in the source pane), so the landing pass ran wt refresh-previews, which recaptured every catalog still from this tree after its last merge of main and moved the leaf-assets.json pin and the README's image URLs to max-sixty/leaf-assets@6ad7cc888.

Started from the survey's commit a4fff17e0 on grind/s-maintenance-survey, rebased onto current main with the kernel rebuilt. On top of it, this PR removes the rust-sort leftovers the survey kept (attributes, x-refers, sort-step, LINES), fixes the page's description and lede that still said the source "follows along", and bumps the protocol.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 25, 2026 13:28
`indicate()` (browser/runtime/indication.js, experimental since #1129) let
one widget mark elements in another that it names through `x-refers`. Its
only caller was examples/rust-sort's film, which lit the Rust line each
step executes in the lf-code excerpts beside it, and an inline script on
the page scrolled that line into view. Max decided to remove it.

What users lose: rust-sort no longer lights or scrolls to the source line
the current step executes. The film itself, its narration, inputs and
commentable parts are unchanged.

What goes:

- indication.js, its export from widget-api.js, the `data-lf-indicated`
  paint attribute in page-paint.js, the default contour in marks.css,
  lf-code's indicated-line face (code.css and the generated theme.css),
  the dependency-cruiser entry, the reference section in
  module-reading.md, and the tests that held them.
- In rust-sort: the follow-the-line script, the film's `sort-code`,
  `head-code` and `merge-code` attributes and their `x-refers`, the
  `sort-step` event nothing listens to any more, sort.js's `LINES` table
  and the per-step `line` names it mapped. The collapse() clauses now
  match by `key` rather than a `c-` line name.

lf-code keeps `lfElementsFor`, which `navigateToDatum` reads through
`addressedElements`.

The page protocol moves from 26 to 27. A page vendored earlier with a
widget that imports `indicate` fails to start under this runtime
(`layer-registry.md`, "Page protocol": removing a widget-api.js export
bumps the number). Probing main's rust-sort on this runtime shows it:

    uv run leaf-dev probe .tmp/base/examples/rust-sort.html --base ...
    base:     indicated line "while start > 0 && compa…"
    worktree: "leaf: page failed to start: … does not provide an
              export named 'indicate'"

Tests run: pnpm run test:runtime (557 pass), pnpm run check:browser;
tests/browser/test_render_pages.py and tests/journeys/test_render_pages.py
-k sort (4); test_code_and_documents.py -k 'excerpt or code_line' (2);
tests/model/test_interact_product.py, test_product_page.py,
test_interact_layer.py, test_claims.py and interact_contract's layer,
registry-door and data-contract tests (447).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Three of indication.test.mjs's tests held `referencedProjection` and
`requireReference`, which navigateToDatum and widget data inputs still
read. They move to tests/runtime/references.test.mjs; the undeclared
attribute test now calls `requireReference` directly. The lf-code excerpt
test asserted lfElementsFor's rows only through the removed point()
driver, so it now reads `#walk.lfElementsFor(key)` directly: a range
across a gap, a left-out number addressing the elided row, and a number
outside the block addressing nothing.

Bug-back: making referencedProjection's keyed branch ignore scope, its id
lookup skip the referrer's message, or requireReference a no-op each fails
one references test; making lfElementsFor return [] fails the excerpt
test. Before this, the first, third and fourth broke nothing in the
runtime suite or `-k excerpt`.

Also drops an orphaned test comment and lf-code's note about
layoutChanged, which only indicate() re-resolved on.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Main moved the page protocol to browser/runtime/kernel-registry.json at 28; this
change bumps it there to 30, after #3897's 29, and rebuilds the baseline from
main's. The x-refers description's mention of indicate is dropped where main now
keeps it. Kernel rebuilt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@max-sixty
max-sixty marked this pull request as ready for review October 27, 2026 05:26
leaf-agent
leaf-agent previously approved these changes Oct 27, 2026
wt refresh-previews recaptured every catalog still from this tree
(max-sixty/leaf-assets@3231f4423), since rust-sort's film no longer lights the
source line its first step executes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 27, 2026
Kernel rebuilt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 27, 2026
max-sixty and others added 2 commits October 27, 2026 00:09
#3897 took protocol 29, so this change bumps browser/runtime/kernel-registry.json
to 30 and rebuilds the baseline from main's. Kernel rebuilt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@max-sixty
max-sixty merged commit 7fe091c into main Oct 27, 2026
4 checks passed
@max-sixty
max-sixty deleted the grind/s-remove-indicate branch October 27, 2026 07:23
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