Skip to content

Group Guide TOC and sync URL hash on click#310

Open
PunchTheDev wants to merge 1 commit into
mainfrom
punch/guide-toc-grouped
Open

Group Guide TOC and sync URL hash on click#310
PunchTheDev wants to merge 1 commit into
mainfrom
punch/guide-toc-grouped

Conversation

@PunchTheDev
Copy link
Copy Markdown
Owner

Summary

Re-rubric pass on Guide TOC against the 3 pillars. Groups the flat 12-item nav into Concepts · Onboarding · Reference so a first-timer sees the onboarding arc at a glance, adds per-item hover previews, and fixes the silent deep-link bug.

Teardown

  • Beautiful: flat 12-item list, no grouping; first-timer can't tell which items form the Steps 1–5 arc vs concept primers vs deeper reference.
  • Seamless: clicks called preventDefault + scrollIntoView but never updated the URL hash → refresh/back-button/share-link all lost the position. Modifier keys (cmd/ctrl-click) couldn't open a section in a new tab.
  • Understandable instantly: hover gave no preview of what's in each section.

Changes

  • QuickstartGuide.tsx L271–425: replace TOC_ITEMS flat array with TOC_GROUPS (Concepts · Onboarding · Reference) → TocItem carries a preview string used as title= tooltip (113–134 chars each).
  • Click handler now history.replaceStates the URL hash so refresh + back-button + share-link all round-trip. Honors metaKey/ctrlKey/shiftKey/altKey so cmd/ctrl-click opens in a new tab via the browser default.
  • IntersectionObserver scroll-spy and indent flag for Step 3 sub-items preserved verbatim.

Verification

Puppeteer 1440×900 on /guide:

  • groupHeadings: ["Concepts","Onboarding","Reference"], itemCount: 12
  • Click on API reference → URL updates to /guide#api
  • Direct load /guide#rewards → scrollY=6000, scroll-spy marks How rewards work active
  • All 12 tooltips present (113–134 chars)
  • 0 new console errors (1 pre-existing 404 unchanged)

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