Repository navigation
feat(blog): reading progress outline with mobile table of contents - #69
Merged
Merged
Conversation
- Tree-style outline that highlights the current section as you scroll (rAF-throttled scroll math instead of the IntersectionObserver that got stuck when scrolling up or on short final sections) - Dithered progress bar with percentage and minutes-left countdown - Hairline progress bar on small screens where the outline is hidden - Smooth-scroll on click (respects reduced motion) and scroll-margin on headings so they no longer hide under the fixed header Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuN2c8JfmswopfnL9kDVWe
Replace the claude.dev-style monospace tree with a design built from this site's language: - Vertical rail in the brand cyan→blue→indigo gradient that fills as you read; a marker travels down it, easing between items in proportion to how far through each section you are - Gradient progress ring + percentage, "N min left" countdown, and a back-to-top link once you've started - Active item nudges in with the same spring curve as the header's social-links pill - Gradient progress bar under the header on small screens - Clicked item stays highlighted until the reader scrolls again (the page can't always bring late headings to the top) fix(headings): generate ids with github-slugger to match rehype-slug The hand-rolled slugify trimmed trailing hyphens and dropped non-ASCII letters, so TOC links to headings like "FIRE Lights Me 🔥" (rendered as #fire-lights-me-) pointed nowhere, and Thai headings would have produced empty ids. Duplicate headings now get -1/-2 suffixes like rehype-slug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuN2c8JfmswopfnL9kDVWe
Small screens previously only had a progress hairline; the outline itself was unreachable. Now a pill at the bottom shows the progress ring and the current section, and tapping it opens the full outline (same gradient rail) in a bottom sheet built on Radix Dialog. - Pill hides while scrolling down and returns on scroll up, at the end of the article, or right as reading starts so it's discoverable - Sheet rows are 40px tall for easy tapping; picking a section or "Back to top" closes the sheet first, then scrolls once the scroll lock is gone - Respects iOS safe-area insets and reduced motion Refactor: split the outline into shared pieces (outline.tsx, use-reading-state.ts) so the sidebar and sheet render the same thing. fix: the active item's nudge never animated. Tailwind v4's translate-x-* sets the CSS `translate` property, not `transform`, so the transition list now names `translate`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuN2c8JfmswopfnL9kDVWe
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the plain "On this page" list on local MDX posts with a reading-progress outline styled to match the site: the cyan → blue → indigo gradient from the
AYUTHwordmark, Maven Pro headings, and the same spring easing as the header's social-links pill.N min read, thenN min left, thenAll done 🎉, plus a back-to-top link.IntersectionObserver. The old observer only reacted when a heading entered view from below, so the highlight went stale when scrolling up, and a short final section could never become active.scroll-mt-24, so they no longer land under the fixed header.Bug fix: TOC links to emoji headings were broken
slugify()insrc/lib/headings.tstrimmed trailing hyphens and dropped non-ASCII characters, butrehype-slug(github-slugger) keeps both. So "FIRE Lights Me 🔥" rendered asid="fire-lights-me-"while the TOC linked to#fire-lights-me, and those links did nothing on the live site. A Thai heading would have lost every Thai character. Heading ids now come fromgithub-sluggerdirectly, including-1/-2suffixes for duplicate headings. The oldslugifytests asserted the mismatched behavior, so they are updated, and new tests cover emoji, Thai and duplicate headings.Notes
github-slugger@^2.0.0. It was already in the lockfile throughrehype-slug, so nothing new is downloaded.pnpm-lock.yamlmay conflict with chore(deps): bump next from 16.3.3 to 16.4.5 (ayuthmang/ayuthmang.dev#67), whichever merges second.outline.tsx(rail, list, ring, footer),use-reading-state.ts(scroll hooks),mobile-outline.tsx(pill + sheet), and pure position math intable-of-contents.utils.ts.Test plan
pnpm lint,tsc --noEmitandpnpm test --runpass: 141 tests, including new ones for progress, the reading line, section lookup, rail position and slug parity.pnpm buildpasses. Its warnings were already present onmain:fstracing inposts.ts, the Edge runtime notice, and Medium returning 429 in CI-like sandboxes.Generated by Claude Code