Skip to content

feat: URL hash deep-linking for title TOC chapters#98

Merged
williamzujkowski merged 1 commit intomainfrom
feat/92-toc-hash-keyboard
Mar 30, 2026
Merged

feat: URL hash deep-linking for title TOC chapters#98
williamzujkowski merged 1 commit intomainfrom
feat/92-toc-hash-keyboard

Conversation

@williamzujkowski
Copy link
Copy Markdown
Collaborator

Summary

Phase 4 of #92 — enables deep-linking to specific chapters in the expandable title TOC.

  • Each chapter <details> gets id="chapter-{N}"
  • Inline script auto-opens and smooth-scrolls to the matching chapter on page load
  • Listens for hashchange for in-page navigation
  • Example: /browse/title-18/#chapter-7 opens and scrolls to Chapter 7

Issues

Test plan

  • svelte-check — 0 errors
  • pnpm test — all pass
  • Manual: navigate to /browse/title-18/#chapter-7, verify auto-expand + scroll

🤖 Generated with Claude Code

- Add id="chapter-{N}" to each <details> element
- Inline script auto-opens and scrolls to chapter matching URL hash
- Supports #chapter-7, #chapter-95, etc.
- Listens for hashchange events for in-page navigation
- Enables deep-linking: /browse/title-18/#chapter-7 opens Chapter 7

Phase 4 of #92 (IA epic).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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