Skip to content

feat: Chapter pages show full statute text inline with collapsible TOC#100

Merged
williamzujkowski merged 1 commit intomainfrom
feat/99-chapter-full-text
Mar 30, 2026
Merged

feat: Chapter pages show full statute text inline with collapsible TOC#100
williamzujkowski merged 1 commit intomainfrom
feat/99-chapter-full-text

Conversation

@williamzujkowski
Copy link
Copy Markdown
Collaborator

Summary

Transforms chapter browse pages from section lists into full readable documents — the biggest UX improvement in this session.

Before: Chapter page shows section numbers and titles as links. Must click each to read.
After: Full statute text rendered inline. Read an entire chapter in flow. Click section heading or "History & diffs" link for the deep-dive view.

Features

  • All section content rendered at build time via Astro render()
  • Collapsible TOC at top (collapsed by default) with anchor links to each section
  • Section headings link to dedicated /statute/{slug}/ detail page
  • "History & diffs →" button for each section
  • Status badges inline (Repealed, Reserved, etc.)
  • Inactive sections dimmed
  • Teal top-border separates sections visually
  • scroll-mt-4 for smooth anchor navigation from TOC
  • Back to title TOC link at bottom

Why this matters

This makes us more usable than uscode.house.gov — users can read full chapters in one page instead of clicking through every section individually. The dedicated section pages remain for version tracking, diffs, and precedent annotations.

Navigation flow (updated)

  1. /browse/ → pick a title
  2. /browse/title-18/ → expandable TOC, pick a chapter or section
  3. /browse/title-18/chapter-7/read full chapter text, click for details
  4. /statute/{slug}/ → diffs, version history, precedents

Issues

Test plan

  • svelte-check — 0 errors
  • pnpm test — all pass
  • Visual: verify full text renders on chapter page
  • Visual: verify TOC anchor links work
  • Visual: verify "History & diffs" links work
  • Performance: verify large chapters render without issues

🤖 Generated with Claude Code

Transform chapter pages from section lists into full readable documents:

- All section content rendered inline at build time via Astro render()
- Collapsible TOC at top (collapsed by default) with anchor links
- Section headings link to dedicated detail page (/statute/{slug}/)
- "History & diffs →" link for each section's version tracking
- Status badges (Repealed, Reserved, etc.) shown inline
- Inactive sections dimmed (opacity-60)
- Teal top-border separates each section visually
- Active/inactive section counts in header
- Back to title TOC link at bottom
- scroll-mt-4 on sections for smooth anchor navigation

Users can now read an entire chapter in flow without clicking into
each section individually. The dedicated section pages become the
"deep dive" view with diffs, precedents, and version history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@williamzujkowski williamzujkowski merged commit 9162c59 into main Mar 30, 2026
@williamzujkowski williamzujkowski deleted the feat/99-chapter-full-text branch March 30, 2026 02:08
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.

feat: Chapter pages show full statute text inline with collapsible TOC

1 participant