Skip to content

Highlight the section you're reading in "On this page" as you scroll - #23

Merged
The1UNeed merged 1 commit into
mainfrom
t3/scrolling-page-toc
Nov 2, 2026
Merged

The1UNeed merged 1 commit into
mainfrom
t3/scrolling-page-toc

Conversation

@The1UNeed

@The1UNeed The1UNeed commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

The "On this page" list beside a lesson never showed where you were. Every entry looked the same however far you scrolled.

Now the section you're reading is highlighted, and the highlight moves as you scroll. It uses the same tint as the selected lesson in the left sidebar. A section becomes current once its heading passes just under the sticky header. At the bottom of the page the last section on screen is picked, so short closing sections like "Check yourself" still light up. The legal pages (terms, privacy, security) have the same list, so they get this too. Their headings also no longer hide under the header when you click a link there.

Proof: headless Chromium against next dev, scrolling to each heading and reading the highlighted link. On /lessons/languages-and-translators the highlight moved in order through all 6 entries (High-level… → Assembly language → Compilers… → IDEs → Key terms → Check yourself) and stayed on "Check yourself" at the bottom. On /privacy, the middle of the page highlighted "6. Cookies…" and the bottom highlighted "13. Changes". Web typecheck, eslint and vitest all pass (236 passed, 1 skipped).

Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved

Generated by claude-opus-5-5 using the Claude Code (T3 Code) harness.

🤖 Generated with Claude Code


Note

Low Risk
Client-only UX on public docs/legal pages; no auth, data, or API changes.

Overview
On this page sidebars now track scroll position: the entry for the section you're reading is highlighted and updates as you scroll, using the same --selected styling as the active lesson in the course nav.

A shared client TableOfContents component replaces the static anchor lists on lesson/docs articles (ContentArticle) and legal pages (LegalPage). It picks the current section when its top crosses a fixed line under the sticky header, throttles updates with requestAnimationFrame, and at the bottom of the page selects the last visible section so short blocks like Check yourself still get highlighted. Links set aria-current="location" when active.

Legal pages also get scroll-mt-24 on section anchors so in-page jumps don't hide headings under the sticky header (lesson sections already had this via DocSectionView).

Reviewed by Cursor Bugbot for commit 274255b. Bugbot is set up for automated code reviews on this repo. Configure here.

The lesson, docs, and legal page tables of contents now mark the section
the reader is on and follow along while scrolling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pseudoeditor.dev Error Error Nov 2, 2026 2:06am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T02:06:32.405026Z 274255b 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.

@cursor

cursor Bot commented Nov 2, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 7a3a3b39-612e-473c-8268-5c4456aee6f5)

@The1UNeed
The1UNeed merged commit 9da9b43 into main Nov 2, 2026
6 of 7 checks passed

This branch had an error being deployed

1 failed deployment
Preview — 274255b1 Deployed Nov 2, 2026 by vercel[bot]
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