From 29a997ef5cc7428308f9ed13fa8ffc1b6ee7d276 Mon Sep 17 00:00:00 2001 From: Bissbert <43237892+Bissbert@users.noreply.github.com> Date: Thu, 16 Jul 2026 16:30:02 +0200 Subject: [PATCH] fix(learn): sticky TOC, 18px body measure, unified fact lists, citation landing feedback - in-page table of contents for long articles (sticky desktop rail w/ IntersectionObserver scroll-spy + mobile collapsible details, >=4-section gate) fed by a shared section-id helper so anchors always match - body text now renders at the intended 18px / ~70ch measure (propagated prose-lg into SectionRenderer's nested prose scopes; tables unaffected) - PropertyList converged to a semantic single-column dl/dt/dd (unifies the three name/value fact grammars, better screen-reader semantics) - citation superscripts get an explicit light-mode crystal color + a :target landing flash on the referenced bibliography row (light/dark tints, reduced-motion fallback) - fixes: hub "Start here" 5th card (slug pointed at a bare directory, now .../overview), 390px filter placeholder clipping, DataTable mobile overflow fade hint - docs/authoring-learn.md documents when to use items:/table:/prose 502 tests, browser-verified in both themes. --- docs/authoring-learn.md | 74 ++++++++++ src/components/learn/PropertyList.astro | 147 +++++++++++-------- src/components/learn/References.astro | 48 +++++++ src/components/learn/SectionRenderer.astro | 95 ++++++++++-- src/components/learn/TableOfContents.astro | 160 +++++++++++++++++++++ src/components/learn/index.ts | 1 + src/lib/learn/section-id.test.ts | 20 +++ src/lib/learn/section-id.ts | 22 +++ src/pages/learn/[...slug].astro | 17 ++- src/pages/learn/index.astro | 7 +- 10 files changed, 512 insertions(+), 79 deletions(-) create mode 100644 docs/authoring-learn.md create mode 100644 src/components/learn/TableOfContents.astro create mode 100644 src/lib/learn/section-id.test.ts create mode 100644 src/lib/learn/section-id.ts diff --git a/docs/authoring-learn.md b/docs/authoring-learn.md new file mode 100644 index 0000000..7c709ea --- /dev/null +++ b/docs/authoring-learn.md @@ -0,0 +1,74 @@ +# Authoring Learn Content — Fact-Grammar Convention + +> **Diataxis type:** How-to — a short authoring convention for anyone writing or +> editing `src/content/learn/**/*.yaml`. +> +> **Audience:** contributors editing learn article YAML. Assumes familiarity +> with the section/subsection shape documented inline in +> `src/content/config.ts` (`sectionSchema`, `subsectionSchema`, `itemSchema`, +> `tableSchema`). + +## Why this doc exists + +A learn section can present a set of name/value facts three different ways: + +1. `items:` — rendered as a definition list by `PropertyList.astro`. +2. `table:` — rendered as a real `