Skip to content

Pass a contents map resting as its spine through the render gate - #3109

Merged
max-sixty merged 1 commit into
mainfrom
agent-af32619bb3e821f90
Oct 17, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-af32619bb3e821f90

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A contents map written exactly as page-authoring.md's "Contents navigation" shows failed page check --render at 1200px and 816px:

tiny-boxes: widgets rendered with no usable size: [{"tag": "lf-toc", "id": "contents", "w": 24, "h": 824}]

In a wide window's margin the map rests as a 24px spine whose labels reveal over the page (toc.css, by design). tinyBoxes held every widget not declared x-inline to a 40px width floor, the floor for a widget that reserves a region, so every page with a margin contents map failed the gate.

An overlay at rest, fixed and taking no presses, is now held to the height floor alone. That predicate already decided twice in misplacedBoxes that the map's resting box is not the room it shows in; it now has one home (restsOverPage in render-checks/layout.js) that both checks read. A map pushed into the flow at the spine's width is still reported, since it loses the posture that exempts it. The tinyBoxes header, which had drifted above clippedControls, moves back beside its function.

test_the_gate_passes_a_contents_map_resting_as_its_spine asserts the resting map passes and the same map in the flow fails; it fails without the exemption.

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

A contents map written as page-authoring.md's "Contents navigation" shows
failed `page check --render` at 1200px and 816px with `tiny-boxes`. In a
wide window's margin the map rests as a 24px spine whose labels reveal
over the page, and `tinyBoxes` held every widget not declared inline to a
40px width floor, the floor for a widget that reserves a region.

An overlay at rest, fixed and taking no presses, is now held to the height
floor alone. That predicate (`restsOverPage`) already decided twice in
`misplacedBoxes` that the map's resting box is not the room it shows in;
it now has one home in layout.js, which both checks read. A map pushed
into the flow at the spine's width is still reported, since it loses the
posture that exempts it.

The tinyBoxes header had drifted above clippedControls; it moves back
beside its function.

`test_the_gate_passes_a_contents_map_resting_as_its_spine` asserts the
resting map passes and the same map in the flow fails; it fails without
the exemption.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 4a656ca into main Oct 17, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-af32619bb3e821f90 branch October 17, 2026 06:28
leaf-agent added a commit that referenced this pull request Nov 7, 2026
In margin form the contents map was a fixed 24px spine that revealed its labels over
the body on hover, focus or the go-to sequence. Drawing outside the box its Layout
gave it took a patch on each side: the sidebar Layout stacked its aside over the
body and isolated the body (#5117), toc.css pushed the next block in the track
clear of the spine (#5309, reworked in #5363 and #5370), the render gate exempted a
"resting overlay" from its width floor (#3109), and the sidebar's reserved width
stood blank beside the spine (#5619).

The map is now an ordinary block in its track, with its labels always shown at the
track's width. It keeps the proportional rows, the markers and the lens, and sticks
with the track. Its height fits the stuck track at the document's end, so the map's
start never leaves the window.

Removed: the aside z-index and body isolation in layouts.css, the reveal machinery
in toc.css (hover/focus/go-to widening, the press strip, pointer-events toggling,
the label fade, the `lf-toc + :not(.lf-ui)` clearance rule), and `restsOverPage` in
the render checks.

Behavior changes the tests now hold:
- The map no longer rests as a bare spine; its labels always show, and a press on a
  label follows it directly.
- A block after the map in the track follows it below and is reached by scrolling
  the track (was: beside the map at the track's top, clear of the spine).
- Long labels wrap at the track's width (was ~320px), so close sections pack one
  label apart sooner.
- Once its sidebar ends, the map scrolls away with it, as any sticky block does.

Tests: reveal and overlay assertions rewritten to the in-track map; the overlay
stacking test, the resting-spine render-gate test and the contents-over-reading
state are deleted; contents-spine-keyboard is renamed contents-map-keyboard.

Closes #5619

Co-Authored-By: Claude <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
The contents map in a document sidebar is now an ordinary block in its
track, with its labels always shown, instead of a fixed 24px spine that
revealed labels over the body on hover. That deletes the overlay and the
patches each side carried for it, and the sidebar's reserved width now
holds the labels instead of standing blank (#5619). Approved direction:
[#5619
(comment)](#5619 (comment)).

**Before** (`contents-map-keyboard`, 1440×900, focus on a map link): the
labels lie over the first words of the prose.


![Before](https://github.com/user-attachments/assets/6f8dfbe7-3976-42e1-892e-35afa111b033)

**After**: the same map in its own track. Nothing covers the prose, and
the column starts where it did.


![After](https://github.com/user-attachments/assets/1539b02b-af76-4a06-8a51-842ff6dac939)

**Removed**
- `layouts.css`: the aside's `z-index` and the body's `isolation`, which
existed only so the revealed labels covered the body (#5117).
- `toc.css`: the reveal machinery (`:hover` / `[data-lf-focus-within]` /
go-to widening, the press strip on the spine, `pointer-events` toggling,
the label fade) and the `lf-toc + :not(.lf-ui)` clearance rule with its
restyle-cost notes (#5309, #5363, #5370).
- Render checks: `restsOverPage`, the resting-overlay exemption from the
width floor and from the margin readings (#3109).

**What users see change**
- No quiet resting state: the labels always show, and pressing a label
follows it directly.
- The map's height fits the stuck track at the document's end, so its
start stays in the window (about 700px at a 900px window, was 828). Once
its sidebar ends, the map scrolls away with it, as any sticky block
does.
- A block after the map in the track now follows it below, where
scrolling the track reaches it. Before, it stood at the track's top
beside the spine. `page-layout.md` and `page-authoring.md` now say this
and suggest putting a status the reader should see at once at the top of
the body. No example or `docs/` page puts anything after the map.
- Labels wrap at the track's width (~210px, was ~320px), so close
sections pack together one label apart sooner.

`--lf-sidebar-slot` stays. It still tells the map (margin) apart from
the open outline (beside); merging the two is a separate call.

**Verification**: I ran these locally and they pass: the rewritten
journey
`test_a_margin_table_of_contents_maps_the_document_in_its_track`,
`tests/browser/test_render_toc_disclosure.py`, the contents tests in
`test_contents_and_glosses.py`, the go-to hints test, and the render
gate on `sidebar-contents`. The npm-based gates (`pnpm run check`,
prettier, eslint) have no `node_modules` in this sandbox, so they're
left to CI.

<details><summary>Test changes</summary>

- Rewritten to the in-track map: the margin-map journey (the reveal,
hover and spine-width steps are gone; it now checks the map stays clear
of the body, stays put while its track is stuck, and stays clear of the
panel's room), the history, hidden-sidebar and crowded-map tests, the
"map only beside the body" test, and the go-to hints test.
- The status-line test now asserts the status follows the map and a
press on it reaches it.
- Deleted, since their subject is gone:
`test_the_revealed_margin_map_covers_every_box_the_body_paints` and
`test_the_gate_passes_a_contents_map_resting_as_its_spine`.
- Stills: `contents-over-reading` is deleted, and
`contents-spine-keyboard` is renamed `contents-map-keyboard`.

</details>

Closes #5619

---------

Co-authored-by: leaf-agent <[email protected]>
Co-authored-by: Claude <[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