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

@ -6,7 +6,8 @@
record (GET /directory), scored by suggest.ts against the
address. So /organisation offers Organization, /retreat offers
Retreats, and an old /chapters/lynnwood offers the Lynnwood group.
Below them, the main pages to start from.
Below them, the main pages to start from, except in reading mode,
whose own line of page links (ReaderView) already gives them.
The server sends this same page with a 404 status for an unknown
address (routes/pages.js), so search engines drop it.
@ -23,6 +24,7 @@ import { useDirectory, type Directory } from '../lib/useContent.ts'
import { blogHref, eventHref, orgHref, personHref, teamHref, awardHref } from '../lib/hrefs.ts'
import { suggest, type Candidate } from '../lib/suggest.ts'
import { ACCENTS, BRAND } from '../lib/color.ts'
import { useReadingMode } from '../lib/readingMode.ts'
const ORG_KIND_LABEL: Record<string, string> = {
national: 'Organization',
@ -64,6 +66,7 @@ export default function NotFound() {
const { pathname } = useLocation()
const { data: directory, loading } = useDirectory()
const matches = useMemo(() => suggest(pathname, candidates(directory ?? null)), [pathname, directory])
const reading = useReadingMode()
return (
<PageShell
@ -103,13 +106,13 @@ export default function NotFound() {
</ul>
) : (
<p className="notice max-w-xl p-6 text-body">
Try one of the main pages below, or the menu at the top.
{reading ? 'Try one of the main pages at the top.' : 'Try one of the main pages below, or the menu at the top.'}
</p>
)}
</div>
),
},
{
...(reading ? [] : [{
id: 'start',
title: 'Start from',
accent: ACCENTS.green,
@ -126,7 +129,7 @@ export default function NotFound() {
))}
</div>
),
},
}]),
]}
/>
)