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

@ -8,13 +8,15 @@
nested paths ('region.scope') match the side-table keys.
Adding a field is one entry. Adding an entity is one object here
plus one descriptor on the server — no new page component.
plus one descriptor on the server, with no new page component.
A value seeded in a repeater's `blank` must also be declared as
a default: on the matching server column, or a row the user adds
and never fills in reads as real input instead of being skipped.
═══════════════════════════════════════════════════════════════ */
import { preview } from "./text.ts";
const PLACE_FIELDS = [
{ path: "venue", label: "Venue" },
{ path: "address", label: "Address", full: true },
@ -36,17 +38,17 @@ const PUBLISH_FIELDS = [
{ path: "sort_order", label: "Sort order", widget: "number" },
];
/* The parts of an affiliation that read the same from either end —
/* The parts of an affiliation that read the same from either end:
the person's list of roles, and the team's list of members. */
const AFFILIATION_ROLE_FIELDS = [
{ path: "title", label: "Title", help: "Board Chair, Chapter Lead" },
{ path: "title", label: "Title", help: "eg. Board Chair, Team Lead" },
{
path: "role",
label: "Role",
widget: "select",
options: ["lead", "board", "staff", "volunteer", "member"],
},
{ path: "is_owner", label: "Owner", widget: "checkbox", help: "Listed first" },
{ path: "is_owner", label: "Owner", widget: "checkbox", help: "Listed first (can be more than one)" },
{ path: "started_on", label: "Started", widget: "date" },
{ path: "ended_on", label: "Ended", widget: "date", help: "Blank means current" },
{ path: "is_public", label: "Public", widget: "checkbox" },
@ -57,7 +59,7 @@ const AFFILIATION_ROLE_FIELDS = [
'region.scope' and 'private.notes' are.
Everything here is an override. Left blank, the history page falls
back to the record's own title, date and logo through v_timeline —
back to the record's own title, date and logo through v_timeline,
which is the point of referencing rather than copying. */
const timelineExtensionFields = (noun) => [
{
@ -105,7 +107,7 @@ const timelineExtensionFields = (noun) => [
const timelineGroup = (noun) => ({
legend: "Timeline",
note:
`Adds this ${noun} to the history page. Nothing is copied — the entry ` +
`Adds this ${noun} to the history page. Nothing is copied, the entry ` +
`reads this record, so editing it here updates the timeline too.`,
fields: [
{
@ -146,7 +148,7 @@ const linksChild = {
};
/* Hosts. One row is one host, ordered, and each is either an
organization or a person — never both, which the CHECK on
organization or a person, never both, which the CHECK on
event_hosts enforces and this form can only ask nicely about.
The first row supplies the logo and colour when the event sets
@ -169,15 +171,16 @@ const hostsChild = {
label: "Organization",
widget: "select",
optionsFrom: "organizations",
blankLabel: "— none —",
blankLabel: "Default: none",
help: "Host Organization"
},
{
path: "person_id",
label: "Person",
widget: "select",
optionsFrom: "people",
blankLabel: "— none —",
help: "One or the other, not both. First host supplies the logo and colour.",
blankLabel: "Default: none",
help: "Use if the host is an individual, choose between person and org host, not both.",
},
],
};
@ -186,7 +189,7 @@ const blocksChild = {
key: "content_blocks",
label: "Content blocks",
addLabel: "Add block",
title: (row) => `${row.type ?? "block"} — ${(row.text ?? "").slice(0, 40) || "empty"}`,
title: (row) => `${row.type ?? "block"}: ${preview(row.text, 40) || "empty"}`,
blank: { slot: "body", type: "paragraph", text: "" },
fields: [
{ path: "slot", label: "Slot", widget: "select", options: ["card", "body"] },
@ -231,7 +234,7 @@ const organizations = {
key: "organizations",
label: "Organizations",
singular: "organization",
idLabel: "Slug",
idLabel: "URL ID",
slugFrom: "name",
list: {
@ -264,7 +267,7 @@ const organizations = {
{ path: "short_name", label: "Short name" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "color", label: "Colour", widget: "color" },
{ path: "logo", label: "Logo", help: "Filename in public/org-logos/" },
{ path: "logo", label: "Logo", help: "Filename in /org-logos/" },
],
},
{
@ -290,7 +293,7 @@ const organizations = {
label: "Region",
widget: "select",
optionsFrom: "regions",
blankLabel: "— none —",
blankLabel: "Default: none",
},
{ path: "chapter.meets", label: "Meets", help: "2nd Sundays, 6:00pm" },
{ path: "chapter.started", label: "Started", help: "Since 2021" },
@ -311,16 +314,16 @@ const organizations = {
title: (row) => row.area_code || "New area",
blank: { area_code: "", share: 1 },
fields: [
{ path: "area_code", label: "Area code", required: true, help: "WA, CA, CANADA" },
{ path: "area_code", label: "Area code", required: true, help: "Two letter state code or Country name" },
{ path: "share", label: "Share", widget: "number", help: "1 for the whole tile, 0.5 for half" },
{
path: "edge",
label: "Edge",
widget: "select",
options: ["top", "bottom"],
blankLabel: "— whole tile —",
blankLabel: "Default: whole tile",
},
{ path: "note", label: "Note", help: "north, Salt Lake City area" },
{ path: "note", label: "Note", help: "details to explain why it's half or other note" },
],
},
linksChild,
@ -331,8 +334,8 @@ const organizations = {
/* ── Events ──────────────────────────────────────────────────── */
/* The panel the Series checkbox opens. Starts and Ends above stay
the series' bounds — the first meeting and the last day it can
meet — so nothing here repeats them. */
the series' bounds (the first meeting and the last day it can
meet), so nothing here repeats them. */
const SERIES_WEEKDAYS = [
["sun", "Sunday"],
["mon", "Monday"],
@ -358,10 +361,10 @@ const seriesGroup = {
widget: "select",
options: [
["weekly", "Weekly, on the days ticked below"],
["monthly_date", "Monthly, on the start date's day (the 13th)"],
["monthly_weekday", "Monthly, on the start date's weekday (2nd Tuesday)"],
["monthly_date", "Monthly, on the day of the start date (eg. the 13th)"],
["monthly_weekday", "Monthly, on the weekday of the start date (eg. 2nd Tuesday)"],
],
blankLabel: "— weekly —",
blankLabel: "Default: weekly",
},
{
path: "series_interval",
@ -390,7 +393,7 @@ const events = {
key: "events",
label: "Events",
singular: "event",
idLabel: "Slug",
idLabel: "URL ID",
slugFrom: "title",
list: {
@ -424,7 +427,7 @@ const events = {
widget: "select",
optionsFrom: "event_scopes",
required: true,
help: "Whose gathering this is. Only national, regional and partner appear on the Retreats page",
help: "Whose gathering this is.",
},
{
path: "event_type",
@ -447,20 +450,20 @@ const events = {
{
path: "date_label",
label: "Date label",
help: "What the card shows — 'March/April 2026' is fine here",
help: "Text override of what the card shows (eg. March/April 2026)",
},
{
path: "status",
label: "Status",
widget: "select",
options: ["upcoming", "past", "cancelled"],
blankLabel: "— derive from end date —",
blankLabel: "Default: derive from end date",
},
{
path: "is_series",
label: "Series",
widget: "checkbox",
help: "Repeats on a schedule — a weekly class, a monthly meeting",
help: "Repeats on a schedule, such as a weekly class, a monthly meeting",
},
],
},
@ -469,7 +472,7 @@ const events = {
{
legend: "Appearance",
fields: [
{ path: "event_logo", label: "Event logo", help: "Filename in public/event-logos/" },
{ path: "event_logo", label: "Event logo", help: "Filename in /event-logos/" },
{ path: "org_logo", label: "Org logo override" },
{ path: "color", label: "Colour", widget: "color" },
{ path: "gradient", label: "Gradient", full: true },
@ -511,7 +514,7 @@ const events = {
"attendee",
],
},
{ path: "title", label: "Title", help: "Keynote Speaker" },
{ path: "title", label: "Title", help: "eg. Keynote Speaker" },
{ path: "is_public", label: "Show on the site", widget: "checkbox" },
],
},
@ -526,7 +529,7 @@ const people = {
key: "people",
label: "People",
singular: "person",
idLabel: "Slug",
idLabel: "URL ID",
slugFrom: "display_name",
list: {
@ -549,13 +552,13 @@ const people = {
{ path: "sort_name", label: "Sort name", help: "Doe, Jane" },
{ path: "pronouns", label: "Pronouns" },
{ path: "tagline", label: "Tagline", full: true },
{ path: "photo", label: "Photo", help: "Filename in public/people/" },
{ path: "photo", label: "Photo", help: "Filename in /people/" },
{
path: "primary_org_id",
label: "Home organization",
widget: "select",
optionsFrom: "organizations",
blankLabel: "— none —",
blankLabel: "Default: none",
help: "Optional. Shown above their bio",
},
{
@ -591,7 +594,7 @@ const people = {
},
{
legend: "Publishing",
note: "Unpublished people are invisible everywhere, including as chapter leads.",
note: "Unpublished people are invisible everywhere.",
fields: [PUBLISHED_FIELD],
},
],
@ -622,7 +625,7 @@ const people = {
label: "Team",
widget: "select",
optionsFrom: "teams",
blankLabel: "— none —",
blankLabel: "Default: none",
// A team belongs to an org; offering one from another
// org would fail the composite foreign key on save.
filterBy: (option, row) => option.org_id === row.org_id,
@ -652,7 +655,7 @@ const people = {
label: "Presented at",
widget: "select",
optionsFrom: "events",
blankLabel: "— none —",
blankLabel: "Default: none",
},
{ path: "awarded_on", label: "Date", widget: "date" },
{ path: "citation", label: "Citation", widget: "textarea", full: true },
@ -670,7 +673,7 @@ const teams = {
key: "teams",
label: "Teams",
singular: "team",
idLabel: "Slug",
idLabel: "URL ID",
// teams.id is a global primary key, not scoped to the org, so
// 'board' can only exist once across the whole site. Composing
// the slug from both fields is what keeps NGU's board and the
@ -694,7 +697,7 @@ const teams = {
{
legend: "Identity",
note:
"Pick the organization first: the slug is built from it, " +
"Pick the organization first: the id is built from it, " +
"and it can't be changed once anyone is filed under this team.",
fields: [
{
@ -708,7 +711,7 @@ 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: "logo", label: "Logo", help: "Filename in public/org-logos/" },
{ path: "logo", label: "Logo", help: "Filename in /org-logos/" },
],
},
{ legend: "Publishing", fields: PUBLISH_FIELDS },
@ -749,7 +752,7 @@ const awards = {
key: "awards",
label: "Awards",
singular: "award",
idLabel: "Slug",
idLabel: "URL ID",
slugFrom: "name",
list: {
@ -777,7 +780,7 @@ const awards = {
label: "Awarded by",
widget: "select",
optionsFrom: "organizations",
blankLabel: "— unattributed —",
blankLabel: "- unattributed -",
help: "The organization that gives this award",
},
{ path: "name", label: "Name", required: true },
@ -843,7 +846,7 @@ const timeline = {
note:
"An entry either points at a record or stands on its own. " +
"Pointing at one means its title, date and logo come from that " +
"record \u2014 nothing is copied, so editing the record updates this.",
"record and nothing is copied, so editing the record updates this.",
fields: [
{
path: "kind",
@ -858,15 +861,15 @@ const timeline = {
label: "Points at",
widget: "select",
options: ["event", "organization", "award", "person", "team"],
blankLabel: "\u2014 nothing, this stands alone \u2014",
help: "Changing this leaves the record below orphaned \u2014 pick a new one",
blankLabel: "Default: nothing",
help: "Changing this leaves the record below orphaned, pick a new one",
},
{
path: "ref_id",
label: "Record",
widget: "select",
optionsFrom: "timeline_refs",
blankLabel: "\u2014 none \u2014",
blankLabel: "Default: none",
// One flat list of every referenceable row, narrowed to the
// kind chosen above. Five dropdowns of which four are always
// wrong would be worse.
@ -879,7 +882,7 @@ const timeline = {
legend: "When",
note:
"Blank takes the referenced record's own date. Precision is what " +
"says how much of the date to believe \u2014 a backfilled entry that " +
"says how much of the date to believe, a backfilled entry that " +
"only knows the year should say so.",
fields: [
{
@ -927,7 +930,7 @@ const timeline = {
addLabel: "Add person",
note:
"For an entry about people. A 'people' entry pointing at a team " +
"already shows that team's members \u2014 this is for the cases where " +
"already shows that team's members, this is for the cases where " +
"the list is editorial rather than structural.",
title: (row, options) =>
options?.people?.find((p) => p.id === row.person_id)?.label ?? "New person",
@ -959,23 +962,23 @@ const timeline = {
what the page and the API key on. */
const FRONT_PAGE_SECTIONS = [
["countdown", "Countdown to the next event"],
["retreats", "National Retreats carousel"],
["calendar", "Event calendar"],
["stats", "Numbers"],
["timeline", "Featured timeline"],
["connect", "Find your way in"],
["countdown", "Event Countdown"],
["retreats", "Events Carousel (National Retreats)"],
["calendar", "Event Calendar"],
["stats", "Stats"],
["timeline", "Featured Timeline"],
["connect", "Connect Nav"],
];
const STAT_SOURCES = [
["manual", "Typed in — shows Value"],
["years_since", "Years since — Value is the year"],
["regions", "Count: published regions"],
["chapters", "Count: published chapters"],
["partners", "Count: published partners"],
["manual", "Print Value Field"],
["years_since", "Years Since Value"],
["regions", "Count: regions"],
["chapters", "Count: chapters"],
["partners", "Count: partners"],
["events_held", "Count: past events"],
["retreats_held", "Count: past retreats"],
["people", "Count: published people"],
["people", "Count: people in database"],
["awards_given", "Count: public awards given"],
];
@ -990,7 +993,7 @@ const frontPage = {
groups: [
{
legend: "Hero",
legend: "Hero - Primary Section",
note: "The first thing a visitor sees. Blank buttons don't render.",
fields: [
{
@ -998,29 +1001,29 @@ const frontPage = {
label: "Background",
widget: "select",
options: [
["brand", "Brand — animated colour and the dove"],
["photos", "Photos — cycles through the photos below"],
["brand", "Brand: animated colour and the dove"],
["photos", "Photos: cycles through the photos below"],
],
blankLabel: "— brand —",
blankLabel: "Default: brand",
help: "Photos with none added shows the brand background",
},
{
path: "hero_feature",
label: "Beside the words",
label: "Feature",
widget: "select",
options: [
["none", "Nothing — the words fill the hero"],
["livestream", "Livestream — the stream, with a LIVE badge"],
["video", "Featured video — click to play"],
["none", "Nothing: No additional overlay"],
["livestream", "Livestream: the stream, with a LIVE badge"],
["video", "Featured video: click to play"],
],
blankLabel: "— nothing —",
blankLabel: "Default: nothing",
help: "Switch to Livestream when you go live, and back when you're done",
},
{ path: "eyebrow", label: "Eyebrow", help: "Small line above the headline" },
{ path: "headline", label: "Headline", full: true },
{ path: "subhead", label: "Subhead", widget: "textarea", full: true },
{ path: "primary_label", label: "Main button label" },
{ path: "primary_url", label: "Main button link", help: "/retreats, #connect or a full URL" },
{ path: "primary_url", label: "Main button link", help: "/page, #section-id or a full URL" },
{ path: "secondary_label", label: "Second button label" },
{ path: "secondary_url", label: "Second button link" },
],
@ -1032,7 +1035,7 @@ const frontPage = {
path: "slide_seconds",
label: "Seconds per photo",
widget: "number",
help: "Photos mode. 3 to 60",
help: "Photos Background. Set from 3 to 60 seconds",
},
{
path: "livestream_url",
@ -1047,7 +1050,7 @@ const frontPage = {
full: true,
help:
"A YouTube, Vimeo or Facebook link, or a video file: a filename in " +
"public/front-page/ or a link ending in .mp4 or .webm",
"/front-page/ or a link ending in .mp4 or .webm",
},
{ path: "video_title", label: "Video title", full: true, help: "Shown after \"Featured video\" above the headline" },
],
@ -1060,7 +1063,7 @@ const frontPage = {
label: "Count down to",
widget: "select",
optionsFrom: "events",
blankLabel: "— the next upcoming event —",
blankLabel: "Default: the next upcoming event ",
help: "Leave blank almost always. A pinned event that's over falls back to the next one",
},
],
@ -1084,7 +1087,7 @@ const frontPage = {
options: FRONT_PAGE_SECTIONS,
required: true,
},
{ path: "title", label: "Heading", help: "Blank for the section's own" },
{ path: "title", label: "Heading", help: "Heading Override" },
{ path: "blurb", label: "Blurb", full: true },
{ path: "is_hidden", label: "Hidden", widget: "checkbox", help: "Hide for now" },
],
@ -1097,7 +1100,7 @@ const frontPage = {
title: (row) => row.caption || row.media || "New photo",
blank: { media: "", alt: "", caption: "" },
fields: [
{ path: "media", label: "Photo", required: true, help: "Filename in public/front-page/, or a URL" },
{ path: "media", label: "Photo", required: true, help: "Filename in /front-page/, or a URL" },
{ path: "alt", label: "Description", help: "For screen readers" },
{ path: "caption", label: "Caption", full: true },
{ path: "link_url", label: "Link", help: "Optional; makes the caption a link" },
@ -1114,26 +1117,26 @@ const frontPage = {
{ path: "label", label: "Label", required: true },
{
path: "source",
label: "Where it comes from",
label: "Number Source",
widget: "select",
options: STAT_SOURCES,
blankLabel: "— typed in —",
blankLabel: "Default: Print Value",
},
{ path: "value", label: "Value", help: "Typed in: the number. Years since: the year" },
{ path: "value", label: "Value", help: "The number thats printed" },
{ path: "suffix", label: "Suffix", help: "+, k, % …" },
{ path: "note", label: "Note", full: true },
],
},
{
key: "paths",
label: "Find your way in",
label: "Connect Nav",
note: "Each path is a choice a visitor can pick; its actions appear when they do.",
addLabel: "Add path",
title: (row) => [row.icon, row.label].filter(Boolean).join(" ") || "New path",
blank: { label: "", icon: "", blurb: "" },
fields: [
{ path: "label", label: "Label", required: true, help: "Attend, Serve…" },
{ path: "icon", label: "Icon", help: "One emoji" },
{ path: "label", label: "Label", required: true, help: "eg. Attend, Serve…" },
{ path: "icon", label: "Icon", help: "Emoji" },
{ path: "blurb", label: "Blurb", full: true },
],
children: [