Repository navigation
fix(console): save a language picked on the register page as the new person's own when they have none - #30597
Merged
Merged
Conversation
…person's own when they have none The console's register page now awaits app-shell's saveSignInLanguagePick before every exit of its post-signup step (the OAuth and mobile hand-offs, the invitation join's root entry and the three organization exits), as the sign-in page does. DefaultRegisterPage holds its root entry and its moves to / the same way. No pick, no request and no wait; a failed save does not hold the sign-up. Claude-Session: https://claude.ai/code/session_01L6bhgUaeNktxjHB4qxqPKg Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL 维护者速读
席位核对 — ACCEPT · head e15bb2e
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
Fixes #30338
domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL
维护者速读
sys_user.locale),和登录页(Sign-in page: a language picked before signing in is not saved as the person's own preference when they have none (save after #30157) #30399)一样;从邀请链接注册加入组织也一样。RegisterPage.tsx注册后 effect 新增的第 0 步;app-shellRegisterPage.tsx的holdForSignInPick。pnpm --dir ui exec vitest run apps/console/src/pages/auth/__tests__/registerLanguagePick-30338.test.tsx packages/app-shell/src/console/auth/__tests__/registerLanguagePick-30338.test.tsx,预期 25 passed。Clause-②: no
Metadata-protocol: none
What changes
ui/apps/console/src/pages/auth/RegisterPage.tsx, the post-signup orchestration effect only: a new step 0, the same asLoginPage's (fix(console): save a language picked on the sign-in page as the person's own when they have none #30539). When a language was picked on the page while signed out, it starts app-shell'ssaveSignInLanguagePickonce (ref latch), holds the spinner, and re-runs the effect when the save settles (state). The steps after it are unchanged, so every exit waits:mainfollowOauthAuthorize)/login)ui/packages/app-shell/src/console/auth/RegisterPage.tsx(DefaultRegisterPage): this page draws no language menu, so a pick reaches it only from another signed-out page earlier in the same page-load. Once someone is signed in and a pick is held, the page starts the save once and renders its empty layout until it settles (holdForSignInPick, from state plushasSignInLanguagePick(), so the render that first sees the user already holds). That covers its three ways out: the invitation join'swindow.location.assignto the root (L132), the signed-in branch'sNavigateto/, and the form'sonSuccessnavigate('/')(L271), which now leaves the move to the signed-in branch when a pick is held or its save has started.Imports only:
hasSignInLanguagePick/saveSignInLanguagePickas fix(console): save a language picked on the sign-in page as the person's own when they have none #30539 landed them. No new export, no new storage key, nothing sent beside a navigation.Why
Measured on
origin/main27b0bc79: neither register page calledsaveSignInLanguagePick, and both leave by navigation after a sign-up that signs the person in, so a pick made there stayed in the device slot only. This is the remainder recorded in thedomain:ui#4ACCEPT on #30539 ("RegisterPage.tsx同形") and claimed in 6663446873.Acceptance notes
/login: a hanging request keeps the spinner up as long as the adapter's own fetch does.saveSignInLanguagePick, whose ownupdateis already registered inaffordanceGrantMap-12082.test.tsx(outOfFamily), and that function is not a census write helper. The census test ran green unchanged./login. The CONTROL pins assert only that the page leaves and saves nothing.LoginPage.tsx,useUserLocale.ts,loadLocales.ts's signed-out list,packages/**.claude/project-thread-b4xtgzis the card thread's platform-assigned branch (notclaude/issue-30338-*).Tests
ui/apps/console/src/pages/auth/__tests__/registerLanguagePick-30338.test.tsx(new, 19 cases, each reached by a sign-up on the form): for each of the six exits, nothing leaves while the save is in flight and the expected exit is taken once it settles; the invitation join accepts its invitation and still waits; CONTROL for each exit with no pick; for each exit, a save that settles having failed still lets the page leave.ui/packages/app-shell/src/console/auth/__tests__/registerLanguagePick-30338.test.tsx(new, 6 cases): sign-up to/and invitation join to the root each wait for the save; CONTROL for both with no pick; a failed save still moves on, both ways.vitest: both new files, every console and app-shell auth page test, the sign-in pick hook file and the write census (head e15bb2e)
Ablations (each through scripts/ablation-replace.mjs, mutation proven on disk, restored: blob == HEAD, git diff HEAD empty)
Together every exit has a waits case that goes red when the wait is removed.
Type check
Verification
Live: showcase
pnpm dev -- --fresh(invite_only) plus the console on vite, Playwrightzh-CN, 1440 wide. The seeded admin invites a fresh address; the invitee opens the link signed out, follows "注册并加入", picks Français in the register page's footer menu, registers, and lands in the app. Then, from the invitee's own session:sys_user.locale, the device slot, the document'slangattribute. Before = this head with the consoleRegisterPage.tsxrestored from27b0bc79(vite reads source), put back from HEAD after (git statusclean). Script and screenshots: project filesissue-30338/.sys_user.localelangPATCHsentRequests in the after row, in order:
POST sign-up/email,GET get-invitation,POST accept-invitation,POST set-active, and on the data sideGET discovery,GET sys_user/ID,PATCH sys_user/ID, then the next page-load'sGET discovery.Gates (head e15bb2e)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 35; all 35 exit 0, codes captured before any pipe (pnpm --dir ui exec vitest run scripts/: 170 passed, 2 skipped files).dispatch-gates --ran: 35 derived, 35 run, 0 NOT-MEASURED (a derived zero). Changed lines 619, under the 3000 threshold.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUaeNktxjHB4qxqPKg
Generated by Claude Code