Skip to content

Move the sign-in pages' text into the catalog - #963

Merged
richshaw merged 264 commits into
mainfrom
claude/issue-948-sign-in-text
Nov 16, 2026
Merged

richshaw merged 264 commits into
mainfrom
claude/issue-948-sign-in-text

Conversation

@richshaw

@richshaw richshaw commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Fixes #948.

Merge after #961.

The stack

Phase 2 of the localization stack (#619), track B. Based on #961 (claude/issue-942-share-text); review against that branch.

The problem

The sign-in pages had their English written into them: /login with its form, its code box and the provider buttons, the page that says to check your email, and the confirm page an emailed link opens. So they couldn't follow the instance's language. The code box's refusals were English sentences picked by the server action from the error's code.

The fix

36 messages under a new auth namespace, English byte for byte as it read.

  • The language is signInLocale() (src/i18n/organizer.ts): the instance's DEFAULT_LOCALE once it has shipped to organizers, else English (defaultFor('organizer', instanceDefaultLocale())). Nobody is signed in, so there's no stored language to read, and nothing comes from the request: no header, no cookie. The e2e run's E2E_UNSHIPPED_LOCALES doesn't change it, since it only keeps a language already stored on a row.
  • Server components translate. The three pages and the provider buttons call getServerTranslator. Their tab titles come from generateMetadata. The check page's link lifetime is formatted in the page's language (formatDuration(…, locale)).
  • Client components get their words as props, as Move account Settings and Connected apps text into the catalog #956, Move a signup's header, tabs and status labels into the catalog #957 and Move the share panel's text into the catalog, and write its message in the signup's language #961 do. loginFormText(t) (src/app/login/login-text.ts) builds the form's and the code box's words on the server, and the confirm page passes SignInLink its two labels. No ClientMessages, so /login sends no messages and no next-intl runtime.
    • The issue suggested one ClientMessages for auth. Props cost nothing, and /login got 240 B smaller, so no budget rises.
    • One line needs the browser's value: "Link sent to {email}. Check your inbox." The address is only known once the server action answers. The server formats the whole message with a private-use character standing in for {email} and cuts it there. The form puts the address back between the two parts, in bold as before. A translation may put {email} anywhere, and the catalog check fails one that drops it.
  • Refused codes by reason. redeemLoginCode (src/auth/login-code.ts) gives each refusal a details.reason: code_malformed, code_invalid and code_expired, added to ErrorReason. Their English message is unchanged.
    • The server action now returns { ok: false, reason }, never a sentence, and the form words the reason from its props.
    • codeRefusal (src/app/login/code-refusal.ts) maps the service's reason to the form's. A malformed code and one that matches nothing both read "That code is not right…", as before. A refusal with no reason it knows falls back on its code, as the form used to.
    • The form's own reasons are no_email, rate_limited, expired, wrong and failed (the last one when the request throws, said by the form itself).
  • CenteredPageFrame takes an optional locale. It marks the page with lang for screen readers and puts the footer in that language. The sign-in pages pass theirs. The OAuth consent screen passes none, so its markup is unchanged (The OAuth consent screen is English-only #950's).
  • TRANSLATED gains src/app/login. no-hard-coded-text.test.ts lists its seven files.
  • docs/translating.md names the sign-in pages in the namespace table and gives their language rule. The CHANGELOG has a line for The sign-in pages are English-only #948.

Sign-in behaviour is unchanged. Only where the words come from changed. No change to the session, the cookies or the callback URL. Here's how I checked:

  • The diff:
    • Under src/auth, only login-code.ts changed: each serviceError there gains a details object, and nothing else moved.
    • config.ts, adapter.ts, session.ts, callback-url.ts, request-magic-link.ts and src/middleware.ts aren't touched.
    • In login/page.tsx, the session check and redirect, safeCallbackUrl, handle, the two rate-limit charges (IP first), the redeemLoginCode call and the URL handed back for a top-level navigation are the same lines. Only the three refusals return a reason in place of a sentence.
  • page.test.tsx pins the code action:
    • the IP is charged before the address;
    • the address isn't charged once the IP limit trips;
    • nothing is charged without an address;
    • the code isn't looked at once either limit trips;
    • a right code hands back the URL unchanged.
  • e2e on a production build:
    • login-code: a real code signs the browser in and lands on the requested page;
    • login-form;
    • organizer: signed-out redirects to /login with the page as callbackUrl, deep links included;
    • oauth-consent: "Sign in as someone else" returns to the same request.

What a returning organizer sees (owner's decision, as the issue asks to note): on an instance without DEFAULT_LOCALE, an organizer whose account is in another language signs in on an English page. Their sign-in email follows their account once #949 lands.

Checked against the code:

  • The issue lists session-watcher.tsx among the files with English. It has none, though it's in TRANSLATED with the folder.
  • The issue expected /login's budget to rise. It doesn't, since no messages or runtime reach the browser.
  • "Allowed for tests" in "Done when": an e2e server runs with one environment, and an unshipped DEFAULT_LOCALE is English by design (defaultFor). So the other-language runs are unit tests: each page is rendered with the language shipped to organizers (ship()) and DEFAULT_LOCALE set to it. The e2e checks the English in production.

Left as they are:

Client JavaScript (gzip, first load, base 039ba3e against head, both built in this session's container):

  • /login: 109,219 → 108,979 B (−240), 109.0 of 110 kB;
  • /login/confirm: −11 B; /login/check: +5 B;
  • every other page within ±7 B (module ids).

No budget moves. 1.0 kB is under the script's 2 kB lowering note, as the other budgets sit.

Gate: owner. It's sign-in (src/app/login/, src/auth/login-code.ts). Nothing people see changes: English is unchanged, and no language but English has shipped to organizers.

Tests

  • New:
    • login-text.test.ts: every word of the form in English, as literal strings, and each from the catalog in each other language. The sent line is cut right with the address at the start, in the middle and at the end.
    • code-refusal.test.ts: each reason, and the fallback on the code.
    • login/page.test.tsx:
      • the page in English (heading, both intros, the provider button and "or", both errors, the form, the footer, the tab title, lang="en");
      • with DEFAULT_LOCALE set to each other language: English while it hasn't shipped, and all of it from the catalog with lang set once it has;
      • nothing from E2E_UNSHIPPED_LOCALES;
      • the code action, as above.
    • check/page.test.tsx: English word for word with a 90-minute link ("1 hour 30 minutes"), the same language cases, and the lifetime in the other language's own words.
    • organizer.test.ts: signInLocale per other language (unshipped, shipped, the participants' list doesn't count, the e2e list doesn't count).
    • login-code.db.test.ts: each refusal's code, reason and unchanged English message (malformed, wrong, another address's, expired, used).
    • tests/e2e/sign-in-text.spec.ts, against the production build's precompiled messages:
      • /login's title, lang, heading and intro;
      • after sending, "Link sent to {email}. Check your inbox. Send again" with the address in bold, and the code box's words;
      • the check page's sentence with its lifetime;
      • the confirm page's "…sign in as pat@example.com." with the address in bold, Sign in → and Use a different email.
  • Existing tests:
    • confirm/page.test.tsx gained the English, language and no-address cases. Its footer test is unchanged.
    • login-form.test.tsx and sign-in-link.test.tsx only gained the text props. The form's code fixture is now { reason: 'wrong' }.
    • No expected text changed in any existing unit, e2e or help walkthrough spec.

Run in this session on 788d291, all passing:

  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: 3159 passed, 1 expected fail.
  • pnpm test:db: 826 passed.
  • pnpm build && pnpm budgets: every page within budget, no number changed. /login, /login/check and /login/confirm still render per request (ƒ).
  • e2e, chromium, production build, port 3200, the container config:
    • sign-in-text, login-code, login-form: 6 passed;
    • oauth-consent, organizer, precompiled-messages, a11y and every help walkthrough (tests/e2e/help): 59 passed.
  • node .claude/skills/help-pages/scripts/affected-articles.mjs origin/claude/issue-942-share-text: no help article names or facts touched. No article describes the sign-in pages.

Overlaps

🤖 Generated with Claude Code

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

claude and others added 30 commits November 14, 2026 00:16
…-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
…text

Part of #626. Adds organizers.locale, a nullable text column (migration
0015, add-only), and reads it in the query loadOrganizerSessionById
already runs: one more selected column, no new statement. The raw saved
value, or null, travels on OrganizerSession, on the bearer seam's
resolution and into the MCP ToolContext, since tool handlers may not
query the database. It stays off Actor, so a cookie and a token for the
same organizer still give the same actor. Nothing sets the column or
follows it yet.

signups.claim_token_hash is out of the schema but still in the database
until a later release (#820), so drizzle-kit wanted to drop it too. The
migration was generated with that field put back in the schema for the
run, so its diff is only the new column and the snapshot still matches
the database.

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

updateOrganizerLocale saves the acting organizer's own language, refusing
anything that hasn't shipped to participants, and anyone who isn't an
organizer. Account Settings gets "Language for new signups", a plain form
that renders only once SHIPPED.participant has two languages, showing the
saved language or the one getOrganizerLocale would pick. The privacy page
says the account holds that choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A new signup made through POST /api/signups, the New signup form or Magic
Compose now takes a language: the one an API caller sent, else the
organizer's (saved, the instance's DEFAULT_LOCALE, the browser's top
language, English). The route decides and passes it into createSignup;
persistDraft takes it as an option. While only English has shipped to
participants nothing is stored unless the caller sent a language, so no
signup is pinned to one nobody chose.

signup.created records locale and localeSource for a signup created with
a language, documented in docs/telemetry.md and on the privacy page.

Part of #627.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The AI assistant's create_signup now gives a new signup a language the
same way the browser does (#905), finishing #627:

- An optional `locale` on the tool's input (added with .extend(), not on
  FullDraftSchema, which is also Magic Compose's output schema). It is
  stripped from the draft and passed through persistDraft's `locale`
  option with source `api`.
- Without one, the signup takes newSignupLocale with the organizer's
  saved language (ctx.locale) and no browser: an assistant's
  Accept-Language is its vendor's. While only English has shipped to
  participants that stores nothing, as before.
- A language that hasn't shipped is refused with invalid_input on
  `locale`, with the REST API's message and suggestion, before any quota
  is spent or anything created. createSignup's check is exported as
  checkSignupLocale, with the field name as a parameter, so both say the
  same thing.
- signup.created records locale and localeSource as for the browser,
  next to viaClientId.

The tool description says what locale does and which values it takes.
docs/connect-ai-assistant.md, docs/telemetry.md and the CHANGELOG say
the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The signup page, its draft and archived messages, its not-found message and
the organizer's Preview now take the signup's language from its row and pass
it down: to the slot date and time formatters (which were given 'en'), to
the state messages (as `lang`), and to og:locale in the page's openGraph.

One rule picks the language, `signupLocale` in src/i18n/config.ts: the
stored `settings.locale` once it has shipped to participants, else the
instance's language for participants. It replaces `resolveLocale`, which
nothing outside its tests called and which kept a stored language that has
a catalog but hasn't shipped, where the Settings tab's language form shows
the instance's. The form now calls `signupLocale` too, so the choice an
organizer sees is the one participants get.

The page reads the language from the same cached row as `loadPublicSignup`,
so both GET /s/[slug] budgets stay at 5 and 6. A draft's or archived
signup's row gives the page only its language.

While only English ships every signup reads as English, so nothing anyone
sees changes except og:locale (en_US) on a signup's link preview.

Also tests the `deletedAt` check in getPublicSignup on a row read some other
way, which nothing reached since the slug read skips deleted rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A not-found page gets no params, so the not-found pages under /s/[slug]
couldn't tell which signup they were under. The middleware now also runs
on /s paths and copies the path alone (never the query, which on an edit
link is its token) into a header of its own, x-opensignup-signup-path,
with set, so a client can't supply it. It never touches the organizer
callback header, which stays /app only, so nothing on a public page can
choose where sign-in sends someone.

Both not-found pages read the slug from that header and take only the
language from the cached row (loadSignupRowBySlug, the signup page's own
read), through signupLocale; a path with no plausible slug gets the
instance's language without a lookup. The helper that does this for the
signup page's draft and archived messages moves into signup-locale.ts so
all three share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Take locale out of the MCP tools' UNREAD_SETTINGS, so get_signup and the
results of create_signup and update_signup show the stored settings.locale,
and update_signup takes one. Its settings schema takes the language as
sent, not through the stored schema's lenient read, so updateSignup refuses
an unshipped one with the REST API's message and null clears it, rather
than a long string or a non-string quietly clearing the stored value.

GET /api/public/signups/[slug] gains settings.locale: the language the
signup's page is in (signupLocale), never a stored value no participant
gets.

Also: create_signup's locale gets a .describe(); SignupLocaleSource moves
to the pure organizer-locale.ts; signupLocale's comment no longer says
emails follow it; a telemetry.md wording fix; CLAUDE.md says a tool
handler may run a pure check of its input; docs and CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Fifteen test files each carried their own copy of a function that changes
SHIPPED to ship Swedish for a test, with an afterEach to put it back. The
shared helper in src/i18n/testing/ship.ts does both: it changes the list for
the test it's called in (or each test of a beforeEach), and restores every
audience's list once the test finishes, whether it passed or threw, through
vitest's onTestFinished. The test files now call it and drop their copies.

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

SiteFooter takes `locale` and asks for its text in that language. Help,
legal, sign-in and the landing page pass English; so does the participant
layout for now, since it sits above [slug] and has no signup to read. The
footer never works out a default itself, because static pages must not call
getEnv().

Banner's ✕ ("Dismiss") and BottomSheet's ✕ ("Close") were the last English
in those two components. Each now takes the name as a prop (dismissLabel,
required whenever there is a ✕, and closeLabel), never from a translation
hook: organizer pages use both components and have no messages provider.
The organizer callers are client components whose other text is still
English, so they pass "Dismiss" and "Close" as literals and keep the
catalogs out of their bundles; the sign-up dialog passes "Close" until its
own text moves to the catalog. Every name reads as before.

Lint: the hard-coded-text rules are on for banner.tsx and BottomSheet.tsx as
well as the footer, and leave test files out (which matters once a folder
is listed). The text props now include body, eyebrow and description, and
any prop whose name ends in Label, so text passed through a shared
component's props is caught too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The page, its signup view, the slot formatting and the state messages now
take their text from the `participant` namespace, in the signup's language.
Glued sentences are whole messages: the signed-up bar, the Closed banner's
"spot is / spots are", "N slots", and "(no {label})" with the label whole in
it. Counts use a `::group-off` skeleton, so English reads "1234 left" as
before rather than "1,234".

The organizer's text on these pages (the organizer strip, the Preview banner
and the disabled button's tip, the own-draft note) goes to the `organizer`
namespace, stays English, and is marked lang="en" where the element allows.

slot-format.ts takes a translator as an argument, typed with `import type`,
since the sign-up dialog imports it. The hard-coded-text lint rules are on
for the five files, and now also catch `detail`, props ending in Title, and
text keys of an object passed as a prop (`action={{ label }}`).

English is unchanged: the HTML differs from before only by the lang markers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
ClientMessages is a client component around next-intl's provider that
passes the language, the messages and the time zone itself, so it never
reads the request config. messagesFor, now exported from translator.ts,
gives a server component just one namespace's messages with English
under them, and a lint rule keeps every other file from importing the
provider. The live signup page mounts it around the view that renders
the dialog, and the edit page around its form.

The name box's label, "Your name", is the first text a client component
reads with useTranslations: the dialog and the edit form both show it,
so both pages carry the runtime they'll need, and the four pages whose
JavaScript includes it get their budgets raised by the measured amount.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The rest of the sign-up dialog's text and participant-fields.tsx read
their words with useTranslations, from the participant catalog the
page passes ClientMessages: participant.dialog, fields, slot (its
"N of M spots left" is the row's leftOf) and errors. messagesFor takes
a list of namespaces for that. The Sign up button's two messages move
from signupView to dialog, which the Preview and showcase stand-ins
read on the server.

The message helpers (capacity, closed, conflict, gone, name, rate
limit, participantErrorCopy) take a translator instead of returning
English, so the same code runs in the dialog, on the edit page, and on
the server. The not-found pages build their copy with gonePage(t), and
the e2e specs that read it build an English translator. Glued
sentences are whole messages: plurals for spot counts and the rate
limit's minutes, selects for the reminder clause and the calendar
sentence, and tags around the slot and the address.

Closing the sheet now gives the focus back to its Sign up button.

Lint is on for the dialog, its fields, the helpers and the signup's
not-found page. English is unchanged, and the four dialog pages' first
JavaScript is 223 to 416 bytes smaller, so their budgets come down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
src/messages/sv.json holds Swedish for every participant message and the
footer's common text, a first machine pass for #639's review to check. sv
joins CATALOG_LOCALES, not SHIPPED, so nobody can choose it and every page
stays English; DEFAULT_LOCALE=sv is now accepted and changes nothing until
Swedish ships, which the README, .env.example, fly.example.toml and the
CHANGELOG now say.

The e2e seed adds a published Swedish signup, created through createSignup
and given settings.locale 'sv' directly, since the service refuses a
language that hasn't shipped. The server Playwright starts gets
E2E_UNSHIPPED_LOCALES=sv, which lets signupLocale keep a stored language
that has a catalog though it hasn't shipped. It ships nothing on its own:
nothing in the app can store such a language.

precompiled-messages, a11y and slot-row-layout run on the Swedish signup
too, and a new spec checks the organizer strip and the Preview banner stay
English, marked lang="en", over it. Slot dates and times now take a
CatalogLocale rather than any string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
getOwnCommitment also selects the signup's settings->>'locale', in the
statement it already ran, and returns it as signupLocale: the stored string
or null, never the settings object. The unsubscribe preview does the same.
The edit page and the unsubscribe page read it through signupLocale(), as
the signup's own page does, pass it to the slot-name helpers in place of
'en', and mark their <main> with lang. Their words stay English for now.

GET /api/commitments/[id] keeps its answer as it was: nothing reads the
language from there, so the route leaves signupLocale out. A db test checks
the answer has exactly the commitment's fields, the participant's name and
email and the signup's slug, with no settings, on a signup whose settings
hold organizer-only keys and a language.

A broken or incomplete unsubscribe link takes the language of the signup
its path names, as a broken edit link's not-found page does, sharing that
page's cached read. No page or route sends another statement.

Part of #630.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
docs/translating.md conflicted: #931 (through #977) turned the glossary's
open questions into a "Settled" list, and this branch had added a
question about the Build tab's drag refusals to the old list. Kept
#931's settled list and moved this branch's question, unchanged, under
"Open questions".

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
docs/translating.md conflicted: #931 (through #981) turned the glossary's
open questions into a "Settled" list with an "Open questions" section
after it, and this branch had added two questions from #982's review to
the old list. Kept #931's settled list and added this branch's two
questions under "Open questions", beside #981's.

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
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
Base automatically changed from claude/issue-942-share-text to main November 16, 2026 05:14
src/app/login/page.tsx conflicted in its imports: main (through #961)
added ipSubject to the rate-limit import, for the per-IP login code limit,
and this branch added the signInLocale and getServerTranslator imports
beside the same line. Kept both. The body merged on its own: the code
limit keys on ipSubject(...) as on main, and the page's text comes from
the catalog as on this branch.

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

catch-up after #961, with a runtime conflict, so the train stops here for a tophat look and a review look.

What conflicted. The first merge (#961's final head, which carries main's login rate-limit change) conflicted in src/app/login/page.tsx, in the imports only:

  • main changed import { RateLimits, chargeRateLimit } from '@/lib/rate-limit' to add ipSubject, which the per-IP login code limit now uses: ipSubject(await getCurrentRequestIp()) in place of (await getCurrentRequestIp()) ?? 'unknown'.
  • This branch added signInLocale and getServerTranslator imports beside that line.

How I resolved it. I kept both: the two i18n imports and { RateLimits, chargeRateLimit, ipSubject }. The page's body merged without a conflict. The code limit keys on ipSubject(...) as on main, and the page's text comes from the catalog as on this branch. Against main, the PR's own changed lines are identical to before (same files, same +/- lines); only the context of that import line differs.

Checks on 6c3deb6:

  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: all pass (238 files, 3363 passed, 1 expected fail).
  • pnpm build && pnpm budgets: every page passes (/login 109.112 kB of 110).
  • I didn't run pnpm test:db here; CI's run on this SHA is the next check.

What to look at. On the login page, sign in with a code and check the per-IP code limit still applies: main's behaviour, now through ipSubject. The page's text should still come from the catalog. Review and tophat are on 788d291; this PR waits for both looks on 6c3deb6, then for the owner's merge marker. I've released my claim.

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

@richshaw richshaw removed the pipeline:working A session is working on it right now label Nov 16, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

Ran 6c3deb6 locally with next dev on port 3300, Postgres 16, Chromium at 1280×900 and 390×844. This was a light look after the catch-up merge, where src/app/login/page.tsx conflicted in its imports (main's ipSubject beside this PR's i18n imports). The full tophat on 788d291 stands for everything else.

Check Result What I saw
Sign in by magic link ✅ tophat-link@example.com: the link from the console email, the confirm page, then Sign in →, landing on /app ("Your signups"). No console errors.
Sign in by six-digit code ✅ /login?callbackUrl=/app/settings: "Link sent to tophat-code@example.com. Check your inbox. Send again", then the code box. A wrong code reads "That code is not right. Check the email and try again." The issued code then signs the window in and lands on /app/settings, and its row is consumed. The code limits are charged as on main, through ipSubject: auth.code.ip / 127.0.0.1 went to 2 and auth.code.email went to 2 (one wrong try, one right).
Sign-in rate limit ✅ Six requests for tophat-limit@example.com on desktop and one more on phone. The first five sent a link (5 emails in the log). The 6th and 7th read "Too many sign-in requests. Wait up to an hour. If we already emailed you a link, you can use that." under the button, with no email sent. Counters: auth.magic.email 7, auth.magic.ip 9 (of 20).
/login and /login/check in English ✅ Desktop and phone. Tab titles "Sign in · …" and "Check your email · …", the frame has lang="en", and the heading and intro are word for word. The check page reads "…The link expires in 1 hour. This page will move on by itself once you have signed in."
With E2E_UNSHIPPED_LOCALES=sv and DEFAULT_LOCALE=sv ✅ Both pages stay in English with lang="en", and the footer is English too, as designed: signInLocale() only takes a DEFAULT_LOCALE that has shipped to organizers, Swedish hasn't, and sv.json has no auth yet (#953's). The same server showed the seeded Swedish signup in Swedish (lang="sv", "Anmäl dig"), so the settings did take effect. Desktop and phone, no console errors.
tests/e2e/sign-in-text.spec.ts ✅ 3 passed, chromium, against the server above in English.

Also run on this SHA: the src/app/login, src/auth, src/lib/rate-limit and organizer-reasons unit tests (176 passed), and login-code.db.test.ts with rate-limit.db.test.ts (13 passed).

Server log: the only errors are Auth.js's two MagicLinkRateLimited lines for the two refused requests, which is expected.

For the owner: in English nobody sees a change on the sign-in pages, and main's shared no-IP bucket still applies to the code limit. Screenshots: 963h-sent-desktop (the "Link sent to" line and the code box), 963h-code-wrong-desktop, 963h-ratelimited-desktop and 963h-ratelimited-phone (the limit's message), 963h-login-sv-phone and 963h-check-sv-phone (still English under DEFAULT_LOCALE=sv).

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


Generated by Claude Code

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

This is a light look after the catch-up merge. Round 1 reviewed the PR's own code on 788d291. Since then the head has only merges: 6ff9837, the restack b83532a, ad45ae4, where src/app/login/page.tsx conflicted in its imports, and 6c3deb6. The resolution keeps both sides and drops nothing.

Blocking (0): none.
Optional (0): none new. Round 1's two optional points still apply.

Earlier threads: none open.

Checks:

  • The PR's own diff, before and after. I compared git diff 039ba3e...788d291 with git diff origin/main...6c3deb6, ignoring index and @@ lines.
    • In runtime code the only difference is one context line in login/page.tsx: main's import { RateLimits, chargeRateLimit, ipSubject }, which this PR doesn't change.
    • The other differences come from the restack merge and were already flagged in its comment: organizer-reasons.test.ts gains a SignInReason type (test only), and docs/translating.md's organizer row adds "and, in auth, the sign-in pages" at the end of track A's longer row. Both look right. codeRefusal words the three login-code reasons through auth.code.errors, so leaving them out of OrganizerReason is correct.
    • The CHANGELOG differs only in context lines.
  • The resolved login/page.tsx, read in full:
    • #984's change is there: the code limit charges RateLimits.loginCodePerIp with ipSubject(await getCurrentRequestIp()), IP first, then the address, both before redeemLoginCode.
    • #963's lines are there too: signInLocale() and getServerTranslator(…, 'auth'), generateMetadata for the tab title, the reasons in place of sentences, codeRefusal, loginFormText(t), the providers' t, and the frame's locale.
    • The page's diff against main is exactly the PR's own. Every other file #984 touched is byte-identical to main at this head. Between 788d291 and this head, the only changes under src/app/login and src/auth are #984's.
  • CI on 6c3deb6 is green (lint-type-test, e2e, CodeQL).
  • Local, on 6c3deb6:
    • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test passed: 238 files, 3363 passed, 1 expected fail.
    • By name: the src/app/login, src/auth, src/lib/rate-limit.test.ts, organizer.test.ts and organizer-reasons.test.ts unit tests (176 passed), and login-code.db.test.ts with rate-limit.db.test.ts (13 passed).
  • The tophat on this SHA passed: sign-in by link and by code, the limit's message, English, and DEFAULT_LOCALE=sv (still English, by design).

Gate: owner. This is sign-in (src/app/login/, src/auth/login-code.ts) and UX, as in round 1. Nothing new for the owner to look at: English is unchanged, and main's shared no-IP bucket still applies. The tophat's screenshots are 963h-sent-desktop, 963h-ratelimited-desktop and 963h-login-sv-phone.

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Approved by the owner at 6c3deb6.

The owner approved merging the localization stack (#897 up to #999) in the orchestrating session on 16 November 2026: "Stop before launch: merge everything up to and including the simplification", with #999 added after it. The review (round 2) and tophat on this SHA both passed after the login conflict was resolved.

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

@richshaw richshaw added pipeline:merge pipeline:working A session is working on it right now and removed pipeline:owner Passed; waits for the owner (UX or high-risk) labels Nov 16, 2026 — with Claude
@richshaw
richshaw merged commit c87403b into main Nov 16, 2026
5 checks passed
@richshaw
richshaw deleted the claude/issue-948-sign-in-text branch November 16, 2026 05:39
@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
scripts/lib/email-samples.ts (the pnpm email:dev and test samples)
conflicted with #931 in two places, both kept:
- imports: this branch's formatDuration, and #931's formatSlotTime beside
  formatSlotDate;
- this branch's signIn(locale) sample, then #931's nineAm for the English
  confirmation's time.

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

The sign-in pages are English-only

3 participants