Repository navigation
Revert drawing the contents map before the page upgrades - #4179
Merged
Merged
Conversation
This reverts #3931 (8143581), which laid out `lf-toc`'s margin map (its open disclosure, each row's share of the page and the fitted labels) in the initial drawing, before the module upgrades. The theme's pre-upgrade rule, `html[data-lf-interactive] body:not([data-lf-upgraded]) > main .lf-ui {visibility: hidden !important}`, hides every row and marker of that map until upgrade, so the early layout drew nothing a reader could see. The user chose to keep that rule and drop the early layout rather than narrow the rule (#3962): the map keeps appearing when the page's code loads. The layout moves back from `toc-view.js` into the module, the initial renderer again only draws the outline, and `.lf-ui`'s `box-sizing` reset returns from the render-blocking theme to `runtime/chrome.css`, where it stood before #3931 moved it for the early measurement. `test_the_reading_map_first_paints_its_spine_where_it_keeps_it` goes with the behavior it held. No later commit built on the reverted code. The conflicts were in `TODO.md`, whose item #3931 deleted now has no home since the backlog moved to issues and the user decided against it, and in the test file, where main had since changed the deleted test's teardown. Ran: `pnpm run build:browser` (no change to the committed bundles), `pnpm run check`, the `lf-toc` tests in `test_contents_and_glosses.py` in Chromium, and in Firefox through a temporary fixture override (the same three tests fail on the base under that override, none of them toc-specific), `test_render_initial_delivery.py`, `test_initial_drawings_keep_their_nodes_and_wrapped_geometry_on_upgrade`, `test_bundled_widgets_meet_the_widget_quality_checks`, `tests/model/test_interact_layer.py` and `test_a_coined_class_cannot_reach_the_chromes_rules`. A probe of `docs/extending.html` at 1440x900 with `--base`, in Chromium and Firefox, found the upgraded map's seven markers at the same positions on both arms, with pixel-identical stills; with `leaf.js` held, every row and marker computes `visibility: hidden` on both arms in both engines, and Chromium's held stills are pixel-identical. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
max-sixty
marked this pull request as ready for review
October 27, 2026 05:18
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.
Reverts #3931 (8143581), which laid out
lf-toc's margin map (its open disclosure, each row's share of the page and the fitted labels) in the initial drawing, before the module upgrades.Why. The theme's pre-upgrade rule,
html[data-lf-interactive] body:not([data-lf-upgraded]) > main .lf-ui {visibility: hidden !important}, hides every row and marker of that map until upgrade, so the early layout drew nothing a reader could see. The user chose to keep that rule and take the early layout out rather than narrow the rule (#3962): the map keeps appearing when the page's code loads.What it removes. 477 lines deleted and 200 added, net −277:
lf-toc-initial.jsbundle,shadow.css,runtime/chrome.css)posture,measure,fitLabels) moves back fromtoc-view.jsintowidgets/lf-toc.js, andinitial/lf-toc.jsagain only draws the outline..lf-ui'sbox-sizingreset returns from the render-blocking theme (components/surfaces.css) tostyles/chrome.css, where it stood before Draw the contents map's spine and markers in their first frame #3931 moved it for the early measurement.test_the_reading_map_first_paints_its_spine_where_it_keeps_itgoes with the behavior it held.No later commit built on the reverted code. Two files conflicted. In
TODO.md, #3931 had deleted the "Draw the contents map's spine in its first frame" item; the backlog has since moved to issues, and the user decided against the feature, so the item is not restored. In the test file, main had since changed the deleted test's teardown.Verified.
pnpm run build:browserleaves the committed bundles unchanged, andpnpm run checkpasses.lf-toctests intest_contents_and_glosses.pypass in Chromium. In Firefox, through a temporary fixture override, the same three tests fail on this branch and on the base, and none of them is about the map.test_render_initial_delivery.py,test_initial_drawings_keep_their_nodes_and_wrapped_geometry_on_upgrade,test_bundled_widgets_meet_the_widget_quality_checks,tests/model/test_interact_layer.pyandtest_a_coined_class_cannot_reach_the_chromes_rulespass.leaf-dev probe docs/extending.html --baseat 1440x900, in Chromium and Firefox. After upgrade, the map's seven markers stand at the same positions on both arms, and the viewport stills are pixel-identical. Withleaf.jsheld, every row and marker computesvisibility: hiddenon both arms in both engines, and Chromium's held stills are pixel-identical. The one difference is invisible: on this branch the held map's disclosure is closed and its hidden markers are evenly spaced.