Accessibility: reading mode for every page, full color blind palettes (v1.12.1-accessibility) #26

Merged
ngu-git-admin merged 4 commits from accessibility into main 2026-10-04 04:30:55 +01:00
7 changed files with 20 additions and 52 deletions
Showing only changes of commit 502a294940 - Show all commits

View file

@ -166,7 +166,7 @@ also in `server/src/admin-schema/` and a CHECK):
| Entity → field | Stored values | Labeled? | Also used on the public site by | | Entity → field | Stored values | Labeled? | Also used on the public site by |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| Organizations → Kind (+ list filter) | national, region, group, partner | no, shows values | `ORG_BASE` in `src/lib/hrefs.ts` (the route each kind uses) and `orgListHref` there (its back link) | | Organizations → Kind (+ list filter) | national, region, group, partner | no, shows values | `ORG_BASE` in `src/lib/hrefs.ts` (the route each kind uses) |
| Organizations → Region → Scope | domestic, international, virtual | no | the Community page groups regions by it | | Organizations → Region → Scope | domestic, international, virtual | no | the Community page groups regions by it |
| Organizations → Region areas → Edge | top, bottom | no | the group map (`OrgList-Map.tsx`) | | Organizations → Region areas → Edge | top, bottom | no | the group map (`OrgList-Map.tsx`) |
| Events → Type (+ list filter) | retreat, class, workshop, meeting, other | no | `EVENT_TYPES` in `src/lib/eventTypes.ts` (public labels and plurals) | | Events → Type (+ list filter) | retreat, class, workshop, meeting, other | no | `EVENT_TYPES` in `src/lib/eventTypes.ts` (public labels and plurals) |
@ -283,7 +283,7 @@ The numbers band's "Number Source" dropdown works the same way:
| Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. | | Privacy Policy and Terms wording | `src/pages/Privacy.tsx`, `src/pages/Terms.tsx` | The `PARTS` list, and `LAST_UPDATED` whenever the wording changes. The Privacy page must stay true of the code: what the feedback form stores, what the browser keeps, which embeds wait for a click. |
| Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. | | Event type labels and plurals (public site) | `src/lib/eventTypes.ts` | Also the order of the type filter chips. |
| Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | | | Event and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | |
| Organization kind labels ("Region", "Group") | the Kind options in `src/lib/adminSchema/organizations.ts` (admin); `orgListHref` in `src/lib/hrefs.ts` (the public back link, "All regions") | | | Organization kind labels ("Region", "Group") | the Kind options in `src/lib/adminSchema/organizations.ts` (admin) | |
| Admin account roles | `src/lib/roles.ts` (labels, notes) and `ROLES` in `server/src/auth.js` | Adding a role is also a CHECK change on `admin_users.role`. | | Admin account roles | `src/lib/roles.ts` (labels, notes) and `ROLES` in `server/src/auth.js` | Adding a role is also a CHECK change on `admin_users.role`. |
| Admin navigation | `src/pages/admin/adminNav.ts` | | | Admin navigation | `src/pages/admin/adminNav.ts` | |
| Newsletter parts and their defaults (Tools → Newsletter) | `PARTS_SPEC`, `PART_TYPES` and `STARTER` in `src/pages/admin/AdminNewsletter.tsx`; `PICK_DEFAULTS`, `DEFAULT_TITLE` and `COLOR` in `src/lib/newsletter.ts` | A draft is one JSON list of parts (`newsletters.layout`, 060), so adding a part or a setting needs no migration: a field in `PARTS_SPEC` and its drawing in `newsletter.ts`. The color choices are `PALETTE`; `COLOR` holds the defaults as hex, since an inbox has no theme tokens. `STARTER` is what a new draft starts with. The social bar's icons are PNGs in `public/email/` (Gmail and Outlook don't show SVG), made from `PlatformIcon.tsx` by `node scripts/email-icons.mjs`: run it again after adding a platform. A social bar with no links shows the footer's, `SOCIAL_LINKS` in `src/data/socialLinks.ts`. The countdown picture is `server/src/routes/countdown.js`, counting to local midnight in its `TIME_ZONE` (America/Chicago). | | Newsletter parts and their defaults (Tools → Newsletter) | `PARTS_SPEC`, `PART_TYPES` and `STARTER` in `src/pages/admin/AdminNewsletter.tsx`; `PICK_DEFAULTS`, `DEFAULT_TITLE` and `COLOR` in `src/lib/newsletter.ts` | A draft is one JSON list of parts (`newsletters.layout`, 060), so adding a part or a setting needs no migration: a field in `PARTS_SPEC` and its drawing in `newsletter.ts`. The color choices are `PALETTE`; `COLOR` holds the defaults as hex, since an inbox has no theme tokens. `STARTER` is what a new draft starts with. The social bar's icons are PNGs in `public/email/` (Gmail and Outlook don't show SVG), made from `PlatformIcon.tsx` by `node scripts/email-icons.mjs`: run it again after adding a platform. A social bar with no links shows the footer's, `SOCIAL_LINKS` in `src/data/socialLinks.ts`. The countdown picture is `server/src/routes/countdown.js`, counting to local midnight in its `TIME_ZONE` (America/Chicago). |

View file

@ -68,11 +68,11 @@ function inline(node: Node): Inline[] {
if (!(node instanceof Element) || skipped(node) || node.tagName === 'IMG') return [] if (!(node instanceof Element) || skipped(node) || node.tagName === 'IMG') return []
if (node.tagName === 'BR') return [' '] if (node.tagName === 'BR') return [' ']
const children = [...node.childNodes].flatMap(inline) const children = [...node.childNodes].flatMap(inline)
if (node instanceof HTMLAnchorElement) { const href = node instanceof HTMLAnchorElement ? hrefOf(node) : null
const href = hrefOf(node) const parts: Inline[] = href ? [{ href, children }] : children
return href ? [{ href, children }] : children // A part the page draws on its own line (a span set to block, a
} // flex row's items) has no space in its text: give it one.
return children return getComputedStyle(node).display.startsWith('inline') ? parts : [' ', ...parts, ' ']
} }
const textOf = (parts: Inline[]): string => const textOf = (parts: Inline[]): string =>

View file

@ -305,7 +305,7 @@ iframe[src*="churchcenter"] {
} }
} }
.reader { .reader {
max-width: 42rem; max-width: 60rem;
margin-inline: auto; margin-inline: auto;
padding: 2.5rem 1rem 6rem; padding: 2.5rem 1rem 6rem;
line-height: 1.75; line-height: 1.75;
@ -315,6 +315,8 @@ iframe[src*="churchcenter"] {
} }
.reader :is(h1, h2, h3, h4, h5, h6) { .reader :is(h1, h2, h3, h4, h5, h6) {
margin-top: 2rem; margin-top: 2rem;
font-family: var(--font-display);
font-weight: 700;
line-height: 1.3; line-height: 1.3;
} }
.reader h1 { font-size: 2rem; } .reader h1 { font-size: 2rem; }

View file

@ -151,18 +151,3 @@ export function refHref(
return null return null
} }
} }
/* Where "back" goes from a record page. A group belongs to
/community, a retreat to /retreats. */
export function orgListHref(kind?: string | null): { to: string; label: string } {
switch (kind) {
case 'region':
return { to: '/community#regions', label: 'All regions' }
case 'group':
return { to: '/community#groups', label: 'All groups' }
case 'partner':
return { to: '/community#partners', label: 'All partner organizations' }
default:
return { to: '/community', label: 'Community' }
}
}

View file

@ -26,7 +26,7 @@ import {
useOrganization, useOrganization,
type OrganizationRecord, type OrganizationRecord,
} from '../lib/useContent.ts' } from '../lib/useContent.ts'
import { orgHref, orgListHref } from '../lib/hrefs.ts' import { orgHref } from '../lib/hrefs.ts'
import { mediaUrl } from '../lib/media.ts' import { mediaUrl } from '../lib/media.ts'
import { initialsFor } from '../lib/organizations.ts' import { initialsFor } from '../lib/organizations.ts'
import Logo from '../components/Logo.tsx' import Logo from '../components/Logo.tsx'
@ -70,7 +70,6 @@ export default function OrganizationDetail() {
} }
const accent = org.color || BRAND const accent = org.color || BRAND
const back = orgListHref(org.kind)
const sections: any[] = [ const sections: any[] = [
{ {
@ -79,7 +78,7 @@ export default function OrganizationDetail() {
accent, accent,
content: ( content: (
<div className="max-w-6xl mx-auto px-6 space-y-8"> <div className="max-w-6xl mx-auto px-6 space-y-8">
<Facts org={org} accent={accent} back={back} /> <Facts org={org} accent={accent} />
{org.description.map((paragraph, index) => ( {org.description.map((paragraph, index) => (
<p key={index} className="leading-relaxed max-w-3xl" style={{ color: BODY }}> <p key={index} className="leading-relaxed max-w-3xl" style={{ color: BODY }}>
@ -211,11 +210,9 @@ export default function OrganizationDetail() {
function Facts({ function Facts({
org, org,
accent, accent,
back,
}: { }: {
org: OrganizationRecord org: OrganizationRecord
accent: string accent: string
back: { to: string; label: string }
}) { }) {
const where = const where =
org.location_label || [org.locality, org.state_code].filter(Boolean).join(', ') org.location_label || [org.locality, org.state_code].filter(Boolean).join(', ')
@ -248,10 +245,6 @@ function Facts({
<span style={{ color: BODY }}>Since {org.details.started}</span> <span style={{ color: BODY }}>Since {org.details.started}</span>
)} )}
{org.is_online && <span style={{ color: BODY }}>Online</span>} {org.is_online && <span style={{ color: BODY }}>Online</span>}
<Link to={back.to} className="ml-auto hover:underline" style={{ color: accentText(accent) }}>
{back.label}
</Link>
</div> </div>
) )
} }

View file

@ -142,14 +142,6 @@ function Facts({
{orgName} {orgName}
</Link> </Link>
</span> </span>
<Link
to={orgHref(orgId, orgKind)}
className="ml-auto hover:underline"
style={{ color: accentText(accent) }}
>
Back to {orgName}
</Link>
</div> </div>
) )
} }

View file

@ -960,18 +960,14 @@ export default function OrgListMap({ view = "map", accent = FALLBACK_COLOR }) {
<div className="grid grid-cols-1 lg:grid-cols-[1.45fr_1fr] gap-10 items-stretch"> <div className="grid grid-cols-1 lg:grid-cols-[1.45fr_1fr] gap-10 items-stretch">
{/* Map */} {/* Map */}
<div className="min-w-0"> <div className="min-w-0">
{/* On a phone the map keeps a readable size (tiles big enough {/* Scales to the column's width at every size; on a phone the
to read and tap) and scrolls sideways in its own box. */} legend and the list below are the easier way in. */}
<div className="-mx-6 overflow-x-auto px-6 sm:mx-0 sm:px-0">
<div className="min-w-[34rem] sm:min-w-0">
<RegionMap <RegionMap
slices={slices} slices={slices}
groupCounts={groupCounts} groupCounts={groupCounts}
onPick={pickArea} onPick={pickArea}
{...shared} {...shared}
/> />
</div>
</div>
<Legend <Legend
domestic={domestic} domestic={domestic}
international={international} international={international}