Skip to content

Build a sticky in-page TOC for ApiDetailPage sections (Overview, Endpoints, Pricing, Reviews) #147

Description

@greatest0fallt1me

Description

This is a UI/UX issue. ApiDetailPage.tsx is over 1,000 lines tall and users currently lose orientation when scrolling through Overview, Endpoints, Pricing, and Reviews. Add a sticky right-rail table of contents that highlights the active section via IntersectionObserver and supports keyboard jump-to.

Requirements and Context

  • Reference: src/pages/ApiDetailPage.tsx
  • The TOC must collapse into a <details> summary at <1024px so it does not steal width from content
  • Active item must be styled via tokens and announced with aria-current="location"
  • Smooth scroll must respect prefers-reduced-motion
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/api-detail-toc
  2. Implement changes
    • src/components/InPageToc.tsx — new component, accepts sections: { id, label }[]
    • src/pages/ApiDetailPage.tsx — render <InPageToc /> and add id anchors to each section heading
    • src/index.css.toc, .toc__item--active styles using --accent and --text-muted
  3. Test and commit
    • Manually verify section highlights track scroll position
    • Tab through TOC and confirm focus styles + Enter activation
    • npm test to run existing tests

Example commit message

feat: add sticky in-page TOC to ApiDetailPage

Acceptance Criteria

  • TOC items reflect active section as user scrolls
  • Keyboard users can Tab to TOC and Enter to jump
  • At <1024px the TOC collapses behind a disclosure
  • Smooth-scroll falls back to instant under reduced-motion

Guidelines

  • IntersectionObserver thresholds should not flicker between adjacent sections
  • No layout shift on scroll — reserve space for the TOC rail
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programaccessibilityWCAG 2.1 AA accessibilitydesignVisual/design-system workenhancementNew feature or improvementui/uxUI/UX design, usability, and visual polish
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions