Skip to content

Stand a sidebar page's contents outline open beside the body - #3932

Merged
max-sixty merged 6 commits into
mainfrom
sidebar-outline-open
Oct 25, 2026
Merged

max-sixty merged 6 commits into
mainfrom
sidebar-outline-open

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A sidebar page's aside is the room the page gives to navigation, and page-authoring.md ("Contents navigation") tells authors to put the contents outline there. The outline still drew as a folded disclosure, so pr-walkthrough at 1440×900 and 1024×768 showed "▸ ON THIS PAGE" alone at the top of an empty third of the window, beside an eleven-screen review, on every screen of it.

The fix

The Layout (layouts.css) now sets --lf-sidebar-slot: beside on a sidebar page's aside while it stands beside the body (data-lf-beside, which prepaint already writes). A column's margin sidebar already says --lf-sidebar-slot: margin the same way. lf-toc (toc.css) reads the token. Beside the body, it hides its toggle, shows its "On this page" label, and draws the section in view in ink rather than muted. With the summary hidden, lf-toc.js already opens the disclosure. When the track stacks above the body, the toggle comes back and the disclosure returns to the reader's own open or closed choice.

The widget reads only a token describing its box (browser/AGENTS.md, "A Layout, a style and a widget never read one another"), so a hand-written page can opt in with the same token.

The open outline's last link sits at the foot of the track's scrolling body, so its focus ring relies on the ring room #3939 gave that body; this change adds no rule of its own for it.

Evidence

leaf-dev stills origin/main --state walkthrough-wide --state walkthrough-body-short. walkthrough-wide is a new state: pr-walkthrough at the desktop viewport, two windows down. The base shows the folded toggle beside the body. The head shows the nine section links with "Change surface", the section in view, in ink. walkthrough-body-short (900×600) shows the same change.

Checks

  • New test_a_sidebar_page_track_beside_the_body_stands_its_outline_open: the outline is open with its summary hidden beside the body at 1440, and folded again at 700. It fails with the token removed.
  • test_each_sampled_focus_ring_is_shown_whole_in_its_surface passes, the open outline's last link included.
  • The sidebar track tests (test_a_sidebar_pages_track_stays_in_view_only_beside_the_body, test_a_revision_keeps_the_readers_place_in_a_sidebar_tracks_body, test_a_sidebar_pages_items_trim_their_words_at_both_edges, test_browser_and_file_captures_agree_on_a_sidebar_tracks_blocks), test_pr_walkthrough_navigation_starts_the_review_at_every_width, test_layout_style_and_widgets_never_read_each_other, test_page_fixture_renders for command-hub, live-progress, triage-board and pr-walkthrough, and pnpm run test:runtime pass on the merged tree.
  • The catalog stills are recaptured, so pr-walkthrough's first screen shows the open outline, and triage-board's track prose shows the rewrap from Run every tier on macOS nightly, and fix the tests main and macOS fail #3939's ring room, which main's earlier pin predated. The pin is the later of this branch's and Start an option's paragraph on its title's next line #3936's leaf-assets revisions, which holds both branches' stills. wt refresh-previews run again from this branch merged with main, Start an option's paragraph on its title's next line #3936 and Run every tier on macOS nightly, and fix the tests main and macOS fail #3939 included, reproduced every pinned still byte for byte, so the pin did not move.

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

A sidebar page's `aside` is the room the page gives to navigation, and `page-authoring.md` ("Contents navigation") tells authors to put the contents outline there. The outline still drew as a folded disclosure, so pr-walkthrough at 1440×900 and 1024×768 showed "▸ ON THIS PAGE" alone at the top of an empty third of the window, beside an eleven-screen review, on every screen of it.

## The fix

The Layout (`layouts.css`) now sets `--lf-sidebar-slot: beside` on a sidebar page's `aside` while it stands beside the body (`data-lf-beside`, which prepaint already writes). A column's margin sidebar already says `--lf-sidebar-slot: margin` the same way. `lf-toc` (`toc.css`) reads the token. Beside the body, it hides its toggle, shows its "On this page" label, and draws the section in view in ink rather than muted. With the summary hidden, `lf-toc.js` already opens the disclosure. When the track stacks above the body, the toggle comes back and the disclosure returns to the reader's own open or closed choice.

The widget reads only a token describing its box (`browser/AGENTS.md`, "A Layout, a style and a widget never read one another"), so a hand-written page can opt in with the same token.

## Evidence

`leaf-dev stills origin/main --state walkthrough-wide --state walkthrough-body-short`. `walkthrough-wide` is a new state: pr-walkthrough at the desktop viewport, two windows down. The base shows the folded toggle beside the body. The head shows the nine section links with "Change surface", the section in view, in ink. `walkthrough-body-short` (900×600) shows the same change.

## Checks

- New `test_a_sidebar_page_track_beside_the_body_stands_its_outline_open`: the outline is open with its summary hidden beside the body at 1440, and folded again at 700. It fails with the token removed.
- `test_pr_walkthrough_navigation_starts_the_review_at_every_width`, `test_page_fixture_renders[pr-walkthrough]`, `test_layout_style_and_widgets_never_read_each_other`, the rest of `test_render_toc_disclosure.py`, `pnpm run test:runtime`, and pre-commit on the changed files all pass.
- `wt refresh-previews` recaptured the catalog stills; pr-walkthrough's first screen now shows the outline. The "Keep a full-height workspace's panel room below its footer" PR also moves the `leaf-assets.json` pin, for alert-review's preview. Whichever of the two lands second takes the later `revision` and runs `wt refresh-previews` again from the merged tree (`dev/leaf_dev/leaf_assets.py`), since each publish carries the other's preview as main had it.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent
leaf-agent previously approved these changes Oct 25, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 25, 2026
max-sixty and others added 2 commits October 25, 2026 04:14
The track body sticks and scrolls (#3918), so it clips: the open outline's last link, and command-hub's and live-progress's summaries, lost the edge of their focus ring. It now keeps the ring's room inside its box, with its top margin giving the room back so its first line stays level with the body's.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 25, 2026
leaf-agent
leaf-agent previously approved these changes Oct 25, 2026
# Conflicts:
#	README.md
#	leaf-assets.json
@max-sixty
max-sixty merged commit 849b637 into main Oct 25, 2026
4 checks passed
@max-sixty
max-sixty deleted the sidebar-outline-open branch October 25, 2026 15:13
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