Repository navigation
Move the sign-in pages' text into the catalog - #963
Conversation
…-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
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
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
|
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
How I resolved it. I kept both: the two i18n imports and Checks on 6c3deb6:
What to look at. On the login page, sign in with a code and check the per-IP code limit still applies: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt Generated by Claude Code |
Tophat: passedRan 6c3deb6 locally with
Also run on this SHA: the Server log: the only errors are Auth.js's two For the owner: in English nobody sees a change on the sign-in pages, and Screenshots are in https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
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...788d291withgit diff origin/main...6c3deb6, ignoringindexand@@lines.- In runtime code the only difference is one context line in
login/page.tsx:main'simport { 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.tsgains aSignInReasontype (test only), anddocs/translating.md's organizer row adds "and, inauth, the sign-in pages" at the end of track A's longer row. Both look right.codeRefusalwords the three login-code reasons throughauth.code.errors, so leaving them out ofOrganizerReasonis correct. - The CHANGELOG differs only in context lines.
- In runtime code the only difference is one context line in
- The resolved
login/page.tsx, read in full:- #984's change is there: the code limit charges
RateLimits.loginCodePerIpwithipSubject(await getCurrentRequestIp()), IP first, then the address, both beforeredeemLoginCode. - #963's lines are there too:
signInLocale()andgetServerTranslator(…, 'auth'),generateMetadatafor the tab title, the reasons in place of sentences,codeRefusal,loginFormText(t), the providers't, and the frame'slocale. - The page's diff against
mainis exactly the PR's own. Every other file #984 touched is byte-identical tomainat this head. Between 788d291 and this head, the only changes undersrc/app/loginandsrc/authare #984's.
- #984's change is there: the code limit charges
- CI on 6c3deb6 is green (
lint-type-test,e2e, CodeQL). - Local, on 6c3deb6:
pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm testpassed: 238 files, 3363 passed, 1 expected fail.- By name: the
src/app/login,src/auth,src/lib/rate-limit.test.ts,organizer.test.tsandorganizer-reasons.test.tsunit tests (176 passed), andlogin-code.db.test.tswithrate-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
|
Approved by the owner at 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 |
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
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:
/loginwith 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
authnamespace, English byte for byte as it read.signInLocale()(src/i18n/organizer.ts): the instance'sDEFAULT_LOCALEonce 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'sE2E_UNSHIPPED_LOCALESdoesn't change it, since it only keeps a language already stored on a row.getServerTranslator. Their tab titles come fromgenerateMetadata. The check page's link lifetime is formatted in the page's language (formatDuration(…, locale)).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 passesSignInLinkits two labels. NoClientMessages, so/loginsends no messages and no next-intl runtime.ClientMessagesforauth. Props cost nothing, and/logingot 240 B smaller, so no budget rises.{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.redeemLoginCode(src/auth/login-code.ts) gives each refusal adetails.reason:code_malformed,code_invalidandcode_expired, added toErrorReason. Their Englishmessageis unchanged.{ 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.no_email,rate_limited,expired,wrongandfailed(the last one when the request throws, said by the form itself).CenteredPageFrametakes an optionallocale. It marks the page withlangfor 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).TRANSLATEDgainssrc/app/login.no-hard-coded-text.test.tslists its seven files.docs/translating.mdnames 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:
src/auth, onlylogin-code.tschanged: eachserviceErrorthere gains adetailsobject, and nothing else moved.config.ts,adapter.ts,session.ts,callback-url.ts,request-magic-link.tsandsrc/middleware.tsaren't touched.login/page.tsx, the session check and redirect,safeCallbackUrl,handle, the two rate-limit charges (IP first), theredeemLoginCodecall 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.tsxpins the code action:login-code: a real code signs the browser in and lands on the requested page;login-form;organizer: signed-out redirects to/loginwith the page ascallbackUrl, 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:
session-watcher.tsxamong the files with English. It has none, though it's inTRANSLATEDwith the folder./login's budget to rise. It doesn't, since no messages or runtime reach the browser.DEFAULT_LOCALEis English by design (defaultFor). So the other-language runs are unit tests: each page is rendered with the language shipped to organizers (ship()) andDEFAULT_LOCALEset to it. The e2e checks the English in production.Left as they are:
authtext is The organizer app has no Swedish text #953's (its sign-in batch). Until then the catalog check lists it as to translate, since Swedish hasn't shipped to organizers.<html lang>on these pages staysenuntil Organizer pages say lang="en" on <html> whatever the organizer's language #938. The frame'slangcovers the page meanwhile.Client JavaScript (gzip, first load, base
039ba3eagainst 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;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
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:lang="en");DEFAULT_LOCALEset to each other language: English while it hasn't shipped, and all of it from the catalog withlangset once it has;E2E_UNSHIPPED_LOCALES;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:signInLocaleper 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;confirm/page.test.tsxgained the English, language and no-address cases. Its footer test is unchanged.login-form.test.tsxandsign-in-link.test.tsxonly gained thetextprops. The form's code fixture is now{ reason: 'wrong' }.Run in this session on
788d291, all passing:pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: 3159 passed, 1 expected fail.SharePanel.test.tsx's focus check under load (Move the share panel's text into the catalog, and write its message in the signup's language #961's, untouched here). It passes alone three times, and the full rerun was clean.pnpm test:db: 826 passed.pnpm build && pnpm budgets: every page within budget, no number changed./login,/login/checkand/login/confirmstill render per request (ƒ).sign-in-text,login-code,login-form: 6 passed;oauth-consent,organizer,precompiled-messages,a11yand 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
ErrorReasons at the end of the same union. These three go afterasked_again, andgit merge-filemergeserrors.tswith Name the case of each refusal the organizer screens word themselves #958's cleanly.en.json,docs/translating.mdand the CHANGELOG conflict with track A exactly as Move the share panel's text into the catalog, and write its message in the signup's language #961 already does, and no more.src/app/login/tosrc/app/(organizer)/login/. TheTRANSLATEDentry and the seven paths inno-hard-coded-text.test.tsmust move with it (filesAtfails lint loudly if they don't), and so must the pipeline's high-risk path list.auth.tabTitleandauth.headingserve both/loginand the confirm page.auth.login.failedandauth.code.errors.failedhave the same English in two places, and their translations should match.CenteredPageFrame's newlocale.🤖 Generated with Claude Code
https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt