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 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-26 19:38:24 -05:00
parent e35d09b172
commit 54bf649b8d
31 changed files with 239 additions and 187 deletions

View file

@ -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).