Repository navigation
Remove the experimental indicate() widget API - #4115
Merged
Merged
Conversation
`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
marked this pull request as ready for review
October 27, 2026 05:26
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
previously approved these changes
Oct 27, 2026
Kernel rebuilt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
previously approved these changes
Oct 27, 2026
#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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
approved these changes
Oct 27, 2026
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.
indicate()(browser/runtime/indication.js, experimental since #1129) let one widget mark elements in another that it names throughx-refers. Its only caller wasexamples/rust-sort's film, which lit the Rust line each step executes in thelf-codeexcerpts 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 fromwidget-api.js, thedata-lf-indicatedpaint attribute inpage-paint.js, the default contour inmarks.css,lf-code's indicated-line face (code.cssand the generatedtheme.css), the dependency-cruiser entry, the "Indicating (experimental)" section ofmodule-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.indicatein thex-refersdescription inbrowser/registry.json, and in comments inreferences.js,stylesheets.js,floating-panel.css,annotation-marks.cssandlf-code.js.sort-code,head-codeandmerge-codeattributes and theirx-refers, thesort-stepevent that nothing listens to any more,sort.js'sLINEStable and the per-steplinenames it mapped. The collapse() clauses now match bykeyinstead of ac-line name.lf-codekeepslfElementsFor, whichnavigateToDatumreads throughaddressedElements.Tests kept
Some tests that went with
indicate()also held code that stays. They are kept:indication.test.mjs's tests ofreferencedProjection(message before page, never another message; a keyed reference in its own scope) move unchanged totests/runtime/references.test.mjs. Its undeclared-attribute test now callsrequireReferencedirectly.navigateToDatum(anchor-travel.js) and widget data inputs (data.js) both use these functions.lfElementsFor's rows through the removedpoint()driver. It now reads#walk.lfElementsFor(key)directly:1507-1550gives rows1507,1508-1549,1550;1520gives the elided row1508-1549;3gives 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 makingrequireReferencea no-op each fails one test inreferences.test.mjs. MakinglfElementsForreturn[]fails the excerpt test.Protocol bump: 29 → 30
layer-registry.md, "Page protocol", says whoever removes awidget-api.jsexport bumps the number, because a vendored module that imports it breaks. That happens here, so$events.protocolinbrowser/runtime/kernel-registry.jsonmoves to 30, one past the 29 that #3897 landed with. Main's rust-sort, served by this branch's runtime, fails to start:(
.tmp/base/examples/holds main'srust-sort.htmlandrust-sort.page/, fromgit 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
pnpm run check(runtime 673 pass);test_render_pages.py -k sortandtest_code_and_documents.py -k 'sort or excerpt or code_line'(4 pass)pnpm run test:runtime(560 pass),pnpm run check:browser(committed bundles match a fresh build)tests/browser/test_render_pages.pyandtests/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 excerptre-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 ranwt refresh-previews, which recaptured every catalog still from this tree after its last merge of main and moved theleaf-assets.jsonpin and the README's image URLs tomax-sixty/leaf-assets@6ad7cc888.Started from the survey's commit
a4fff17e0ongrind/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.