From 274255b198789a01ab6d4c3a7390cfcb5b65fda6 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 2 Nov 2026 10:05:26 +0800 Subject: [PATCH] Highlight the current section in "On this page" as you scroll 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 --- apps/web/src/app/components/LegalPage.tsx | 11 ++-- .../src/app/components/TableOfContents.tsx | 52 +++++++++++++++++++ .../app/components/docs/ContentArticle.tsx | 18 +++---- apps/web/src/app/globals.css | 5 ++ 4 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 apps/web/src/app/components/TableOfContents.tsx diff --git a/apps/web/src/app/components/LegalPage.tsx b/apps/web/src/app/components/LegalPage.tsx index 8b24264..685022a 100644 --- a/apps/web/src/app/components/LegalPage.tsx +++ b/apps/web/src/app/components/LegalPage.tsx @@ -1,6 +1,7 @@ import Link from "next/link"; import type { ReactNode } from "react"; import { PublicHeader } from "@/app/components/PublicHeader"; +import { TableOfContents } from "@/app/components/TableOfContents"; import { formatDate, localePath, type Locale } from "@/i18n/config"; import { getDictionary } from "@/i18n/messages"; @@ -47,13 +48,7 @@ export function LegalPage({ locale, document, effectiveDate }: LegalPageProps) {