Repository navigation
fix(outline): run the side outline to the bottom of the window and keep the current link in view - #452
Conversation
…ep the current link in view
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
Important
The new follow and fade behavior can leave the current link offscreen or obscure a keyboard-focused link. These visibility issues should be addressed before merging.
Reviewed changes across the outline runtime, styles, browser tests, documentation, and skill reference; the workspace build, 18 outline unit tests, and all 14 rail tests in both Chromium and Firefox passed.
- Viewport-height rail: A configurable
--comark-rail-topcontrols the rail's top and maximum height, while short outlines remain content-height. - Scrollable list and fade: Only the links scroll beneath the title, with end padding and a bottom mask controlled by
data-more. - Current-link following: The runtime scrolls newly marked links into view, respects reduced motion and pointer hover, and catches up when a hidden rail reappears.
- Tests and public contracts: Six browser tests and the documentation describe the height variable, list scrolling, fade hooks, and following behavior.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Ready: verified the expected HEAD and existing fixes for smooth-scroll reversal, layout changes, and keyboard focus visibility. All supplied review threads are resolved, and current-head CI and Pullfrog checks pass. No repair was needed. Local tests and lint could not start because pnpm could not open its SQLite database; validation relies on passing hosted CI. |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes in ba11a94 since the previous Pullfrog review at 22ab0ff, focusing on visibility fixes and their regression coverage.
- Cancelled stale follows: Stopped an earlier smooth scroll before checking whether the newly current link is visible.
- Revalidated layout changes: Reset the follow cache during placement so viewport and header-offset changes reconsider the current link.
- Preserved keyboard visibility: Disabled the bottom fade while a link has keyboard-visible focus.
- Added regression coverage: Verified all three fixes; all 17 rail tests passed in both Chromium and Firefox, all 18 outline unit tests passed, and the workspace build completed successfully.
gpt-6.1-sol(xhigh) | 𝕏

On a document with more headings than fit in the window, the side outline stops 3.5rem above the bottom of the window, cut off mid-link, and the link to the section being read scrolls out of view. In a 72-heading doc at 1743×1034, only the first 35 links ever show, so for the second half of the page the marked link is off-screen. At the end of the page, "Results of leg 24" sits about 950px below the outline's bottom edge.
.cto-railcaps itself atmax-height: calc(100vh - 7rem)and scrolls as one box, andmark()setsaria-currentwithout ever scrolling the list.This PR:
max-height: calc(100vh - var(--comark-rail-top)), notbottom: 0, so a short outline still ends after its last link and leaves the room below it clickable);<ul>, with 1.5rem of padding at the end;data-moreon the list on scroll and resize;getBoundingClientRect, so it works inside a shadow root too;--comark-rail-top(default3.5rem) for a page with a fixed header. Before this you settopon.cto-rail, and the height didn't follow it.The rule that marks the last heading once the page is scrolled to the end stays.
--comark-inset-end,data-comark-railand the options don't change.Before/after at 1743×1034, Chromium and Firefox: https://drop.vitehub.dev/d/fbjh9xsp7t2t/comark-outline-rail-bottom
e2e/rail.e2e.tsgets six tests: the outline reaches the bottom, a short one doesn't, the fade, the follow scroll, hover, and--comark-rail-top. Four of them fail onmain. The hover test passes onmainbecause the list never scrolls there, and fails here without the:hovercheck. I ran them in Chromium. In Firefox I only checked the screenshots and the measured positions, not the test file.Drop will use this outline in place of its own copy next, mapping
--drop-insetanddata-drop-railto these names. Drop comment #5.