From 54bf649b8dc5d3f8664b61a08cf320c02f7dc882 Mon Sep 17 00:00:00 2001 From: Zaldimmar Date: Sat, 26 Sep 2026 19:38:24 -0500 Subject: [PATCH] Tidy the admin editor's text: previews, blank options, no em-dashes Your wording pass on adminSchema.ts and fields.tsx: "Default: ..." blank options, "eg." examples, "URL ID" for slugs, and relabelled front page sections, stat sources and hero fields. On top of it: - Content block row titles end with an ellipsis when the paragraph is cut. preview() in src/lib/text.ts does it for anything that shortens text: it collapses whitespace, cuts on a word and adds "..." only when it actually shortened. - No em-dashes in the editor, front end or server: placeholders ("Internal note: ..."), the Organizations blurb, the URL ID help, empty table cells (now "-"), the Award dropdown ("Torch Award (NGU)" in OPTION_QUERIES), a boot error message, and every comment in the admin files. Also cleared from the files added this branch (QR page, directory route, embeds, hero, migration 024), and the QR page's team labels read "Board (NGU)". - A few comments where removing the dash had run two sentences together get a comma, colon or parentheses back. - docs/updating-data-in-code.md matches the new labels and gains a "Writing text in the editor" section with these conventions; CLAUDE.md lists them under Rules and gotchas. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 2 + docs/updating-data-in-code.md | 46 +++-- server/src/admin-crud.js | 18 +- server/src/admin-schema-sync.js | 4 +- server/src/admin-schema.js | 18 +- server/src/auth.js | 2 +- .../src/migrations/024_front_page_video.sql | 2 +- server/src/routes/admin-entities.js | 2 +- server/src/routes/admin.js | 2 +- server/src/routes/directory.js | 2 +- server/src/routes/panel.js | 6 +- src/components/QrCode.tsx | 4 +- src/components/admin/fields.tsx | 12 +- src/lib/adminSchema.ts | 161 +++++++++--------- src/lib/adminTitle.tsx | 4 +- src/lib/embeds.ts | 6 +- src/lib/roles.ts | 2 +- src/lib/site.ts | 2 +- src/lib/text.ts | 23 +++ src/lib/useFrontPage.ts | 4 +- src/pages/QrCodes.tsx | 2 +- src/pages/admin/AdminFeedback.tsx | 8 +- src/pages/admin/AdminHome.tsx | 8 +- src/pages/admin/AdminLayout.tsx | 8 +- src/pages/admin/AdminPanel.tsx | 18 +- src/pages/admin/EntityEdit.tsx | 24 +-- src/pages/admin/EntityList.tsx | 12 +- src/pages/admin/RequireRole.tsx | 4 +- src/pages/admin/adminNav.ts | 14 +- src/pages/sections/QrCodeMaker.tsx | 2 +- src/pages/sections/home/HeroStage.tsx | 4 +- 31 files changed, 239 insertions(+), 187 deletions(-) create mode 100644 src/lib/text.ts diff --git a/CLAUDE.md b/CLAUDE.md index 5cc971b..06fe51f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -60,6 +60,8 @@ 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. +- **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 `-`. +- **Admin editor text:** blank select options read `Default: …` (what blank means), examples in help text start with `eg.`, and record ids are called "URL ID". Cut-off preview text uses `preview()` from `src/lib/text.ts`, which ends it with an ellipsis. See `docs/updating-data-in-code.md`. ## Admin CRUD engine Descriptor-driven: `server/admin-crud.js` and `admin-schema.js` (server) and `adminSchema.ts` (client) generate SQL and form fields from declarative entity configs. Adding an entity should mean adding a descriptor, not new CRUD code. diff --git a/docs/updating-data-in-code.md b/docs/updating-data-in-code.md index c82cbe0..54d1dc3 100644 --- a/docs/updating-data-in-code.md +++ b/docs/updating-data-in-code.md @@ -18,6 +18,7 @@ what a dropdown in the admin editor says. - [Front page section names](#front-page-section-names) - [Front page stat sources](#front-page-stat-sources) - [Other content that lives in code](#other-content-that-lives-in-code) +- [Writing text in the editor](#writing-text-in-the-editor) - [Making the change](#making-the-change) --- @@ -96,7 +97,7 @@ label. For example, to make the event-people Role dropdown read nicely: // before options: ["speaker", "leader", "facilitator", "host", "musician", "volunteer", "attendee"], -// after — values unchanged, labels added +// after: values unchanged, labels added options: [ ["speaker", "Speaker"], ["leader", "Leader"], @@ -116,8 +117,11 @@ Things to check while you're there: - **Several lists are shared constants.** Front page sections and stat sources are `FRONT_PAGE_SECTIONS` and `STAT_SOURCES` near the top of the front page block; change them there, once. -- **`blankLabel`** is the text of the empty first option - (`"— brand —"`, `"— choose —"`). It's also just a label. +- **`blankLabel`** is the text of the empty first option, written as + `Default: …` saying what happens when it's left blank + (`"Default: brand"`, `"Default: none"`). It's also just a label. A + select with no `blankLabel` shows `- Please choose from the list -` + (set in `src/components/admin/fields.tsx`). - The value (first item) **must not change**. It's what's stored in the database and what the server and the CHECK constraint compare against. @@ -173,9 +177,9 @@ also in `admin-schema.js` and a CHECK): | Timeline → Points at (+ list filter) | event, organization, award, person, team | no | `refHref` in `src/lib/hrefs.ts` | | Timeline → Precision (and on events/orgs) | year, month, day | no | the history page's grouping | | Front page → Background | brand, photos | **yes** | `HeroStage.tsx` | -| Front page → Beside the words | none, livestream, video | **yes** | `HeroStage.tsx` | +| Front page → Feature | none, livestream, video | **yes** | `HeroStage.tsx` | | Front page → Sections → Section | countdown, retreats, calendar, stats, timeline, connect | **yes**, `FRONT_PAGE_SECTIONS` | `SECTIONS` in `src/pages/Home.tsx`; see [below](#front-page-section-names) | -| Front page → Stats → Where it comes from | manual, years_since, regions, … | **yes**, `STAT_SOURCES` | `STAT_QUERIES` in `server/src/routes/home.js`; see [below](#front-page-stat-sources) | +| Front page → Stats → Number Source | manual, years_since, regions, … | **yes**, `STAT_SOURCES` | `STAT_QUERIES` in `server/src/routes/home.js`; see [below](#front-page-stat-sources) | | Every list → Published / Featured filter | 1, 0 | **yes** | n/a | "No, shows values" means the dropdown currently shows the raw value, @@ -191,7 +195,7 @@ code): | Event hosts → Organization; affiliations; team and award "Organization" / "Awarded by"; person → Home organization | `organizations` | organizations, labelled by name | | Event hosts / event people / team members / timeline people → Person | `people` | people | | Affiliations → Team | `teams` | teams, filtered to the chosen organization | -| Person awards → Award | `awards` | awards, labelled "Award — Organization" | +| Person awards → Award | `awards` | awards, labelled "Award (Organization)" | | Person awards → Presented at; Front page → Count down to | `events` | events | | Timeline → Record | `timeline_refs` | all five kinds, filtered by "Points at" | @@ -206,7 +210,7 @@ each is changed in a different place: | --- | --- | | **The heading on the page** ("National Retreats", "What's on") | **Admin → Front page → Page sections → Heading.** Blank uses the default below. | | The default heading when that field is blank | `SECTIONS` in `src/pages/Home.tsx`, the `title` of each entry | -| **The name in the admin's Section dropdown** ("National Retreats carousel") | `FRONT_PAGE_SECTIONS` in `src/lib/adminSchema.ts` | +| **The name in the admin's Section dropdown** ("Events Carousel (National Retreats)") | `FRONT_PAGE_SECTIONS` in `src/lib/adminSchema.ts` | | The subnav links under the header ("#Retreats", "#Calendar") | `PAGE_SECTIONS["/"]` in `src/navConfig.ts` | To rename a band **for visitors**, use the admin. To rename how it @@ -214,9 +218,9 @@ reads **in the editor's dropdown**, edit `FRONT_PAGE_SECTIONS`: ```ts const FRONT_PAGE_SECTIONS = [ - ["countdown", "Countdown to the next event"], - ["retreats", "National Retreats carousel"], // ← the right-hand side is the label - ["calendar", "Event calendar"], + ["countdown", "Event Countdown"], + ["retreats", "Events Carousel (National Retreats)"], // ← the right-hand side is the label + ["calendar", "Event Calendar"], ... ]; ``` @@ -238,7 +242,7 @@ CHECK on `front_page_sections.section` via a migration. ## Front page stat sources -The numbers band's "Where it comes from" dropdown works the same way: +The numbers band's "Number Source" dropdown works the same way: - **Relabel a source:** `STAT_SOURCES` in `src/lib/adminSchema.ts`. - **Change what a count counts:** its query in `STAT_QUERIES` in @@ -272,6 +276,26 @@ The numbers band's "Where it comes from" dropdown works the same way: --- +## Writing text in the editor + +Conventions for any label, help text or option added to the admin, so +the editor reads consistently: + +- **Blank options say what blank means:** `Default: none`, + `Default: weekly`, `Default: the next upcoming event`. +- **Examples in help text start with `eg.`:** `eg. Board Chair, Team Lead`. +- **Record ids are called "URL ID"**, not slug, in anything the editor + shows. +- **Cut-off text ends with an ellipsis.** Anywhere a paragraph is + shortened for a row title, list cell or card, use `preview(text, max)` + from `src/lib/text.ts` rather than `.slice()`. It cuts on a word and + adds `…`, and only when it actually shortened something. +- **No em-dashes** (the long dash, U+2014), in the editor or anywhere else: labels, help + text, placeholders, code comments and docs. Use a colon, a comma or + parentheses instead. An empty value in a table shows `-`. + +--- + ## Making the change 1. Branch from `main` (never commit to `main` directly). diff --git a/server/src/admin-crud.js b/server/src/admin-crud.js index 732d154..2dd977d 100644 --- a/server/src/admin-crud.js +++ b/server/src/admin-crud.js @@ -10,7 +10,7 @@ it wants to exist, the engine deletes and reinserts in array order, and sort_order becomes the index. That makes drag-to- reorder free and removes a whole class of "which row is this" - bugs, at the cost of churning autoincrement ids — which is fine + bugs, at the cost of churning autoincrement ids, which is fine precisely because nothing references them. A column that isn't present in the payload at all is left out of @@ -51,7 +51,7 @@ function coerceValue(column, raw, errors, prefix = "") { // Absent from the payload. Fall back to the descriptor default // if it declares one, otherwise let the column's own DEFAULT do - // the work — which needs the column omitted, not nulled. + // the work, which needs the column omitted, not nulled. if (raw === undefined) { if (column.default !== undefined) return column.default; if (column.required) errors[key] = "Required."; @@ -183,8 +183,8 @@ export function readRow(db, entity, rawId) { /* A 1:1 side table is found one of two ways. `idColumn` is the original: the side table's key IS the parent's id, which is how regions and person_private work. `owner` is the same block children - already use — a foreign key column plus an optional kind discriminator - — and it exists because a timeline entry is keyed by (ref_kind, + already use (a foreign key column plus an optional kind discriminator), + and it exists because a timeline entry is keyed by (ref_kind, ref_id) rather than by the event's own slug. Same upsert either way; only the WHERE differs. */ function extensionWhere(ext, id) { @@ -257,7 +257,7 @@ export function createRow(db, entity, payload) { // idKind "auto": the table assigns the id, so there is nothing to // validate, nothing to check for collisions, and nothing for the - // client to have sent. Timeline entries use this — they have no + // client to have sent. Timeline entries use this: they have no // natural name to slug, and one gets created every time somebody // ticks a checkbox on an event. const auto = entity.idKind === "auto"; @@ -390,8 +390,8 @@ export function deleteRow(db, entity, rawId) { function writeExtensions(db, entity, id, payload, parentValues) { for (const ext of entity.extensions ?? []) { if (!applies(ext.when, parentValues)) { - // The gate closed — the kind changed away from this side - // table, or a checkbox was unticked — so its row (and anything + // The gate closed (the kind changed away from this side + // table, or a checkbox was unticked), so its row (and anything // cascading off it) goes. const gone = extensionWhere(ext, id); db.prepare(`DELETE FROM ${ext.table} WHERE ${gone.sql}`).run(...gone.params); @@ -587,7 +587,7 @@ function deleteChildren(db, child, ownerId) { /* SQLite's constraint messages are accurate and unreadable. Turn the ones that users actually cause into something actionable, - and name the column wherever the message carries it — a missing + and name the column wherever the message carries it: a missing field is the client's problem to fix, not a 500. The descriptor and the schema agreeing (see admin-schema-sync.js) @@ -635,7 +635,7 @@ function wrapDbErrors(fn) { // The polymorphic tables stand in for a foreign key with a // BEFORE INSERT trigger, and a trigger's RAISE(ABORT) matches none - // of the patterns above — so without this, pointing a content + // of the patterns above, so without this, pointing a content // block, link or timeline entry at a row that isn't there is a 500 // rather than something the form can show. const ghost = /^(\w+): no such (\w+)$/.exec(message); diff --git a/server/src/admin-schema-sync.js b/server/src/admin-schema-sync.js index f91edc3..6487d0c 100644 --- a/server/src/admin-schema-sync.js +++ b/server/src/admin-schema-sync.js @@ -14,7 +14,7 @@ field instead of SQLite catching it as a 500; - reports a descriptor column the table doesn't have; - reports a NOT NULL, no-DEFAULT column that no descriptor - column and no engine-supplied column covers — nothing can + column and no engine-supplied column covers: nothing can ever set it, so every insert through the admin will fail. The first is a silent repair. The other two are deployment bugs, @@ -122,7 +122,7 @@ export function syncDescriptorsWithSchema(db, entities, { strict = true } = {}) if (group.engineSupplied.includes(columnName)) continue; problems.push( `${name}: ${group.table}.${columnName} is NOT NULL with no default, ` + - `but no descriptor column covers it — every insert will fail.`, + `but no descriptor column covers it, so every insert will fail.`, ); } } diff --git a/server/src/admin-schema.js b/server/src/admin-schema.js index 30c63f9..29561dd 100644 --- a/server/src/admin-schema.js +++ b/server/src/admin-schema.js @@ -2,7 +2,7 @@ ADMIN ENTITY DESCRIPTORS One object per editable entity. Everything the CRUD handlers do - — validation, SQL, nesting — is read from here, so adding a + (validation, SQL, nesting) is read from here, so adding a table later is a descriptor rather than another set of hand-written statements to keep in step with the schema. @@ -28,7 +28,7 @@ owner by free-text owner_id, so renaming a slug in place would silently orphan every link and content block attached to it. - affiliations is edited from both ends — a person's roles, and a + affiliations is edited from both ends: a person's roles, and a team's members. Each side deletes and reinserts only its own slice (WHERE person_id = ?, WHERE team_id = ?) and declares every column of the row, so a save from one side round-trips @@ -81,7 +81,7 @@ const affiliationRole = [ editor and by the in_timeline extension on events and organizations. occurred_on is text, not date. "2012" and "2025-07" are legitimate - values — a backfilled entry often knows the year and nothing more — + values (a backfilled entry often knows the year and nothing more), and the date coercion would reject both. `precision` is what says how much of it to believe. */ const timelineFields = [ @@ -180,7 +180,7 @@ const blocksChild = (ownerKind) => ({ }); /* Hosts. One row is one host, ordered, each either an organization - or a person — the CHECK on event_hosts rejects both and the blank + or a person. The CHECK on event_hosts rejects both and the blank filter drops neither, so the only bad row that reaches SQLite is one with both selects filled, and that comes back keyed to the row like any other field error. @@ -496,7 +496,7 @@ const people = { // · org_id cannot be changed once anyone is filed under the // team. The composite foreign key has no ON UPDATE CASCADE, so // SQLite aborts the UPDATE. That surfaces as a constraint -// error, which is the correct answer — reassign the members +// error, which is the correct answer: reassign the members // first. // // · deleting a team with members fails the same way, rather than @@ -655,8 +655,8 @@ const timeline = { row impossible even without it. Every collection here is owned by page_id and replaced wholesale. - That is safe for the same reason it is for links and blocks — - nothing has a foreign key into these tables — and paths carry + That is safe for the same reason it is for links and blocks + (nothing has a foreign key into these tables), and paths carry their actions as a nested collection, the shape content blocks and their items already use. */ @@ -811,13 +811,13 @@ export const OPTION_QUERIES = { ORDER BY kind, label`, // The awarding organization is folded into the label instead, - // because a person can receive an award from any organization — + // because a person can receive an award from any organization: // there is nothing to filter on, only something to disambiguate // when two orgs name an award the same thing. awards: ` SELECT a.id, CASE WHEN o.name IS NULL THEN a.name - ELSE a.name || ' — ' || o.name END AS label, + ELSE a.name || ' (' || o.name || ')' END AS label, a.org_id FROM awards a LEFT JOIN organizations o ON o.id = a.org_id diff --git a/server/src/auth.js b/server/src/auth.js index 4e7f000..9a8a181 100644 --- a/server/src/auth.js +++ b/server/src/auth.js @@ -4,7 +4,7 @@ Everything that decides who someone is. Routes decide what they may do. - Password storage is scrypt from node:crypto — no native module, + Password storage is scrypt from node:crypto: no native module, nothing to compile, nothing for pnpm to get wrong. The stored string carries its own parameters, so raising the cost later doesn't invalidate existing hashes. diff --git a/server/src/migrations/024_front_page_video.sql b/server/src/migrations/024_front_page_video.sql index 9fe43fa..2637b43 100644 --- a/server/src/migrations/024_front_page_video.sql +++ b/server/src/migrations/024_front_page_video.sql @@ -3,7 +3,7 @@ -- -- A fourth hero mode, 'video': a recorded video beside the words, -- the way 'livestream' puts a stream there, but without the LIVE --- badge and without autoplay — a visitor presses play. +-- badge and without autoplay: a visitor presses play. -- -- Its own two columns rather than reusing the livestream's, so a -- featured video and a stream can both be set up ahead of time and diff --git a/server/src/routes/admin-entities.js b/server/src/routes/admin-entities.js index 98a7b66..9b700aa 100644 --- a/server/src/routes/admin-entities.js +++ b/server/src/routes/admin-entities.js @@ -12,7 +12,7 @@ feedback routes. Both sit under the same requireAuth. :entity is matched against the descriptor map, never - interpolated into SQL from the URL — an unknown name is a 404 + interpolated into SQL from the URL; an unknown name is a 404 before anything touches the database. ═══════════════════════════════════════════════════════════════ */ diff --git a/server/src/routes/admin.js b/server/src/routes/admin.js index 2bcd7c0..1479050 100644 --- a/server/src/routes/admin.js +++ b/server/src/routes/admin.js @@ -90,7 +90,7 @@ admin.get("/feedback", (c) => { }); /* ── PATCH /api/admin/feedback/:id ─────────────────────────────── - { status?, admin_note? } — either, both, partial. + { status?, admin_note? }: either, both, partial. ───────────────────────────────────────────────────────────── */ admin.patch("/feedback/:id", requireRole("editor"), async (c) => { diff --git a/server/src/routes/directory.js b/server/src/routes/directory.js index 1d55a93..680a26f 100644 --- a/server/src/routes/directory.js +++ b/server/src/routes/directory.js @@ -1,5 +1,5 @@ /* ═══════════════════════════════════════════════════════════════ - DIRECTORY ROUTE — read-only, mounted under /api + DIRECTORY ROUTE: read-only, mounted under /api GET /directory every public record that has a page diff --git a/server/src/routes/panel.js b/server/src/routes/panel.js index 394da02..8aefbce 100644 --- a/server/src/routes/panel.js +++ b/server/src/routes/panel.js @@ -1,12 +1,12 @@ /* ═══════════════════════════════════════════════════════════════ - PANEL ROUTES — server/src/routes/panel.js + PANEL ROUTES: server/src/routes/panel.js GET /api/admin/panel/overview PATCH /api/admin/panel/users/:id role, is_active DELETE /api/admin/panel/users/:id/sessions sign out everywhere Everything here is superadmin-only, enforced once at the top - rather than per route — there's no read here that an ordinary + rather than per route; there's no read here that an ordinary admin should have either. Account records and live session counts are a different class of thing from content. @@ -88,7 +88,7 @@ panel.get("/overview", (c) => { }); /* A table that hasn't been created yet shouldn't take the whole - page down — the panel is where you go when something is wrong. */ + page down: the panel is where you go when something is wrong. */ function count(db, table, where) { try { const sql = `SELECT COUNT(*) AS n FROM ${table}${where ? ` WHERE ${where}` : ""}`; diff --git a/src/components/QrCode.tsx b/src/components/QrCode.tsx index 80a7da2..e5f92d1 100644 --- a/src/components/QrCode.tsx +++ b/src/components/QrCode.tsx @@ -8,8 +8,8 @@ under 6% of the code, well inside what 'H' repairs, and never reaches the three corner finder patterns. - Everything is drawn in the SVG itself — no CSS, no external - references — so the element serialises to a file that looks the + Everything is drawn in the SVG itself (no CSS, no external + references), so the element serialises to a file that looks the same outside the page. `ref` reaches the for exactly that. ═══════════════════════════════════════════════════════════════ */ diff --git a/src/components/admin/fields.tsx b/src/components/admin/fields.tsx index c0fa4d2..d202c53 100644 --- a/src/components/admin/fields.tsx +++ b/src/components/admin/fields.tsx @@ -5,8 +5,8 @@ an ordered collection of them, and nests one level for content blocks and their items. - Ordering is array position — the server writes sort_order from - the index — so moving a row is a splice, not a number to + Ordering is array position (the server writes sort_order from + the index), so moving a row is a splice, not a number to hand-edit. Rows can be dragged by the handle or moved with the arrow buttons; the arrows are the keyboard path and stay whether or not a pointer is in use. @@ -135,7 +135,7 @@ export function Field({ field, value, row, options, error, onChange }: any) { /> ) : widget === "select" ? ( // A select has no readOnly, so this one really does have - // to be disabled — there's no way to keep it focusable + // to be disabled: there's no way to keep it focusable // and still refuse a new choice. - {row.count ?? "—"} + {row.count ?? "-"} ))} diff --git a/src/pages/admin/EntityEdit.tsx b/src/pages/admin/EntityEdit.tsx index d451a66..5511ce8 100644 --- a/src/pages/admin/EntityEdit.tsx +++ b/src/pages/admin/EntityEdit.tsx @@ -1,9 +1,9 @@ /* ═══════════════════════════════════════════════════════════════ - ADMIN — ENTITY EDIT + ADMIN: ENTITY EDIT Create and edit for every entity in the manifest. The form holds - the whole nested object — parent row, side tables, child - collections — and PATCH sends the lot. The server replaces + the whole nested object (parent row, side tables, child + collections) and PATCH sends the lot. The server replaces children wholesale, so what you see here is exactly what will exist afterwards. @@ -14,7 +14,7 @@ A field the form never sets is left out of the payload entirely, and the server lets the column's own DEFAULT apply. So a blank - new-record form is deliberate, not lazy — writing "" into every + new-record form is deliberate, not lazy: writing "" into every field is what used to turn a default into a constraint failure. updated_at rides along untouched. If someone else saved while @@ -26,7 +26,7 @@ Two capabilities, not one role. An editor may create and update but not delete, so the action bar asks canWrite/canDelete rather than comparing user.role to a string. The comparison this - replaced — role === "admin" — locked superadmins out of saving + replaced (role === "admin") locked superadmins out of saving the moment a rank above admin existed, which is what an equality test against a ladder always eventually does. @@ -35,8 +35,8 @@ slugFrom may name one field or several. Most ids are unique because the name is: two organizations aren't both called - Northwest. Team ids are the exception — teams.id is a global - primary key, so every org's 'Board' would collide — which is + Northwest. Team ids are the exception: teams.id is a global + primary key, so every org's 'Board' would collide, which is why the array form exists and teams uses it. ═══════════════════════════════════════════════════════════════ */ @@ -72,7 +72,7 @@ export default function EntityEdit() { // Some entities have no slug: the table assigns an integer id, so // there is nothing to type on create and nothing to compose from - // other fields. Timeline entries are the first — an entry that + // other fields. Timeline entries are the first: an entry that // references an event has no name of its own. const autoId = manifest?.idKind === "auto"; @@ -224,7 +224,7 @@ export default function EntityEdit() { setForm((prev) => { let next = setPath(prev, path, value); // Recompose the id whenever one of its sources moves. The - // prefix always follows the organization — picking a + // prefix always follows the organization; picking a // different one has to change the slug, or it would claim a // team belongs somewhere it doesn't. The tail only follows // the name until someone types over it. @@ -319,7 +319,7 @@ export default function EntityEdit() { {/* Slug. An auto-id entity has nothing to ask for on create, and - nothing editable afterwards — so it gets a plain line rather + nothing editable afterwards, so it gets a plain line rather than a disabled box pretending to be a field. */} {singleton ? ( updatedAt && ( @@ -347,7 +347,7 @@ export default function EntityEdit() { placeholder: isNew && qualifierPaths.length ? "board" : undefined, readOnly: !isNew, help: !isNew - ? "Fixed once created — links and content blocks reference it." + ? "Fixed once created, since links and content blocks reference it." : qualifierPaths.length ? "The prefix comes from the organization. Type the rest." : "Lowercase, hyphens, no spaces. Can't be changed later.", @@ -394,7 +394,7 @@ export default function EntityEdit() { ))} {/* Child collections. Awards own none, so the panel would be - an empty white box — skip it rather than render it. */} + an empty white box; skip it rather than render it. */} {children.some((child) => visible(child.when)) && (
{children diff --git a/src/pages/admin/EntityList.tsx b/src/pages/admin/EntityList.tsx index 209d965..ed74ffe 100644 --- a/src/pages/admin/EntityList.tsx +++ b/src/pages/admin/EntityList.tsx @@ -1,5 +1,5 @@ /* ═══════════════════════════════════════════════════════════════ - ADMIN — ENTITY LIST + ADMIN: ENTITY LIST One component for organizations, events and people. The :entity route param picks the manifest; nothing here knows what a @@ -7,8 +7,8 @@ The "New X" link follows the same rule as EntityEdit's save button: atLeast(user, "editor"), matching requireRole("editor") - on POST /api/admin/:entity. Drawing it is not permission — the - server decides — it only avoids offering a click that 403s, and + on POST /api/admin/:entity. Drawing it is not permission (the + server decides); it only avoids offering a click that 403s, and avoids hiding one that wouldn't. ═══════════════════════════════════════════════════════════════ */ @@ -34,7 +34,7 @@ export default function EntityList() { const [query, setQuery] = useState(params.get("q") ?? ""); // Minimum rank, never equality. POST /api/admin/:entity is gated - // at "editor", so anyone from editor upward may create — and the + // at "editor", so anyone from editor upward may create, and the // equality test this replaced hid the button from superadmins as // well as editors, which is the failure mode an == against a // ladder always produces once a rank is added above it. @@ -178,8 +178,8 @@ export default function EntityList() { {column.widget === "bool" ? row[column.key] ? "Yes" - : "—" - : row[column.key] || "—"} + : "-" + : row[column.key] || "-"} ))} {row.id} diff --git a/src/pages/admin/RequireRole.tsx b/src/pages/admin/RequireRole.tsx index 7f63742..9167fed 100644 --- a/src/pages/admin/RequireRole.tsx +++ b/src/pages/admin/RequireRole.tsx @@ -1,11 +1,11 @@ /* ═══════════════════════════════════════════════════════════════ - ROLE GUARD — src/pages/admin/RequireRole.tsx + ROLE GUARD: src/pages/admin/RequireRole.tsx Sits inside RequireAuth, never instead of it: by the time this renders, the session question has already been answered. All this decides is whether the answer was good enough. - Same caveat as RequireAuth — this hides the interface, not the + Same caveat as RequireAuth: this hides the interface, not the data. /api/admin/panel/* is superadmin-only on the server, and that's the part that matters. Without it, a bookmarked URL and a disabled select would be the only thing between a viewer and diff --git a/src/pages/admin/adminNav.ts b/src/pages/admin/adminNav.ts index 4b034ec..01e9648 100644 --- a/src/pages/admin/adminNav.ts +++ b/src/pages/admin/adminNav.ts @@ -1,9 +1,9 @@ /* ═══════════════════════════════════════════════════════════════ - ADMIN NAVIGATION — src/pages/admin/adminNav.ts + ADMIN NAVIGATION: src/pages/admin/adminNav.ts Lifted out of AdminLayout because two things read it now: the header tabs and the card grid on the home page. Adding an entity - stays one entry here plus a descriptor — there's still no second + stays one entry here plus a descriptor; there's still no second list to keep in step, it just isn't inside the layout file any more. @@ -32,8 +32,8 @@ export const AREA_TITLES = { }; /* The CMS tabs. Teams and Awards live under Organizations because - that's where they belong conceptually — a team is part of an org, - an award is given by one — even though each is its own table and + that's where they belong conceptually (a team is part of an org, + an award is given by one), even though each is its own table and its own page. */ export const CMS_NAV = [ { @@ -44,7 +44,7 @@ export const CMS_NAV = [ { to: "/admin/organizations", label: "Organizations", - blurb: "Regions, chapters and partners — plus the teams and awards they own.", + blurb: "Regions, chapters and partners, plus the teams and awards they own.", children: [ { to: "/admin/organizations", label: "All organizations" }, { to: "/admin/teams", label: "Teams" }, @@ -64,7 +64,7 @@ export const CMS_NAV = [ label: "Timeline", blurb: "What the history page shows, and the order it shows it in.", }, - // One record, not a list — the tab opens it directly. + // One record, not a list: the tab opens it directly. { to: "/admin/front_page", label: "Front page", @@ -89,7 +89,7 @@ export const FORMS_NAV = { ], }; -/* Accounts and server state, not content — which is why it sits +/* Accounts and server state, not content, which is why it sits outside the CMS rather than as another tab within it. */ export const PANEL_NAV = { to: ADMIN_PANEL, diff --git a/src/pages/sections/QrCodeMaker.tsx b/src/pages/sections/QrCodeMaker.tsx index 25b53e1..8495f37 100644 --- a/src/pages/sections/QrCodeMaker.tsx +++ b/src/pages/sections/QrCodeMaker.tsx @@ -98,7 +98,7 @@ function groupsFor(kind: Kind, directory: Directory | null): Group[] { { choices: directory.teams.map((t) => ({ path: teamHref(t.id), - label: `${t.name} — ${t.org_name}`, + label: `${t.name} (${t.org_name})`, })), }, ] diff --git a/src/pages/sections/home/HeroStage.tsx b/src/pages/sections/home/HeroStage.tsx index de71fdf..172f585 100644 --- a/src/pages/sections/home/HeroStage.tsx +++ b/src/pages/sections/home/HeroStage.tsx @@ -6,8 +6,8 @@ Backdrop, what fills the background: - brand drifting colour and slow concentric rings — many - circles, one centre — with the dove at that centre + brand drifting colour and slow concentric rings (many + circles, one centre) with the dove at that centre photos the hero photos, crossfading with a slow zoom, a progress bar per photo and a pause button (anything that moves on its own for more than five seconds