Reading mode: every page and section reads as text

The reader (ReaderView.tsx) now reads an icon-only link's label, puts
a card's link on its first line or picture when it has no heading,
gives each item of a row of facts or links its own line, keeps line
breaks, skips what CSS hides, turns a form into one line saying it
can't be used there, shows empty table cells as "-", keeps section and
heading ids so #links land, and opens file links as files.

What it can't read draws its own text version (useReadingMode()):
the hero, pathfinder, front page history, event lists (every event,
past ones too), org lists and groups map (every region and group,
linked), history timeline (every year open), schedules (every day,
fold-outs included), people tiles (everyone, with details) and videos.

Also: org names are linked headings, heading levels fixed where cards
repeated their section's, Team pages lose the doubled "Members",
Giving links the treasurer's email and names Church Center.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-10-03 17:12:27 -05:00
parent c79910ef8d
commit 27e5fbd690
24 changed files with 788 additions and 180 deletions

View file

@ -17,6 +17,9 @@
doesn't open it.
Nothing featured, and the section doesn't render at all.
Reading mode (readingMode.ts) gets the entries as text, oldest
first, each a linked heading with its date and words (ReadingRail).
═══════════════════════════════════════════════════════════════ */
import { ArrowRight, CaretRight, CaretLeft } from '@phosphor-icons/react';
@ -29,6 +32,7 @@ import { hrefFor, logoSrc } from '../../../lib/timelineRefs.ts'
import { MONTH_LABELS, type TimelineItem } from '../../../lib/timeline.ts'
import { accentText, BRAND } from '../../../lib/color.ts'
import { scrollBehavior } from '../../../lib/motion.ts';
import { useReadingMode } from '../../../lib/readingMode.ts'
const DRAG_SLOP = 6
@ -43,9 +47,29 @@ export default function FeaturedTimelineRail({ id, title, blurb }: RailProps) {
const railRef = useRef<HTMLOListElement>(null)
const drag = useRef({ x: 0, left: 0, moved: false, active: false })
const [dragging, setDragging] = useState(false)
const reading = useReadingMode()
if (!loading && !error && featured.length === 0) return null
if (reading) {
return (
<section id={id}>
<h2>{title}</h2>
{blurb && <p>{blurb}</p>}
{error ? (
<p>Couldn’t load the timeline. {error}</p>
) : loading ? (
<p>Loading the timeline…</p>
) : (
featured.map((item) => <ReadingEntry key={item.id} item={item} />)
)}
<p>
<Link to="/history">See the full history</Link>
</p>
</section>
)
}
const step = (direction: number) => {
const rail = railRef.current
const card = rail?.querySelector('li')
@ -182,6 +206,17 @@ function dateLabel(item: TimelineItem): string {
return y
}
function ReadingEntry({ item }: { item: TimelineItem }) {
const href = hrefFor(item)
return (
<>
<h3>{href ? <HomeLink url={href}>{item.title}</HomeLink> : item.title}</h3>
<p>{[dateLabel(item), item.meta].filter(Boolean).join(', ')}</p>
{item.blurb && <p>{item.blurb}</p>}
</>
)
}
function RailCard({ item, showYear }: { item: TimelineItem; showYear: boolean }) {
const href = hrefFor(item)
const logo = logoSrc(item)