Skip to content

Word every sign-up and edit-page error from the catalog - #918

Merged
richshaw merged 105 commits into
mainfrom
claude/issue-631-client-error-text
Nov 16, 2026
Merged

richshaw merged 105 commits into
mainfrom
claude/issue-631-client-error-text

Conversation

@richshaw

@richshaw richshaw commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Fixes #631. This is the second part, the client's: the sign-up dialog and the edit form pick an error's text by its code and details.reason (from #917), in the signup's language, and never show the server's message or suggestion. The client's own fallbacks are catalog messages too.

Merge after #917.

The stack

PR 28 of the localization stack (#619). Based on #917 (claude/issue-631-error-reasons); review against that branch.

The problem

participantErrorCopy returned null for anything it had no copy for, and both forms then showed the server's English: "Email is required for this signup.", Zod's "Invalid email" and "Number must be less than or equal to 999", Check the value of "…"., and on the edit page "too many requests", "invalid edit token" and "commitment is not active". Where the server sent no message, the forms showed words typed into the client: 'save failed', 'cancel failed', 'something went wrong' and 'network error'. None of it could be translated.

The fix

  • input-message.ts (replaces name-message.ts): an invalid_input is worded by its details.reason. A reason it doesn't know, or none (a body over the size limit, an input the forms never send), gets the code's own line. The name keeps its current message for both name reasons.
  • participantErrorCopy always answers now (ParticipantErrorCopy, not | null), and takes 'join' | 'save' | 'cancel' instead of 'join' | 'change', because anything without copy of its own says which of the three didn't happen. It takes an error, never none: an answer that isn't the API's error is each form's to word (below). On the edit page it now words the rate limit (the dialog's message), and a conflict or forbidden (conflictMessage takes the page). Its error type has no message or suggestion, and nor does the dialog's, so neither can be rendered by mistake.
  • An answer that isn't the API's error says nothing about what happened (from review round 1). Every error the API sends has a code, and comes after it has undone anything it began, so its copy may say the sign-up, save or cancel didn't happen. An answer without one (an error page from a proxy, JSON with no error, or an error that isn't ours) may arrive after the server did it, so the dialog says "Something went wrong." / "Press Confirm again." (participant.dialog.unreadable), and the edit form "Something went wrong. Press Save again." or "…Press Cancel signup again." (editForm.saveUnreadable, editForm.cancelUnreadable). Pressing again does no harm: Confirm with the same details sends the same idempotency key and gets that sign-up back (A sign-up without an email can be booked twice by a retry #387), a second save sends the same values, and cancelling a cancelled spot succeeds.
  • A dropped connection on the edit page says nothing about what happened either (round 2). Take the edit, cancel and unsubscribe pages' text from the catalog #916's lines said the change wasn't saved or cancelled, but a connection can drop after the server did it. Like the sheet's, they now say to check the connection and press the same button again: "Couldn't reach the server. Check your connection and press Save again." and "…press Cancel signup again." (editForm.saveUnreachable, editForm.cancelUnreachable, same keys).
  • The dialog keeps the copy itself in state (with whether to offer other slots), not the server's error. It now tells a dropped connection (fetch rejects) from an answer that isn't the API's: both used to say "network error". It marks the email box required on details.reason === 'email_required' rather than on field.
  • The edit form: an API error with no copy of its own gets participant.errors.failed.save or failed.cancel + failed.tryAgain; editForm.saveUnreadable keeps its key for the unreadable answer, with the new wording above.
  • Catalogs: new keys in participant.errors (email.*, notes, quantity, input, conflict.change, failed.*), participant.dialog.unreachable and .unreadable, and participant.editForm.cancelUnreadable, in English and Swedish. Swedish follows Add a partial Swedish catalog and a Swedish test signup #914's terms (anmälningslista, pass, plats, avboka, "du"; the field labels "Kommentar", "Platser").
  • CHANGELOG (Changed) lists every wording below; Name the case of a refused sign-up or edit in details.reason #917's Added line no longer says the pages show the same text. CLAUDE.md's errors.ts bullet points at participantErrorCopy. quantity_not_whole's doc comment now says it covers a quantity that isn't a number at all (from Name the case of a refused sign-up or edit in details.reason #917's review).

What participants see now (English)

Where they already saw catalog text (a blank or long name, capacity, closed, deleted, a second sign-up, the dialog's rate limit), it's byte-identical.

Case Where Before After
Signup started asking for an email after the page loaded dialog Email is required for this signup. / Add your email and try again. This signup now needs an email address. / Add yours and try again.
Email that isn't an address (pat@localhost, which the browser takes) dialog Invalid email / Check the value of "email". That email address doesn't look right. / Check it and try again.
Notes over 500 characters (the box stops it; other clients) both String must contain at most 500 character(s) Shorten your notes to 500 characters or fewer.
Spots under 1, over 999, or not a whole number (the box stops it) both Number must be less than or equal to 999 (and Zod's others) Enter a whole number of spots, from 1 to 999.
Any other refused input (request too large, a reason it doesn't know) both request body too large / Send a smaller request. Check what you entered and try again.
Never reached the server dialog network error Couldn't reach the server. / Check your connection and try again.
Server error, or a code it doesn't know, from the API dialog something went wrong Something went wrong, so you're not signed up yet. / Try again.
An answer that isn't the API's error (a proxy's error page, which can arrive after the sign-up was made) dialog network error Something went wrong. / Press Confirm again.
Rate limited edit page too many requests Too many tries just now. Try again in about N minutes. (the dialog's)
A no-show, or a link that no longer opens the sign-up edit page commitment is not active / invalid edit token This spot can't be changed any more. Reload the page to see what has changed.
Server error, or a code it doesn't know, from the API Save something went wrong, or save failed Something went wrong, so your changes weren't saved. Try again.
An answer that isn't the API's error Save Something went wrong, so your changes weren't saved. Try again. Something went wrong. Press Save again.
Server error, or a code it doesn't know, from the API Cancel something went wrong, or cancel failed Something went wrong, so your spot wasn't cancelled. Try again.
An answer that isn't the API's error Cancel cancel failed Something went wrong. Press Cancel signup again.
No answer (offline, or the connection dropped, perhaps after the server saved) Save Couldn't reach the server, so your changes weren't saved. Check your connection and try again. Couldn't reach the server. Check your connection and press Save again.
No answer (offline, or the connection dropped, perhaps after the server cancelled) Cancel Couldn't reach the server, so your spot wasn't cancelled. Check your connection and try again. Couldn't reach the server. Check your connection and press Cancel signup again.

Choices to judge: neither the dropped-connection lines (the dialog's and the edit page's) nor the lines for an answer that isn't the API's say whether the sign-up, save or cancel went through, since the answer can be lost or replaced after the server did it. Each says to press the same button again, which does no harm. The dialog's line doesn't promise "you won't be signed up twice", because that's only true if nothing in the form changes first. The edit page's no-show and bad-link cases share one message, because reloading shows the edit link's not-found page, which explains both. "Enter a whole number of spots, from 1 to 999." is left as is for the owner: the tophat suggested splitting it ("1 or more" for 0 and fractions, "You can ask for up to 999 spots." for 1000).

Swedish

"Den här anmälningslistan kräver nu en e-postadress." / "Fyll i din e-postadress och försök igen."; "E-postadressen ser inte rätt ut." / "Kontrollera den och försök igen."; "Korta kommentaren till högst 500 tecken."; "Ange ett helt antal platser, från 1 till 999."; "Kontrollera det du har fyllt i och försök igen."; "Din plats går inte att ändra längre."; "Det gick inte att nå servern." / "Kontrollera anslutningen och försök igen."; "Något gick fel, så du är inte anmäld än." / "…så dina ändringar sparades inte." / "…så din plats avbokades inte." + "Försök igen."; for an answer that isn't the API's, "Något gick fel." / "Tryck på Bekräfta igen.", "Något gick fel. Tryck på Spara igen." and "Något gick fel. Tryck på Avboka igen."; for a save or cancel with no answer, "Det gick inte att nå servern. Kontrollera anslutningen och tryck på Spara igen." and "…tryck på Avboka igen." (were "Det gick inte att nå servern, så dina ändringar sparades inte. …" and "…, så din plats avbokades inte. …"). Machine-made, for #639's review.

Tests

  • input-message.test.ts: each of the 8 reasons in English and in Swedish (the real catalog); an unknown reason, none, and a size-limit error get the code's line; stand-in translator; the server's text never in the copy; other codes left alone.
  • participant-error.test.ts: each code on each page; the fallback for an unknown code, a capacity error without numbers and an error with no code, in all three contexts and in Swedish; a distinctive server message and suggestion fed for every code the two endpoints send, in English and Swedish, never in the copy.
  • conflict-message.test.ts: the edit page's conflict and forbidden, both languages' keys.
  • commit-dialog.test.tsx: email reasons, an unknown reason, internal and an unknown code each worded by the sheet with a distinctive server text absent; an answer that isn't JSON, JSON without an error, JSON whose error isn't the API's and an error with no code get the no-claim line, never "signed up"; Confirm after such an answer sends the same idempotency key; email_required still marks the box required; stand-in Swedish for a refused input, the fallback, the unreadable answer and the network case.
  • edit-form.test.tsx: save and cancel refusals by code (internal, unknown code, rate limit, forbidden, no-show, quantity, notes, size limit) with the server's text absent; no code, and no JSON, for Save and Cancel get the no-claim lines; a dropped connection on Save and Cancel gets the no-claim lines, in English and from the real Swedish catalog, never "saved"/"cancelled" or "sparades"/"avbokades"; Swedish from the real catalog and stand-in keys.
  • e2e: public-commit sends a fresh address at localhost to the real server and checks the sheet's words, checks the lost-answer test's new text, and answers a first Confirm with a proxy's HTML 504 after the sign-up was made: the sheet says exactly "Something went wrong. Press Confirm again.", and the second Confirm gives back the first sign-up's link. swedish-signup does the refused address on the Swedish signup, and checks the edit page's rate limit, server error and a proxy's 502 in Swedish. Addresses the server refuses are new each run (pat+${Date.now()}@localhost), so local reruns don't hit the per-address limit; the 504 test sends from its own documentation-range IP, so the four specs stay within the shared per-IP limit.
  • Each fails without its piece (run one at a time): dropping the email_invalid case (4 tests), a quantity case (1), the fallback showing the server's message (8), conflictMessage's edit-page branch (7), the dialog's .catch on res.json() (1), the email_required check (1), Cancel using Save's context (2), the rate limit only on sign-up (4), the dialog's network copy (4); the dialog's no-claim branch (6), the edit form's (6); the edit form's old dropped-connection wording (4: Save and Cancel, English and Swedish).
  • Ran on 3749e69 (round 2's dropped-connection lines): pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test (209 files, 2884 passed, 1 expected fail), pnpm build && pnpm budgets (pass; /s/[slug]/c/[id] still 113,395 B, the catalogs don't ship in the page's JavaScript), and on the production build the e2e specs edit-token and swedish-signup (17 passed).
  • Ran on 9242a0f: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test (209 files, 2882 passed, 1 expected fail), pnpm build && pnpm budgets (pass), and on the production build the e2e specs public-commit, commit-sheet, edit-token and swedish-signup (27 passed, then 27 passed again on an immediate rerun, with rate_limits left as it was). Earlier, on 57c8242: pnpm test:db (43 files, 773 passed), and e2e a11y and precompiled-messages. No help article or walkthrough names an error string.

Budgets (gzip, against #917's build at 3aebf1d)

Page Before After Budget
/s/[slug] 128,917 B 129,066 B (+149) 130.5 kB
/s/[slug]/c/[id] 113,275 B 113,395 B (+120) 113.5 kB (105 B left)
/ 129,945 B 130,096 B (+151) 131.5 kB
Preview 128,704 B 128,853 B (+149) 130.5 kB

No budget raised. Other pages moved by a few bytes either way.

Where #631 was out of date

Gate

UX: participants see new wording for the errors in the table above.

🤖 Generated with Claude Code

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

claude and others added 30 commits November 13, 2026 22:31
Part of #620: the core. next-intl and use-intl 4.14.9, pinned together
(icu-minify too, through an override), with next.config.mjs wrapped in
next-intl's plugin. src/messages/en.json is the English catalog, and
next-intl's AppConfig is typed from it, through the declaration the
plugin writes, so a missing key or a wrong argument fails typecheck.

src/i18n holds the pure locale config (CATALOG_LOCALES, SHIPPED), a
synchronous translator on use-intl/core with English filled in under
any other language, the server wrapper that logs what goes wrong, the
request config the plugin needs, and an English translator for tests
that throws.

The site footer's labels are the first text in the catalog, so the
translator is proven in a server component, on static and dynamic
pages. A new check runs it under the worker's toolchain. No page's
first-load JavaScript changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A local ESLint plugin in eslint.config.mjs, with one rule so far:
opensignup/no-catalogs-in-client. In a file that opens with a 'use client'
directive, it reports any import of a catalog in src/messages, or of the
translators that load every catalog (src/i18n/translator.ts, server.ts and
testing/translator.ts), since either would put that text in the browser's
JavaScript. It reads the directive rather than matching paths, follows
@/ and relative paths, re-exports, import(), require() and import paths
built from a template, and lets type-only imports through, since those are
compiled away. The message says why and what to do instead.

The tests lint fixtures through the repo's own config, so they also prove
the rule is on for the app's files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A unit test over src/messages/ checks every catalog against en.json:
completeness per namespace, enforced for each language in SHIPPED for the
namespaces its audience reads; every message compiles with icu-minify;
placeholders, tags and select branches match English, and each placeholder
takes the value English is passed; no key English lacks; and no English
message the app doesn't use.

Which keys the app uses comes from the type checker: a call whose signature
is use-intl's Translator, its namespace from the keys it accepts, its key
from the type of its argument, so helpers, props, aliases and typed tables
are all seen, and a key or namespace it can't read fails the check.

The audience namespaces move from a comment to AUDIENCE_NAMESPACES in
src/i18n/config.ts. src/types/next-intl.d.ts imports next-intl, because an
augmentation alone doesn't load its module: without it, code with no test
importing next-intl typed every message key as a plain string.

icu-minify is a devDependency at exactly 4.14.9, the version next-intl and
use-intl resolve, and the pnpm override now points at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Two rules, on only for the files and folders listed in TRANSLATED in
eslint.config.mjs, which so far is the site footer:

- react/jsx-no-literals with noStrings and ignoreProps, for JSX text;
- opensignup/no-literal-text-props, a local rule for a string on
  aria-label, aria-description, title, placeholder, alt or label.
  noAttributeStrings would also flag every className and href.

TRANSLATED takes paths as they are on disk. filesAt escapes them for
the config's globs, since an unescaped src/app/s/[slug]/** matches
src/app/s/s/ and not the [slug] folder, and stops lint when a path
doesn't exist. The footer's license line is exempt with a comment.

Also, from #891's review: no-catalogs-in-client follows a + chain that
starts with a string, as it does a template, and denies every module in
src/i18n/ to client files except those in CLIENT_SAFE_I18N (config),
rather than listing the modules that load catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A translation that kept a select's argument but dropped the select
(`Status: {status}` for English's `{status, select, open {Open} ...}`)
passed, and would show participants the code's value. The check now
reports `{status} isn't a select here, but is in English`.

From the same review:
- The check's program types translators against the en.json it just
  loaded, written over src/messages/en.d.json.ts, so a stale declaration
  no longer gives misleading lines. findUsedKeys now builds the program
  itself, and the fallback for a stale declaration is gone, with its edge
  case that could pick the wrong section. messages-declaration.test.ts
  still fails on a stale file.
- Code in any `testing` folder and in src/mcp/evals doesn't count as a use.
- `t?.('key')` is seen.
- A test for the dot-in-key check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Turn on next-intl's experimental message precompiling, so the first
client component with translated text ships a small formatter instead of
use-intl's ICU parser: measured here at 3,470 bytes gzipped against
12,353 without it.

Under precompile the plugin's loader compiles every catalog the Next
build imports, the server's too, and a message with an argument, plural
or tag becomes an array. withEnglishUnder treated every object as a
section and went into those arrays, so each such message would have
rendered as its key path in the web process while vitest and the worker,
which read the raw JSON, stayed green. A message is now a string or an
array, and only a section is merged into.

The footer's "{INSTANCE_NAME} · AGPL-3.0" line becomes a message with an
argument, the first the app has, and a production-build e2e checks it on
a prerendered page, a page rendered per request and the public signup
page. A unit test runs next-intl's own loader over every catalog and
checks each message formats the same precompiled as from the raw JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…ext-lint

Brings in #892's review fixes (a7a10ed) so this PR stays on top of #892's final state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
formatSlotDate and formatSlotTime now take the reader's language as a
required `locale`, and so does everything that prints a slot's values:
renderFieldValue, slotDetails, summarizeSlotValues, formatGroupLabel,
buildMetaSegments, prettyHeader, and the two commitment services that name a
slot for the edit and cancelled pages. Every caller passes 'en' for now, so
nothing anyone sees changes.

A date is built from its parts as a UTC moment and formatted in UTC, so no
zone can move it to another day. English keeps today's output exactly,
including the hand-written 12-hour clock with its no-break space before
AM/PM; other languages get Intl's own ("lör 3 maj", "18:30" in Swedish).

formatSlotDate now formats only a stored YYYY-MM-DD. It used to fall back to
`new Date()` for any other string, in the host's zone; no caller relied on
that, as both checked isRealDate first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
filesAt escaped the characters a glob reads specially but not the
backslash it escapes them with, so a listed folder named `a\b` became
the glob `a\b/**`, which matches `ab/` and not `a\b/`. The backslash is
now escaped in the same pass as the rest.

filesAt takes an optional root so a test can list a real folder with a
backslash in its name, made in a temporary directory, and check the glob
with ESLint's own matcher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…mpile

Brings in #893's later commits (#892's final code, main, and the filesAt escaping fix) so this PR stays on top of #893.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…-format

Keeps this PR on top of #894's current branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
main now holds #893 (7a9fada), whose final code this branch already had. The only conflict was the footer line #893 exempted from lint and this PR turns into a message; this branch's version is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…-format

Keeps this PR on top of #894's current branch, which now has main (#893) merged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Every formatter that named a language now takes the reader's as `locale`,
and every caller passes 'en' for now, so English reads exactly as before:

- format-duration: `formatDuration` and `waitInMinutes` write each amount
  with Intl (number, unit and plural), so "1 minute" and "2 timmar" both
  come out right. `locale` defaults to English, since some callers are
  sign-in and OAuth code that gets a language with its own text.
- fit-text: Magic Compose's cut-off warning writes its limit with
  Intl.NumberFormat.
- connected apps: the approval, last-use and expiry dates go through
  `formatGrantDate`, which keeps English in the day-first order the page
  has always shown.
- Magic Compose: `formatOneDay`, `appendAnswers` and `timeLength` take a
  locale, and `MagicComposeRoot` passes one down to Compose (the character
  count), Questions, Drafting and DraftingFrom. English times keep "9am";
  other languages get Intl's short time, as slot times do.

The participant rate-limit message now writes its plural in its own
sentence from `waitMinutes`, as Magic Compose's hourly-limit message does,
so the plural moves into the catalog with the sentence and Intl's unit
code stays out of the participant pages, which had 5 bytes of budget left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…er-formatters

Keeps this PR on top of #895's current branch, which now has main (#893, #894) merged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…le change

Part of #625. A signup can now hold a language in settings.locale, and an
operator can set DEFAULT_LOCALE. Nothing reads either yet, so pages, emails
and the AI connector's tools are unchanged.

- settings.locale is a lenient string, so a stored language that has left
  the list still parses. createSignup and updateSignup refuse a language the
  caller sends unless it has shipped to participants; updateSignup checks
  only a sent one, as it does for groupByFieldRefs, because it merges the
  stored settings under the patch before parsing.
- resolveLocale and defaultFor in src/i18n/config.ts, pure, with isShipped.
- DEFAULT_LOCALE in src/lib/env.ts, an optional enum of the catalog
  languages.
- locale joins UNREAD_SETTINGS, so update_signup refuses it and get_signup
  hides it until something reads it.
- .env.example, fly.example.toml, the README and the CHANGELOG say what it
  does, that it changes nothing until a second language ships, and where a
  runtime variable goes on each platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…anguage ships

The Settings tab gets a "Signup language" form, a plain form like "Ask for
an email address" with no script of its own. It renders only once a second
language has shipped to participants, so nothing shows yet. Each language is
named in itself (English, Svenska), through Intl.DisplayNames. Saving sends
only `locale` through updateSignup, which refuses a language that hasn't
shipped; a refusal shows the tab's usual error.

A signup with no language of its own shows the instance's, so
instanceDefaultLocale() comes in here with its first caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
TIME_ZONE moves from src/i18n/config.ts to its own src/i18n/time-zone.ts.
Browser code reaches it through src/lib/slot-label.ts (the Build tab's
time picker and Magic Compose), which made config.ts part of the code
those two share. Webpack counts a module's unused code when it decides
whether shared code gets a chunk of its own, so the language rules this
branch added to config.ts tipped it into making one. That chunk's entry
in the webpack runtime added 29 to 47 bytes to every page and pushed
/s/[slug]/c/[id] over its 110 kB budget. With config.ts out of the
browser's graph, every page's JavaScript is byte-for-byte the size it
was on the base branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…sent

A settings.locale longer than 35 characters (or not a string), written
straight into the database, failed the whole settings parse: the signup
asked for an email the organizer had turned off, and every settings save
failed on a field nobody sent. The schema now reads such a value as no
language (.catch(undefined)), so a stored value can never break the row,
and an unrelated save drops it.

createSignup and updateSignup check the raw value the caller sends
instead of the parsed one, so a too-long, non-string or unknown language
is still refused with invalid_input on settings.locale (now with the
service's own message, where a too-long one used to get zod's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The README, .env.example and CHANGELOG said a language "takes effect
only once OpenSignup ships it", with a Swedish school as the example,
which reads as "set sv now and it will start working later". In fact any
value but en stops the app: the worker exits at startup and every page
that needs the database fails with an "Invalid environment" error. They
now say that, tell operators to leave it unset for now, drop the
example, and put what an unset value means in the future tense, since
nothing reads an organizer's browser language yet. fly.example.toml
says the same in one line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
In a file of its own, the form was a second server module importing
AsyncSubmitButton, and webpack then added a few bytes to that button's
module on every page that loads it. Inline in page.tsx, every page's
first-load JavaScript is byte-identical to the base. The test now renders
the Settings tab itself, so it also checks the page shows the form, and
that "Saved" appears only by the form that saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
#896 merged, so main now holds this branch's base. The one conflict,
src/lib/slot-label.ts, is between #895 and #896 as squashed on main and
the same commits in this branch's history; main's copy equals #896's
head, so the branch's copy (with TIME_ZONE from its new module) stands.
The merged tree is identical to the branch's before the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…ettings-control

Takes #897's address round: TIME_ZONE out of config.ts, the lenient read of
a stored locale, and the docs on DEFAULT_LOCALE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
chooseOrganizerLocale takes the organizer's saved language, the instance's
DEFAULT_LOCALE and the browser's Accept-Language header (null where there is
no browser, as for MCP) and returns the first that has shipped to the
audience asked about, else English, with the step that chose it. Only the
browser's top-ranked range counts, so "sv,en;q=0.8" gives English until
Swedish ships rather than settling for the second choice.

It lives in its own file, away from server.ts (which the worker imports) and
from next/headers. The column, the session field and the request wrapper
come later.

Part of #626.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
getSignupRowBySlug reads the live signup at a slug in one statement,
skipping deleted rows and keeping drafts and archived ones, so the page can
still say which. getPublicSignup takes that row, or a slug as before for the
public API, and loadPublicSignup now gets its row from the new cached
loadSignupRowBySlug. A layout that reads the row too (a later part of #628)
then adds no statement to GET /s/[slug].

A unit test stands a per-request cache in for React's and checks the page's
read goes through loadSignupRowBySlug and hands getPublicSignup the row, not
the slug. The query-budget test says why it counts the page alone. Both page
budgets stay at 5 and 6.

Part of #628.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 3)

A light round on what changed since round 2's 3749e69: the merge that brought in main's #806 through #917, resolved in commit-dialog.tsx, and the new budget line. The resolution is right, and nothing has to change.

What I checked:

  • Own diff, before and after. git diff 56ce1b3 3749e69 against git diff a1fa37d 7b0d70e, ignoring index and hunk headers, differ only in commit-dialog.tsx (the capacity-message import, alternatives?: SlotAlternative[], the seeAlternatives line, and the removed render line now being #806's) and the added budgets.json line. Nothing else in the dialog moved.

  • The link matches main for every refusal. main shows it on offersAlternatives(error) at render. Here seeAlternatives: offersAlternatives(failure) is set once, from the same error object, when the refusal arrives (line 292), and the render reads the flag (line 617). An answer with no code gets no flag, and offersAlternatives returns false without a code, so that case agrees too. The words come from participantErrorCopy → capacityMessage, which asks the same function, so the words and the link can't disagree.

  • Tried in the sheet. Six throwaway dialog tests, not committed, counting links in the alert:

    • capacity_full, remaining: -1, with alternatives: link (the case #806 fixed);
    • capacity_full, remaining: 0, no alternatives: none;
    • capacity_full, remaining: 1, with alternatives: none;
    • closed with alternatives: none;
    • conflict with alternatives: none;
    • an error with no code: none.

    All six pass.

  • Budget. /s/[slug]/c/[id] 113.5 → 113.6 kB. The growth is main's (Next.js 15.5.29 and #806's shared rule), which the owner pre-approved.

Blocking (0): none.

Optional (1):

  • src/app/s/[slug]/commit-dialog.test.tsx line 1073: no committed dialog test holds the link to offersAlternatives. With the old inline check put back at commit-dialog.tsx line 292, all 59 dialog tests still pass, because the only link test uses remaining: 0. main has the same gap (#806 added tests for the rule, not the dialog), so it isn't this PR's. One case with remaining: -1 would close it; worth a small follow-up.

Round 2's four optional notes stand.

Earlier threads: all resolved (round 1's one thread).
Checks: CI is green on 7b0d70e (lint-type-test, e2e). Locally on 7b0d70e: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test pass (2892 passed, 1 expected fail); capacity-message, commit-dialog, participant-error and edit-form tests: 156 passed. The tophat marker is still on 3749e69; the light tophat look the prep comment asks for is separate from this review.

Gate: owner (UX), as before: the new error wording. The merge adds nothing new for the owner to look at.

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

Copy link
Copy Markdown
Owner Author

Tophat: passed (light, after the merge of #806)

Ran 7b0d70e locally with pnpm dev, Postgres 16, Chromium at 1280×900 and 390×844. I ran the same script against origin/main (bda7dfd, which has #806) in the same worktree and database. Each width on each build got its own made-up signups. A capacity-1 slot was filled, or the signup closed, through the API while the sheet was open, and then I pressed Confirm. I recorded the sheet's role="alert" text and whether See alternatives showed. remaining below 0 can't come from the server (it clamps at 0), so I faked that answer in the browser.

Case (sign-up sheet) Result 7b0d70e, desktop and phone main
Capacity-1 slot taken while the sheet was open, another slot open ✅ "Sorry, this slot just filled up. / Pick another slot." + See alternatives (links to /s/<slug>) same
The same, no other slot on the signup ✅ "Sorry, this slot just filled up." No suggestion, no link same
The same, the other slot already full ✅ "Sorry, this slot just filled up." No suggestion, no link same
Asked for 2 after someone took 4 of 5 (server sends alternatives, remaining 1) ✅ "Only 1 spot is left, and you asked for 2. / Ask for 1 instead." No link same
Faked capacity_full, remaining: -1, with alternatives ✅ Words and link together: "…Pick another slot." + See alternatives same
Faked capacity_full, remaining: 0, alternatives: [] ✅ "Sorry, this slot just filled up." No suggestion, no link same
Faked conflict carrying alternatives ✅ "You're already signed up for this slot. / Use the link in your confirmation email to change or cancel." No link same
Signup closed while the sheet was open ✅ "No one new can sign up for this slot now. / Reload the page to see what’s still open." No link same
An already closed signup's page ✅ "Closed / This signup is no longer collecting responses.", no Sign up buttons same
Invalid email the browser stops (not-an-email) ✅ Browser's own "Please include an '@'…", nothing sent, no alert same
Invalid email the server refuses (pat+…@localhost) ✅ "That email address doesn't look right. / Check it and try again." No link "Invalid email / Check the value of "email"." (this PR's intended change, as in its table)
Unit tests capacity-message, commit-dialog, participant-error ✅ 106 passed
Browser console ✅ Nothing beyond Chromium's "Failed to load resource" for each refused request

Apart from the server-refused email, which is this PR's own change, the English text and the link match main in every case, on desktop and phone. seeAlternatives: offersAlternatives(failure) gives the same answer as main's offersAlternatives(error), including for a negative remaining.

UX: nothing new since round 2. The only difference from main is the reworded errors the PR already lists. ux=yes carries over. Screenshots: 918-head-{desktop,phone}-{alts,noalts,negative,closed,email}, 918-head-{desktop,phone}-browser-invalid-email, 918-head-{desktop,phone}-closed-page, and the matching main-*.

Screenshots are in https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
@richshaw richshaw added the pipeline:working A session is working on it right now label Nov 16, 2026 — with Claude
Base automatically changed from claude/issue-631-error-reasons to main November 16, 2026 01:49

Copy link
Copy Markdown
Owner Author

Approved by the owner at 7b0d70e.

The owner approved merging the localization stack (#897 up to #931) in the orchestrating session on 15 November 2026.

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

@richshaw richshaw added pipeline:merge and removed pipeline:owner Passed; waits for the owner (UX or high-risk) labels Nov 16, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

catch-up after #917: merges only, own diff unchanged, markers stand

Review (round 3) and the light tophat both passed on 7b0d70e, and nothing of the PR's own has changed since.

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

@richshaw
richshaw merged commit 00c230a into main Nov 16, 2026
5 checks passed
@richshaw
richshaw deleted the claude/issue-631-client-error-text branch November 16, 2026 01:56
@richshaw richshaw removed pipeline:merge pipeline:ux Changes what a person using OpenSignup sees or does pipeline:working A session is working on it right now labels Nov 16, 2026 — with Claude
richshaw pushed a commit that referenced this pull request Nov 16, 2026
richshaw pushed a commit that referenced this pull request Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sign-up errors can show participants the server's English text

3 participants