From 2ad65cdc152670117e682640ea9f7e69d761a395 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Wed, 30 Sep 2026 13:23:56 -0500 Subject: [PATCH] Write the site in US English color, center, canceled, labeled, recognize and the rest, in UI text, help text, comments, docs and names (ColorInput, QrCenter). Migration 053 renames the two Site settings color CHECKs, whose names are the messages the admin shows. Kept: events.status's stored value 'cancelled' (shown as canceled), aria-labelledby, schema.org's EventCancelled, and old migrations as they ran. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 4 +- docs/importing.md | 2 +- docs/updating-data-in-code.md | 20 ++++----- server/src/admin-schema.js | 2 +- server/src/admin-schema/columns.js | 6 +-- server/src/clips.js | 2 +- server/src/db.js | 2 +- server/src/media.js | 2 +- server/src/migrations/053_us_spelling.sql | 34 ++++++++++++++ server/src/pageMeta.js | 2 +- server/src/routes/auth.js | 2 +- server/src/routes/clips.js | 2 +- server/src/routes/content.js | 4 +- server/src/routes/feedback.js | 2 +- server/src/routes/home.js | 4 +- server/src/routes/requests.js | 2 +- server/src/seed-showcase.js | 2 +- server/src/theme.js | 6 +-- server/src/themeDefaults.js | 6 +-- site.json | 2 +- src/components/DoveMark.tsx | 2 +- src/components/Logo.tsx | 2 +- src/components/OrgLogo.tsx | 2 +- src/components/PeopleTiles.tsx | 2 +- src/components/PlatformIcon.tsx | 2 +- src/components/QrCode.tsx | 20 ++++----- src/components/ThemeToggle.tsx | 2 +- src/components/admin/fields.tsx | 2 +- src/data/feedbackTypes.ts | 2 +- src/index.css | 12 ++--- src/lib/adminSchema/events.ts | 6 +-- src/lib/adminSchema/frontPage.ts | 2 +- src/lib/adminSchema/organizations.ts | 2 +- src/lib/adminSchema/shared.ts | 6 +-- src/lib/adminSchema/siteSettings.ts | 12 ++--- src/lib/adminSchema/teams.ts | 2 +- src/lib/color.ts | 16 +++---- src/lib/embeds.ts | 2 +- src/lib/eventTypes.ts | 2 +- src/lib/hrefs.ts | 2 +- src/lib/organizations.ts | 2 +- src/lib/qr.ts | 2 +- src/lib/useResource.ts | 2 +- src/pages/AwardDetail.tsx | 2 +- src/pages/EventDetail.tsx | 4 +- src/pages/QrCodes.tsx | 2 +- src/pages/admin/AdminFeedback.tsx | 2 +- src/pages/admin/AdminLayout.tsx | 2 +- src/pages/admin/AdminLogin.tsx | 2 +- src/pages/admin/EntityEdit.tsx | 2 +- src/pages/admin/adminNav.ts | 2 +- src/pages/sections/EventCalendar.tsx | 10 ++--- src/pages/sections/EventList-Cards.tsx | 8 ++-- src/pages/sections/OrgList-Map.tsx | 4 +- src/pages/sections/OrgList-Vertical.tsx | 2 +- src/pages/sections/QrCodeMaker.tsx | 54 +++++++++++------------ src/pages/sections/home/HeroStage.tsx | 10 ++--- src/pages/sections/home/Pathfinder.tsx | 2 +- src/pages/sections/home/home.css | 4 +- vite.config.ts | 4 +- 60 files changed, 182 insertions(+), 148 deletions(-) create mode 100644 server/src/migrations/053_us_spelling.sql diff --git a/CLAUDE.md b/CLAUDE.md index cca8458..e6e5bf6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -69,7 +69,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu - **Imports need explicit extensions** (`.ts`, `.tsx`, `.js`) everywhere. - **Vite resolves `.js` before `.ts`**, so a `.js` and `.ts` file with the same base name will import the wrong one. Give new hooks distinct names. - **Don't use `fallback: EMPTY` in api.ts hooks.** It silently returns empty arrays and hides server errors; let the error state surface. -- **Colours are tokens, not hex.** Admins can override any token (Panel → Site settings → Colours). The defaults are `server/src/themeDefaults.js` plus the same values as CSS in `src/index.css`; the build fails if they differ (`themeDefaultsCheck` in `vite.config.ts`), and migration 041's CHECK lists the token names. Use the utilities from `src/index.css` (`text-ink`, `text-body`, `text-muted`, `text-link`, `bg-surface`, `bg-tint`, `bg-action`, `border-brand/20`...) so dark mode works; a literal only for something that must look the same in both modes (white on a dark band, a platform's colour). Data colours (accents, event and region colours) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`. +- **Colors are tokens, not hex.** Admins can override any token (Panel → Site settings → Colors). The defaults are `server/src/themeDefaults.js` plus the same values as CSS in `src/index.css`; the build fails if they differ (`themeDefaultsCheck` in `vite.config.ts`), and migration 041's CHECK lists the token names. Use the utilities from `src/index.css` (`text-ink`, `text-body`, `text-muted`, `text-link`, `bg-surface`, `bg-tint`, `bg-action`, `border-brand/20`...) so dark mode works; a literal only for something that must look the same in both modes (white on a dark band, a platform's color). Data colors (accents, event and region colors) go through `withAlpha`, `accentText` and `readableOn` in `src/lib/color.ts`, never `${color}55`. - **Icons are Phosphor** (`@phosphor-icons/react`), weight `bold` (or `fill` for play/star). No hand-drawn `` icons and no Unicode glyphs as icons (× › ▶ →). Brand marks are the exception: `DoveMark`, `PlatformIcon`, the Google logo, the group map. - **Accents come from `src/lib/color.ts`:** `BRAND` (the teal, via the button token so the admin palette reaches it) and `ACCENTS` (deep, green, mint). Not a new hex in a page. - **No em-dashes** (U+2014) anywhere: UI text, help text, comments, docs, commit messages. Use a colon, comma or parentheses. An empty table cell shows `-`. @@ -79,7 +79,7 @@ In dev, Vite proxies `/api` to the target set in `vite.config.ts`, so the API mu Descriptor-driven: `server/src/admin-crud.js` and `server/src/admin-schema/` (server, one file per entity, registered in `admin-schema.js`) and `src/lib/adminSchema/` (client, one file per entity, registered in `adminSchema.ts`) generate SQL and form fields from declarative entity configs. Adding an entity should mean adding a descriptor, not new CRUD code. - Child collections are deleted and reinserted wholesale. Unsafe for entities referenced by foreign keys elsewhere. - `reindex: false` prevents cross-entity sort order collisions. -- `check: (db, id) => void` runs after a save has written everything, inside its transaction; throwing an `HttpError` refuses the save (Site settings uses it for the colour contrast check, `server/src/theme.js`). +- `check: (db, id) => void` runs after a save has written everything, inside its transaction; throwing an `HttpError` refuses the save (Site settings uses it for the color contrast check, `server/src/theme.js`). - The `OMIT` sentinel distinguishes unsent fields from deliberate clears. - `admin-schema-sync.js` runs at boot and throws if descriptors don't match live `PRAGMA table_info`. If boot fails after a schema change, update the descriptor or migration so they agree. - `admin-cli.js` imports `ROLES` and `destroyAllSessionsFor` from `auth.js`. Keep it that way to prevent drift. diff --git a/docs/importing.md b/docs/importing.md index 658df8c..3d770f2 100644 --- a/docs/importing.md +++ b/docs/importing.md @@ -22,7 +22,7 @@ A post with three headings or more gets **Show contents** turned on. The URL ID is the title as a slug, with `-2`, `-3` when it's taken. Not carried over: images and drawings (the note says how many; add them -as Image blocks), text boxes, footnotes, comments, colours and fonts. +as Image blocks), text boxes, footnotes, comments, colors and fonts. Numbered lists come over as bulleted lists. The conversion is `server/src/docx.js`; the route is diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md index 74807ed..667be2d 100644 --- a/docs/updating-data-in-code.md +++ b/docs/updating-data-in-code.md @@ -32,7 +32,7 @@ what a dropdown in the admin editor says. | Blog posts, and the Community page's blog section (headings, pins, feeds) | the database | Admin → Data → Blog posts, and Admin → Pages → Community blog section | | The **label** a dropdown shows in the admin | code | [one file](#renaming-what-a-dropdown-shows) | | The **list of allowed values** behind a fixed dropdown | database CHECK + code | [a migration and three files](#adding-removing-or-renaming-a-stored-value) | -| Navigation, page section titles, colours, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) | +| Navigation, page section titles, colors, the site banner, history decades, the map grid | code | [the file named below](#other-content-that-lives-in-code) | | A static page's title and intro (also its search title and description), the site's name, description, preview image, icons, search indexing, privacy contact email | the database, over `site.json` | Admin → Panel → Site settings (superadmins). Blank uses `site.json`, which also holds the site's address and the pages' defaults. See `docs/seo.md` | | Uploaded images | disk + the `media` table | Admin → Tools → Media, or any image field. See `docs/media-uploads.md` | @@ -85,7 +85,7 @@ options: [["speaker", "Speaker"], ["leader", "Leader"]] // shows: Speaker, Lead A bare string is shown exactly as stored. A `[value, label]` pair stores the first and shows the second. That difference is what makes -relabelling cheap. +relabeling cheap. ### Renaming what a dropdown shows @@ -163,13 +163,13 @@ wrong rather than working around it. **Fixed lists** (`options`: labels in `src/lib/adminSchema/`, values also in `server/src/admin-schema/` and a CHECK): -| Entity → field | Stored values | Labelled? | 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 → 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`) | | Events → Type (+ list filter) | retreat, class, workshop, meeting, other | no | `EVENT_TYPES` in `src/lib/eventTypes.ts` (public labels and plurals) | -| Events → Status (+ list filter) | upcoming, past, cancelled | no | `STATUS_LABEL` in `src/pages/EventDetail.tsx` | +| Events → Status (+ list filter) | upcoming, past, cancelled (shown as canceled) | no | `STATUS_LABEL` in `src/pages/EventDetail.tsx` | | Events → Series → Repeats | weekly, monthly_date, monthly_weekday | **yes** | `src/lib/eventSeries.ts` | | Events → People → Role | speaker, leader, facilitator, host, musician, volunteer, attendee | no | `ROLE_LABEL` in `src/pages/EventDetail.tsx` | | People → Affiliations → Role; Teams → Members → Role | lead, board, staff, volunteer, member | no | `ROLE_LABEL` in `src/pages/PersonDetail.tsx` | @@ -190,7 +190,7 @@ also in `server/src/admin-schema/` and a CHECK): | Every list → Published / Listed / Featured filter | 1, 0 | **yes** | n/a | "No, shows values" means the dropdown currently shows the raw value, -so relabelling it is just [adding labels](#renaming-what-a-dropdown-shows). +so relabeling it is just [adding labels](#renaming-what-a-dropdown-shows). **Lists filled from records** (`optionsFrom`: edit the records, not code): @@ -199,12 +199,12 @@ code): | --- | --- | --- | | Group → Region | `regions` | organizations of kind region | | Event → Scope (+ list filter); Front page → Countdown → Only this scope | `event_scopes` | the `event_scopes` table (migration only) | -| Event hosts → Organization; affiliations; team and award "Organization" / "Awarded by"; person → Home organization | `organizations` | organizations, labelled by name | +| Event hosts → Organization; affiliations; team and award "Organization" / "Awarded by"; person → Home organization | `organizations` | organizations, labeled by name | | Event hosts / event people / team members / timeline people → Person | `people` | people | | Community blog section → Pinned posts → Post | `blog_posts` | blog posts, newest first | | Timeline → Record; Featured cards → Record | `record_refs` | every event, organization, award, person and team, narrowed by the type picked beside it | | Affiliations → Team | `teams` | teams, filtered to the chosen organization | -| Person awards → Award | `awards` | awards, labelled "Award (Organization)" | +| Person awards → Award | `awards` | awards, labeled "Award (Organization)" | | Person awards → Presented at; Front page → Count down to; Front page → Featured event | `events` | events | --- @@ -268,15 +268,15 @@ The numbers band's "Number Source" dropdown works the same way: | What | File | Notes | | --- | --- | --- | | Header and footer navigation, page subnav links | `src/navConfig.ts` | `PAGE_LINKS`, `PAGE_SECTIONS`, `NAV_ACTIONS`. A new page also needs a route in `src/App.tsx`. | -| Section titles, blurbs and colours on Retreats, Community, Leadership, Resources, Feedback, Privacy, Terms | the page file in `src/pages/` | the `SECTIONS` array at the top. A section's `id` must match its subnav `hash`. | +| Section titles, blurbs and colors on Retreats, Community, Leadership, Resources, Feedback, Privacy, Terms | the page file in `src/pages/` | the `SECTIONS` array at the top. A section's `id` must match its subnav `hash`. | | Site-wide announcement banner | `src/data/bannerConfig.ts` | `enabled: false` hides it. Bump `id` when the message changes, so people who dismissed the old one see the new one. | | History page decade headers | `src/data/historyDecades.ts` | Title, tagline and blurb per decade. | | Group map tiles and area names | `src/data/mapGrid.ts` | `AREAS` (tile positions) and `AREA_NAMES`. Which region paints which tile is in the database (Admin → Data → Organizations → a region → Map areas). | | Feedback form types | `src/data/feedbackTypes.ts` **and** `TYPES` in `server/src/routes/feedback.js` | Keep the ids identical in both; the server stores unknown ids as `general`. Labels and hints are client-only. `DATA_REQUEST` ('privacy') isn't a tile: the Privacy page's form sends it, and the server requires an email for it. | | Request form types (what `/request` can ask for) | `src/data/requestTypes.ts` **and** `CATEGORIES` in `server/src/routes/requests.js` **and** the CHECK on `feedback.category` (`046_content_requests.sql`) | Ids and allowed actions (new, update) identical in all three; a new id needs a migration. Labels, hints, the name field's question and each type's `fields` (the details it asks for, and where each lands in the admin editor: a field path, a link row or a description paragraph) are client-only: the server stores whatever detail keys come as JSON (`feedback.details`, 049), so adding a field needs no migration. A button to the form opened on one type: `request: { type, label }` on a section manifest entry, or `` (`src/components/RequestLink.tsx`). | -| The site's colours, light and dark | the database over `src/index.css` | Admin → Panel → Site settings → Colours (superadmins): pick a colour, set its light and/or dark value; saving refuses anything that makes text hard to read. The defaults are `THEME_DEFAULTS` in `server/src/themeDefaults.js` (the admin and the contrast check read it) and the same values as CSS in `src/index.css`; the build stops if the two differ. The admin's labels for them are `THEME_LABELS` in `src/lib/adminSchema/siteSettings.ts`. Change a token's value in both modes and every use follows. Use the token utilities (`text-muted`, `bg-surface`, `border-brand/20`) or `var(--color-…)`, not hex. A colour that arrives as data (a page accent, an event's or region's colour) goes through `src/lib/color.ts`: `withAlpha` for tints, `accentText` for text in it, `readableOn` for text on it. | +| The site's colors, light and dark | the database over `src/index.css` | Admin → Panel → Site settings → Colors (superadmins): pick a color, set its light and/or dark value; saving refuses anything that makes text hard to read. The defaults are `THEME_DEFAULTS` in `server/src/themeDefaults.js` (the admin and the contrast check read it) and the same values as CSS in `src/index.css`; the build stops if the two differ. The admin's labels for them are `THEME_LABELS` in `src/lib/adminSchema/siteSettings.ts`. Change a token's value in both modes and every use follows. Use the token utilities (`text-muted`, `bg-surface`, `border-brand/20`) or `var(--color-…)`, not hex. A color that arrives as data (a page accent, an event's or region's color) goes through `src/lib/color.ts`: `withAlpha` for tints, `accentText` for text in it, `readableOn` for text on it. | | The icons a Front page "Find your way in" path can pick | `src/data/pathIcons.ts` (keys and labels) **and** `ICONS` in `src/pages/sections/home/Pathfinder.tsx` (the Phosphor icon for each key) | Add a line to both. A path saved with an emoji from before the list shows it as it is. | -| A page section's accent colour | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a colour there, not a hex in a page. Each is readable as text on white and the tints. | +| A page section's accent color | `BRAND` and `ACCENTS` in `src/lib/color.ts` | Pages pick from these (`accent: ACCENTS.green`); add a color there, not a hex in a page. Each is readable as text on white and the tints. | | 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 and person role labels (public site) | `ROLE_LABEL` in `src/pages/EventDetail.tsx` and `src/pages/PersonDetail.tsx` | | diff --git a/server/src/admin-schema.js b/server/src/admin-schema.js index 0073b61..1769d0e 100644 --- a/server/src/admin-schema.js +++ b/server/src/admin-schema.js @@ -21,7 +21,7 @@ refuses create and delete (see front_page) check (db, id) => void, run after a save has written everything, inside its transaction: throw an - HttpError to refuse it (site settings' colours) + HttpError to refuse it (site settings' colors) Replacing children wholesale is only safe because nothing has a foreign key INTO these tables. That is the dividing line, and diff --git a/server/src/admin-schema/columns.js b/server/src/admin-schema/columns.js index d59deb7..0832550 100644 --- a/server/src/admin-schema/columns.js +++ b/server/src/admin-schema/columns.js @@ -109,7 +109,7 @@ export const featuredCardsChild = (ownerKind) => ({ ], }); -/* The two polymorphic collections, parameterised by owner_kind. */ +/* The two polymorphic collections, parameterized by owner_kind. */ export const linksChild = (ownerKind) => ({ key: "links", table: "links", @@ -189,12 +189,12 @@ export const blocksChild = (ownerKind) => ({ one with both selects filled, and that comes back keyed to the row like any other field error. - Not parameterised the way links and blocks are: this table is + Not parameterized the way links and blocks are: this table is events-only, and the owner column says so. sort_order isn't declared. The engine writes it from the row's position because `order` is "sort_order", which is what makes - the first row the one v_events takes the logo and colour from. */ + the first row the one v_events takes the logo and color from. */ export const hostsChild = { key: "event_hosts", table: "event_hosts", diff --git a/server/src/clips.js b/server/src/clips.js index acc5b2d..97c71d4 100644 --- a/server/src/clips.js +++ b/server/src/clips.js @@ -386,7 +386,7 @@ async function cut(db, job) { const { width, height } = await probe(input); if (width && height) { // Crop the source to the shape. The focus is where along the - // cropped direction the frame is centred (0 left/top, 1 + // cropped direction the frame is centered (0 left/top, 1 // right/bottom); even sizes, as the H.264 encoder needs. let w = width; let h = height; diff --git a/server/src/db.js b/server/src/db.js index e7c5f3d..ec341d9 100644 --- a/server/src/db.js +++ b/server/src/db.js @@ -129,7 +129,7 @@ export function migrate(db, { log = console.log } = {}) { throw new Error(`${file} leaves ${orphans.length} foreign key violation(s): ${where}`); } - // Not parameterisable, but version is a validated integer. + // Not parameterizable, but version is a validated integer. db.exec(`PRAGMA user_version = ${version}`); }); diff --git a/server/src/media.js b/server/src/media.js index e85941a..cada7e9 100644 --- a/server/src/media.js +++ b/server/src/media.js @@ -24,7 +24,7 @@ which also drops its metadata, camera location included. `keepOriginal` stores the bytes exactly as uploaded instead, under the tighter KEEP_MAX_BYTES. An SVG is always kept as it - is: it's already small, and rasterising it would lose the point + is: it's already small, and rasterizing it would lose the point of it. Names are random, so two uploads of "logo.png" can't collide diff --git a/server/src/migrations/053_us_spelling.sql b/server/src/migrations/053_us_spelling.sql new file mode 100644 index 0000000..e8d649f --- /dev/null +++ b/server/src/migrations/053_us_spelling.sql @@ -0,0 +1,34 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 053 US SPELLING IN MESSAGES +-- +-- The site is written in US English now. Two of 041's CHECKs are +-- named with the sentence the admin shows when a save breaks them +-- (admin-crud.js), and those said "colour"; the table is rebuilt to +-- rename them, the same columns and rows as before. +-- +-- events.status keeps the value 'cancelled': it's stored data, and +-- the admin and the pages show it as "canceled". +-- ═══════════════════════════════════════════════════════════════ + +CREATE TABLE site_setting_colors_new ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + settings_id TEXT NOT NULL REFERENCES site_settings (id) ON DELETE CASCADE, + sort_order INTEGER NOT NULL DEFAULT 0, + token TEXT NOT NULL CHECK (token IN ( + 'ink', 'body', 'muted', 'link', 'brand', 'action', 'action-hover', + 'surface', 'tint', 'tint-soft', 'danger', 'danger-tint')), + light TEXT CONSTRAINT "A color must be written #rrggbb, eg. #0f7183." + CHECK (light IS NULL OR (length(light) = 7 AND light GLOB '#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]')), + dark TEXT CONSTRAINT "A dark color must be written #rrggbb, eg. #5ccbdc." + CHECK (dark IS NULL OR (length(dark) = 7 AND dark GLOB '#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]')), + UNIQUE (settings_id, token) +) STRICT; + +INSERT INTO site_setting_colors_new (id, settings_id, sort_order, token, light, dark) +SELECT id, settings_id, sort_order, token, light, dark + FROM site_setting_colors; + +PRAGMA legacy_alter_table = ON; +DROP TABLE site_setting_colors; +ALTER TABLE site_setting_colors_new RENAME TO site_setting_colors; +PRAGMA legacy_alter_table = OFF; diff --git a/server/src/pageMeta.js b/server/src/pageMeta.js index 12380a1..f91ac5a 100644 --- a/server/src/pageMeta.js +++ b/server/src/pageMeta.js @@ -105,7 +105,7 @@ export function siteFor(db) { index: row.indexing ? row.indexing === "on" : base.robots?.index !== false, }, privacyEmail: row.privacy_email || base.privacyEmail || "", - // The admin's colours (theme.js): only #rrggbb values and fixed + // The admin's colors (theme.js): only #rrggbb values and fixed // text, so safe inside for a logo or mark that may not exist: no src, or a file - that 404s, and it draws `fallback` instead (initials, a colour dot, + that 404s, and it draws `fallback` instead (initials, a color dot, or nothing). `src` is already resolved (mediaUrl in media.ts). An upload loads its 640px copy first (useSmallImage). Decorative by default (alt ""), since a logo sits next to the name it stands for. diff --git a/src/components/OrgLogo.tsx b/src/components/OrgLogo.tsx index 225d11c..f51837a 100644 --- a/src/components/OrgLogo.tsx +++ b/src/components/OrgLogo.tsx @@ -1,7 +1,7 @@ /* ═══════════════════════════════════════════════════════════════ ORG LOGO - An organization's logo, or its initials in a square in its colour + An organization's logo, or its initials in a square in its color when there's no file or it fails to load. Decorative: the name is always right beside it. Used by the organization lists and the group map. diff --git a/src/components/PeopleTiles.tsx b/src/components/PeopleTiles.tsx index d9db438..cfbb158 100644 --- a/src/components/PeopleTiles.tsx +++ b/src/components/PeopleTiles.tsx @@ -345,7 +345,7 @@ function buildTeamGroups( return [ { id: data.team.id, - // One unlabelled team needs no heading; several always do. + // One unlabeled team needs no heading; several always do. label: teamCount > 1 || spec.label ? name : undefined, accent, people: data.people, diff --git a/src/components/PlatformIcon.tsx b/src/components/PlatformIcon.tsx index 17205b2..083cb35 100644 --- a/src/components/PlatformIcon.tsx +++ b/src/components/PlatformIcon.tsx @@ -6,7 +6,7 @@ import type { Platform } from '../lib/platforms.ts' PLATFORM ICON The brand mark for a link's platform (links.platform), drawn in - currentColor so it takes the colour of the button it sits in. + currentColor so it takes the color of the button it sits in. Anything that isn't one of PLATFORMS in lib/platforms.ts, blank included, draws nothing, so a caller can always pass the field straight through. diff --git a/src/components/QrCode.tsx b/src/components/QrCode.tsx index 8ae64bf..9d55c2f 100644 --- a/src/components/QrCode.tsx +++ b/src/components/QrCode.tsx @@ -3,7 +3,7 @@ A QR code as an , sized by its container. - `centre` puts something on a badge over the middle: the NGU dove, + `center` puts something on a badge over the middle: the NGU dove, or an image (an SVG from src/assets/qr, passed as a data: URL). With anything there, the code switches to high error correction so the modules under the badge are recovered when it's scanned @@ -17,7 +17,7 @@ doesn't, this just draws what it's given. Everything is drawn in the SVG itself (no CSS, and an image is - embedded rather than linked), so the element serialises to a + embedded rather than linked), so the element serializes to a file that looks the same outside the page. `ref` reaches the for exactly that. ═══════════════════════════════════════════════════════════════ */ @@ -42,11 +42,11 @@ const BADGE = 0.24 /* DoveMark's own viewBox is 72.87 × 48.57. */ const DOVE_ASPECT = 72.867699 / 48.568241 -export type QrCentre = { kind: 'dove'; color?: string } | { kind: 'image'; src: string } | null +export type QrCenter = { kind: 'dove'; color?: string } | { kind: 'image'; src: string } | null export default function QrCode({ value, - centre = null, + center = null, ink = QR_INK, paper = QR_PAPER, label, @@ -54,7 +54,7 @@ export default function QrCode({ className, }: { value: string - centre?: QrCentre + center?: QrCenter ink?: string paper?: string /** Accessible name for the image, e.g. "QR code for /retreats". */ @@ -62,7 +62,7 @@ export default function QrCode({ ref?: Ref className?: string }) { - const level = centre ? 'H' : 'M' + const level = center ? 'H' : 'M' const matrix = useMemo(() => qrMatrix(value, level), [value, level]) const path = useMemo(() => qrPath(matrix, MARGIN), [matrix]) @@ -86,7 +86,7 @@ export default function QrCode({ - {centre && ( + {center && ( - {centre.kind === 'dove' ? ( + {center.kind === 'dove' ? ( ) : ( THEME_COLORS.find(([token]) => token === row.token)?.[1] ?? "New colour", + label: "Colors", + note: "Change any of the site's colors, for light mode, dark mode or both; a blank keeps the default. Saving refuses a palette that would make text hard to read (under 4.5:1). Changes show on the next page load.", + addLabel: "Change a color", + title: (row) => THEME_COLORS.find(([token]) => token === row.token)?.[1] ?? "New color", blank: { token: "", light: "", dark: "" }, fields: [ { path: "token", - label: "Colour", + label: "Color", widget: "select", options: THEME_COLORS.map(([token, label]) => [token, label]), required: true, diff --git a/src/lib/adminSchema/teams.ts b/src/lib/adminSchema/teams.ts index dd1ba3d..5472db5 100644 --- a/src/lib/adminSchema/teams.ts +++ b/src/lib/adminSchema/teams.ts @@ -46,7 +46,7 @@ export const teams = { }, { path: "name", label: "Name", required: true, help: "Board, Leadership Team" }, { path: "tagline", label: "Tagline", full: true }, - { path: "color", label: "Colour", widget: "color" }, + { path: "color", label: "Color", widget: "color" }, { path: "logo", label: "Logo", widget: "image", folder: "logos", resolve: mediaUrl, full: true }, ], }, diff --git a/src/lib/color.ts b/src/lib/color.ts index 381acac..8041be2 100644 --- a/src/lib/color.ts +++ b/src/lib/color.ts @@ -1,14 +1,14 @@ /* ═══════════════════════════════════════════════════════════════ COLOR - Two helpers for colours that arrive as data (a page's accent, an - event's or region's colour), so they work with the theme tokens + Two helpers for colors that arrive as data (a page's accent, an + event's or region's color), so they work with the theme tokens in index.css as well as with hex. - withAlpha(color, 20) is that colour at 20% opacity, for tints and + withAlpha(color, 20) is that color at 20% opacity, for tints and borders. It replaces `${color}33`, which only works on hex. - accentText(color) is that colour as text: itself in light mode, + accentText(color) is that color as text: itself in light mode, mixed halfway to white in dark mode (--accent-text-mix), so an accent picked for a white page still reads on a dark one. ═══════════════════════════════════════════════════════════════ */ @@ -19,8 +19,8 @@ export const withAlpha = (color: string, percent: number): string => export const accentText = (color: string): string => `color-mix(in srgb, ${color} var(--accent-text-mix), #ffffff)` -/* Text for on top of a colour that arrives as data: white or deep - ink, whichever has more contrast (WCAG), so a pale colour an admin +/* Text for on top of a color that arrives as data: white or deep + ink, whichever has more contrast (WCAG), so a pale color an admin picks still gets readable text. Anything that isn't #rrggbb (a CSS variable, say) gets white, which suits the site's own dark accents. */ @@ -40,8 +40,8 @@ export function readableOn(color: string): string { /* ── The site's accents ────────────────────────────────────────── BRAND is the teal every page uses as its accent; it's the button - token, so the admin's palette (Site settings → Colours) reaches it. - ACCENTS are the other section colours a page may give a band, all + token, so the admin's palette (Site settings → Colors) reaches it. + ACCENTS are the other section colors a page may give a band, all from the same family and all readable as text on white and on the tints (5:1 or better). Use these rather than a new hex. */ export const BRAND = 'var(--color-action)' diff --git a/src/lib/embeds.ts b/src/lib/embeds.ts index c9f6460..16e7aa0 100644 --- a/src/lib/embeds.ts +++ b/src/lib/embeds.ts @@ -4,7 +4,7 @@ Turns the link an admin pastes into the URL an
diff --git a/src/pages/admin/AdminLogin.tsx b/src/pages/admin/AdminLogin.tsx index accbf2c..d1ecbe2 100644 --- a/src/pages/admin/AdminLogin.tsx +++ b/src/pages/admin/AdminLogin.tsx @@ -22,7 +22,7 @@ import { ApiError, get } from "../../lib/api.ts"; /* What a ?error= from the Google callback means, in the words the person at the login page needs. */ const GOOGLE_ERRORS: Record = { - cancelled: "Google sign-in was cancelled.", + canceled: "Google sign-in was canceled.", expired: "That sign-in took too long or was already used. Try again.", no_account: "There's no admin account for that Google account. Ask a superadmin to add your email.", diff --git a/src/pages/admin/EntityEdit.tsx b/src/pages/admin/EntityEdit.tsx index 9292588..2a67690 100644 --- a/src/pages/admin/EntityEdit.tsx +++ b/src/pages/admin/EntityEdit.tsx @@ -131,7 +131,7 @@ export default function EntityEdit() { return `${slugify(parts.join(" "))}-`; }; - // What to show greyed out before then: org_id becomes "org-". + // What to show grayed out before then: org_id becomes "org-". const prefixHint = qualifierPaths.length ? `${qualifierPaths.map((path) => path.replace(/_id$/, "")).join("-")}-` : ""; diff --git a/src/pages/admin/adminNav.ts b/src/pages/admin/adminNav.ts index b94da27..96688d8 100644 --- a/src/pages/admin/adminNav.ts +++ b/src/pages/admin/adminNav.ts @@ -151,7 +151,7 @@ export const TOOLS_NAV = { { to: "/qr", label: "QR code generator", - blurb: "Codes for flyers, slides and signs: any page or link, in your choice of colours.", + blurb: "Codes for flyers, slides and signs: any page or link, in your choice of colors.", }, ], }; diff --git a/src/pages/sections/EventCalendar.tsx b/src/pages/sections/EventCalendar.tsx index b52f74a..b7383ed 100644 --- a/src/pages/sections/EventCalendar.tsx +++ b/src/pages/sections/EventCalendar.tsx @@ -576,7 +576,7 @@ function MonthGrid({ weeks, month, today, occurrences, selected, onSelect, accen function Bar({ seg, accent }: { seg: Segment; accent: string }) { const color = seg.event.color || accent - const cancelled = seg.event.status === 'cancelled' + const canceled = seg.event.status === 'cancelled' return (