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

@ -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() {
</h1>
{/* 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)) && (
<div className="mt-6 rounded-2xl border border-[#138ba0]/20 bg-white p-5">
{children