Skip to content

Conversation

@vinnymac
Copy link
Contributor

Adds an outline to the readme so that users can bounce around more easily. Similar to the Github ToC.

image

Closes #542

@vercel
Copy link

vercel bot commented Jan 31, 2026

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Error Error Feb 1, 2026 0:29am
npmx.dev Ready Ready Preview, Comment Feb 1, 2026 0:29am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Feb 1, 2026 0:29am

Request Review

"no_readme": "No README available.",
"view_on_github": "View on GitHub"
"view_on_github": "View on GitHub",
"toc_title": "Outline"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would we like me to add the other langs and try my best, or leave that for others to do?

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO out of scope of this PR

@vercel vercel bot temporarily deployed to Preview – docs.npmx.dev January 31, 2026 22:59 Inactive
@github-actions
Copy link

github-actions bot commented Jan 31, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
lunaria/files/en-US.json Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Comment on lines +24 to +28
// Use scrollTo for precise control
window.scrollTo({
top: targetScrollY,
behavior: 'smooth',
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried a few scrolling implementations here, I found this was the most reliable. Some other ones occasionally were scrolling up every once in a while in Safari, but not in Firefox/Chrome 🤔

Copy link
Contributor

@wojtekmaj wojtekmaj left a comment

Choose a reason for hiding this comment

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

Tested, works!

How does it feel to be a 10x developer, Sir?

let rafId: number | null = null
const STABLE_THRESHOLD = 5 // Number of frames with no movement to consider settled

const checkScrollSettled = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@vinnymac vinnymac Jan 31, 2026

Choose a reason for hiding this comment

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

I tried scrollend in my second attempt actually, and it still had the Safari issue. I might revisit this though.

EDIT: must've been something else I fixed, added this back

"no_readme": "No README available.",
"view_on_github": "View on GitHub"
"view_on_github": "View on GitHub",
"toc_title": "Outline"
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO out of scope of this PR

@thasmo
Copy link
Contributor

thasmo commented Jan 31, 2026

Some thoughts.

Very nice, we need this! :D

If there's only a single item, would we maybe hide or disable the button?
image

IMO the TOC in the sidebar is not needed and/or is kinda misplaced, if I may say so. 😅

@vinnymac
Copy link
Contributor Author

vinnymac commented Feb 1, 2026

IMO the TOC in the sidebar is not needed and/or is kinda misplaced, if I may say so. 😅

Good catch, this was from my first attempt, accident

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.

Readme ToC

3 participants