Skip to content

fix(console): save a language picked on the register page as the new person's own when they have none - #30597

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-b4xtgz
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-b4xtgz

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
Fixes #30338

domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL

维护者速读

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 as LoginPage'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's saveSignInLanguagePick once (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:

    Exit Line on main Waits
    OAuth provider hand-off (followOauthAuthorize) L194 yes (step 0 sits above it, as on /login)
    Mobile sign-in hand-off L206 yes; a session the hand-off refuses for its age saves nothing
    Invitation join entered (First-run flow: small frictions a new deployment's first people meet #30125) L218 yes; the acceptance runs meanwhile
    No organization L233 yes
    Several organizations L236 yes
    Final redirect after the single-org auto-select L241 yes
  • 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 plus hasSignInLanguagePick(), so the render that first sees the user already holds). That covers its three ways out: the invitation join's window.location.assign to the root (L132), the signed-in branch's Navigate to /, and the form's onSuccess navigate('/') (L271), which now leaves the move to the signed-in branch when a pick is held or its save has started.

  • Imports only: hasSignInLanguagePick / saveSignInLanguagePick as 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/main 27b0bc79: neither register page called saveSignInLanguagePick, 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 the domain:ui#4 ACCEPT on #30539 ("RegisterPage.tsx 同形") and claimed in 6663446873.

Acceptance notes

  • Bound, as ruled (seat ruling D on this card, carried by the claim): memory lasts one page-load. A pick followed by a reload of the register page, or by an identity provider round trip, is still not saved. No storage marker was added to change that.
  • No timeout on the save, the same as /login: a hanging request keeps the spinner up as long as the adapter's own fetch does.
  • Write census: no new adapter write call site. The pages call saveSignInLanguagePick, whose own update is already registered in affordanceGrantMap-12082.test.tsx (outOfFamily), and that function is not a census write helper. The census test ran green unchanged.
  • Observed, not this card's: with no pick and several organizations, the post-signup step navigates to the root before the organization list answers, then again to the picker, the same double navigation fix(console): save a language picked on the sign-in page as the person's own when they have none #30539 noted on /login. The CONTROL pins assert only that the page leaves and saves nothing.
  • Untouched: LoginPage.tsx, useUserLocale.ts, loadLocales.ts's signed-out list, packages/**.
  • Branch claude/project-thread-b4xtgz is the card thread's platform-assigned branch (not claude/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)
pnpm exec vitest run --maxWorkers=2 apps/console/src/pages/auth/ packages/app-shell/src/console/auth/ packages/app-shell/src/hooks/__tests__/userLocaleSignInPick-30338.test.tsx packages/plugin-form/src/affordanceGrantMap-12082.test.tsx
 Test Files  47 passed (47)
      Tests  404 passed (404)
exit 0
Ablations (each through scripts/ablation-replace.mjs, mutation proven on disk, restored: blob == HEAD, git diff HEAD empty)
A1 console RegisterPage: drop step 0's return (the save starts, the first effect run goes on to the exit)
   registerLanguagePick-30338 (console): 8 failed | 11 passed (19), exit 1
   red: the five non-invitation "waits" cases and three "failed save" cases; green: CONTROLs and both invitation cases
   (a later effect run still meets the 'saving' guard, so the invitation exit stays held: hence A1b)
A1b console RegisterPage: delete the "save in flight" guard line
   registerLanguagePick-30338 (console): 4 failed | 15 passed (19), exit 1
   red: several organizations, one organization, both invitation cases
A2 app-shell RegisterPage: holdForSignInPick forced false
   registerLanguagePick-30338 (app-shell): 2 failed | 4 passed (6), exit 1
   red: both "waits" cases; green: CONTROLs and both failed-save cases

Together every exit has a waits case that goes red when the wait is removed.

Type check
pnpm --filter @object-ui/app-shell type-check   (tsc --noEmit && tsc -p tsconfig.test.json)   exit 0
ui/apps/console: NODE_OPTIONS=--max-old-space-size=6144 tsc --noEmit   exit 0
eslint on the four changed files: 0 errors; 2 warnings, both present on main (setState in effect, L145 and L258)

Verification

Live: showcase pnpm dev -- --fresh (invite_only) plus the console on vite, Playwright zh-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's lang attribute. Before = this head with the console RegisterPage.tsx restored from 27b0bc79 (vite reads source), put back from HEAD after (git status clean). Script and screenshots: project files issue-30338/.

Row Picked Landed sys_user.locale Slot lang
before Français app, joined empty fr fr
after Français app, joined fr fr fr
after, CONTROL nothing app, joined empty, no PATCH sent empty zh-CN

Requests in the after row, in order: POST sign-up/email, GET get-invitation, POST accept-invitation, POST set-active, and on the data side GET discovery, GET sys_user/ID, PATCH sys_user/ID, then the next page-load's GET discovery.

Gates (head e15bb2e)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 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

…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>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL

维护者速读

  • 改了什么:在注册页选了语言、本人还没设过语言偏好的,注册即登录时这个选择存成本人的语言偏好(sys_user.locale),和登录页(PR fix(console): save a language picked on the sign-in page as the person's own when they have none #30539)同形;从邀请链接注册加入组织也一样。app-shell 的 DefaultRegisterPage 对同一页面加载里更早选过的语言也照此保存。
  • 为什么改:PR fix(console): save a language picked on the sign-in page as the person's own when they have none #30539 只改了登录页;注册页同样靠整页跳转离开,跳转前没人写库,选的语言只留在这台浏览器上。
  • 风险与回滚:只有选过语言才多发两次请求(读一次本人记录、写一次);已有偏好不改,没选不发不等,写失败照常进入。回滚即撤本 PR。
  • 先看:console RegisterPage.tsx 注册后 effect 的第 0 步;app-shell RegisterPage.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。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。整张卡的余项一次交付(Fixes)。

席位核对 — ACCEPT · head e15bb2e

  • 形态:5 文件 +614/−5(两个 RegisterPage.tsx、两份新测试、一个 changeset,@object-ui/app-shell 与 @object-ui/console 各 patch)。check-governed-merges --pr 30597:NOT governed,619 行 ≤ 3000。Fixes #30338,目标 main。文件全在认领 6663446873 的文件面内;LoginPage.tsx、useUserLocale.ts、loadLocales.ts 与 packages/** 未动。
  • 契约:Clause-② no,Metadata-protocol none,与认领一致。没有新导出:console 读的 hasSignInLanguagePick / saveSignInLanguagePick 在 origin/main 的 ui/packages/app-shell/src/index.ts:142 早已导出,app-shell 页面走包内相对路径。没有新的存储键,裁决 D 照旧:刷新注册页或经身份提供方跳转后,选择仍会丢,PR 与 changeset 都写明了。
  • 前提实测:dev 报告 6664386723。席位对照 diff:console 第 0 步在 saving 时提前返回,保存结束后靠 signInPickSaved 依赖重跑,后面六个出口都在它之下;holdForSignInPick 在第一次见到 user 的那次渲染就成立,所以邀请加入的 window.location.assign、已登录分支的 Navigate 和表单的 onSuccess 三个出口都在保存之后。saveSignInLanguagePick 先同步取走选择、读到已有偏好就不写、出错只记日志不抛,所以失败不挡注册。消融三次(A1、A1b、A2)都转红,还原哈希一致;终 head 定向测试 47 文件 404 例全绿,派生门禁 35/35 exit 0,--ran 0 NOT-MEASURED。本地实测选 Français 注册后 sys_user.locale 为 fr,改前为空;不选语言的对照组没有发 PATCH。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped(Build/Test Core、Dogfood、Temporal Conformance、Docs、UI Published Artifacts、两个 opt-in 作业与 schedule 门,ui-only diff 的预期跳过),0 红。Build & E2E UI 绿:本 PR 不碰语言包。mergeable_state clean。
  • 接受的偏差:console 第 0 步也挡住 OAuth 跳转(followOauthAuthorize),派单没列这个出口。它和 LoginPage 同位,同样是整页跳转,存在它前面才对。保存不设超时,和 /login 一致。分支用 harness 指定的 claude/project-thread-b4xtgz,上面留着一个早推的 WIP 提交 3c2beb39,队列合并时压成一条。
  • 范围外去向:dev 记的“没选语言、有多个组织时,注册后先跳根再跳选择页”的两次跳转不立卡:PR fix(console): save a language picked on the sign-in page as the person's own when they have none #30539 在登录页记过同一现象,这里只在 jsdom 里观察到,PR 的验收备注已记录。
  • 落地条款:中继 pr_ready + automerge_enable。合并即关卡(Fixes),席位同一笔摘掉 pm:dispatched。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A language picked on the sign-in page is dropped when someone else last used that browser, and the sign-in list differs from the signed-in one

1 participant