mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-12-05 11:15:01 +03:00
Each Page pane now marks its own active heading, as the Web 0.27.5 outline viewer does. The editor uses the layout and the scroll offset of its own viewport. It selects the last laid-out heading whose center is above the viewport center plus the heading height. A click on an outline entry keeps that entry active until the page scrolls again. A click on the title scrolls the page to the top. The rail shows only on pages with at least one heading. A page with a title lists the title first. Inactive ticks are 20 x 2 px in black-10. The active tick is 24 x 2 px in the primary text color. Ticks keep a 16 px pitch while they fit, then shrink to 2 px, and the rail clips the rest. Entries use weight 600, and the active entry uses the emphasis text color. When the panel opens, the list centers the active entry. While the panel stays open, only the wheel scrolls the list. Tests: cargo test, cargo clippy, cargo fmt, check-invariants.sh, check-l0-tier-a.mjs.