Skip to content

fix(outline): run the side outline to the bottom of the window and keep the current link in view - #452

Merged
vite-hub[bot] merged 2 commits into
mainfrom
fix/outline-rail-reaches-bottom
Nov 17, 2026
Merged

vite-hub[bot] merged 2 commits into
mainfrom
fix/outline-rail-reaches-bottom

Conversation

@onmax

@onmax onmax commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

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-rail caps itself at max-height: calc(100vh - 7rem) and scrolls as one box, and mark() sets aria-current without ever scrolling the list.

This PR:

  • runs the outline from its top to the bottom of the window (max-height: calc(100vh - var(--comark-rail-top)), not bottom: 0, so a short outline still ends after its last link and leaves the room below it clickable);
  • keeps the title in place and scrolls only the <ul>, with 1.5rem of padding at the end;
  • fades the list's bottom 3rem out while more links sit below. The script toggles data-more on the list on scroll and resize;
  • scrolls the list when the marked link leaves its view (24px from the top, 48px from the bottom), so the link lands a third of the way down. It scrolls smoothly, or instantly under reduced motion, and leaves the list alone while the pointer is over it. It measures with getBoundingClientRect, so it works inside a shadow root too;
  • adds --comark-rail-top (default 3.5rem) for a page with a fixed header. Before this you set top on .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-rail and 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.ts gets 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 on main. The hover test passes on main because the list never scrolls there, and fails here without the :hover check. 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-inset and data-drop-rail to these names. Drop comment #5.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T11:04:24.952506Z
We couldn’t complete this review. Comment @codex review to try again.
22ab0ff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@452

comark-badge

pnpm add https://pkg.pr.new/comark-badge@452

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@452

comark-cards

pnpm add https://pkg.pr.new/comark-cards@452

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@452

comark-cast

pnpm add https://pkg.pr.new/comark-cast@452

comark-charts

pnpm add https://pkg.pr.new/comark-charts@452

comark-chat

pnpm add https://pkg.pr.new/comark-chat@452

comark-chips

pnpm add https://pkg.pr.new/comark-chips@452

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@452

comark-code

pnpm add https://pkg.pr.new/comark-code@452

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@452

comark-colors

pnpm add https://pkg.pr.new/comark-colors@452

comark-comments

pnpm add https://pkg.pr.new/comark-comments@452

comark-critic

pnpm add https://pkg.pr.new/comark-critic@452

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@452

comark-details

pnpm add https://pkg.pr.new/comark-details@452

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@452

comark-diff

pnpm add https://pkg.pr.new/comark-diff@452

comark-embed

pnpm add https://pkg.pr.new/comark-embed@452

comark-fields

pnpm add https://pkg.pr.new/comark-fields@452

comark-figure

pnpm add https://pkg.pr.new/comark-figure@452

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@452

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@452

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@452

comark-github

pnpm add https://pkg.pr.new/comark-github@452

comark-icon

pnpm add https://pkg.pr.new/comark-icon@452

comark-include

pnpm add https://pkg.pr.new/comark-include@452

comark-keys

pnpm add https://pkg.pr.new/comark-keys@452

comark-links

pnpm add https://pkg.pr.new/comark-links@452

comark-linter

pnpm add https://pkg.pr.new/comark-linter@452

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@452

comark-mark

pnpm add https://pkg.pr.new/comark-mark@452

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@452

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@452

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@452

comark-media

pnpm add https://pkg.pr.new/comark-media@452

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@452

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@452

comark-outline

pnpm add https://pkg.pr.new/comark-outline@452

comark-properties

pnpm add https://pkg.pr.new/comark-properties@452

comark-qr

pnpm add https://pkg.pr.new/comark-qr@452

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@452

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@452

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@452

comark-sources

pnpm add https://pkg.pr.new/comark-sources@452

comark-steps

pnpm add https://pkg.pr.new/comark-steps@452

comark-table

pnpm add https://pkg.pr.new/comark-table@452

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@452

comark-tests

pnpm add https://pkg.pr.new/comark-tests@452

comark-time

pnpm add https://pkg.pr.new/comark-time@452

comark-ui

pnpm add https://pkg.pr.new/comark-ui@452

comark-xref

pnpm add https://pkg.pr.new/comark-xref@452

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@452

commit: ba11a94

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-top controls 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

Comment thread packages/outline/src/script.ts Resolved
Comment thread packages/outline/src/script.ts Resolved
Comment thread packages/outline/src/styles.ts Resolved
@vite-hub

vite-hub Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Waiting 2026-11-17T12:05:58.991Z 6m 27s
View session Last seen running 2026-11-17T11:38:57.927Z 0s
View session Cancelled 2026-11-17T11:32:40.735Z 3m 55s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

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.

1 participant