Repository navigation
Reader-only feature: the Constitution of Kenya now navigates itself. "Article N", "Chapter N", and list patterns like "Articles 152, 154, 155 and 156" become in-text buttons that jump to the referenced passage. When a reference names a specific sub-clause — "Article 142(2)" or "Article 136(2)(a)" — the destination flashes just that clause, not the whole article.
🔗 Clickable cross-references (#67)
- New
renderProse()helper detectsArticle|Articles|Chapter|Chapters N(subpara)?patterns. Unknown article/chapter numbers stay as plain text so JSON typos never ship a dead link. - Multi-number list parser: "Article 144 or 145" makes both numbers clickable; "Articles 152, 154, 155 and 156" makes all four. A continuation regex walks forward after the primary anchor eating
", N"," or N"," and N"separators. - Self-references (an article mentioning its own number in its own summary) are no-ops.
↩️ Back-to-caller pill
- When the reader follows a reference, a "↵ Back to Article X" pill appears in the viewer header. Clicking it rewinds one hop — the history stack supports multi-hop chains (229 → 251 → 30 → back → back → back).
- Sidebar/keyboard/prev-next navigation clears the stack; the pill is specifically for "I followed a reference" flow.
💡 Clause-scoped arrival flash
- On ref click with a clause path, the matching
(N)paragraph flashes a soft yellow (rgb(254, 249, 195)) and fades to transparent over ~2.4s. - Plain "Article 144" refs produce no body flash — the page switch itself is the feedback.
scrollIntoView({ block: 'nearest' })so short articles (Art. 136, 2 paragraphs) don't push the outer page down; the clause is scrolled only when it's actually below the fold.
🛠 Fixes inside this release
- Whole-article flash (initial attempt) was too broad — scoped down to the cited clause.
- Header-vs-body flash mix-up — highlight now sits on the article text, not the chapter chip.
- Translucent amber was being washed out by a
bg-white/70parent — switched to solid yellow-100. - tsc TS2802 on
[...matchAll(...)]— replaced with exec-loop to avoid togglingdownlevelIterationon the shared tsconfig.