Repository navigation
feat(i18n): the sign-in page and the in-app language menu offer one list, every interface language - #36040
Conversation
Both now list every platform locale table language; the app's own locale list only decides which rows carry "App content shows in the default language". The profile page's language card reads the same list and shows the same line for a chosen language the app does not ship. Claude-Session: https://claude.ai/code/session_01L6bhgTB7jMdUGcVwaMo3CH Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTB7jMdUGcVwaMo3CH Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-21T10:43Z. The brief handed to the isolated declaration-face reviewer for PR #36040 (owed by the changeset's Contract review brief — PR #36040 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 席位核对 — ACCEPT (L1-a)维护者速读这个 PR 按裁决 A 做:登录页、头像菜单里的语言菜单、个人资料页的语言卡,三处都列出全部 11 种界面语言。应用自己的内容(对象、字段、视图名称)没有翻译的语言照样能选,只在那一行下面加一行小字「应用内容显示为默认语言」。登录页还没有读过应用信息,所以不加小字。在登录页选了德语的人,登录后菜单里仍能看到德语,并且德语仍是勾选状态。 我核过以下几点:
没有需要修的问题。下面记了一个小问题和一个行为变化,供知悉。座位已裁定的两条观察(已存语言优先、手机德语头像菜单超宽 #36041)我核对过证据,属实,确实不在本 PR 内。 Head reviewed: What holds
Nit (does not block)
Observation (no change asked)
Landing terms
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Face: declaration ( Gate verdicts (check-runs on the head): every run concluded ① Derived judgmentsPublic-surface changes of
Findings:
No must-fix, no should-fix. ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T10:49Z · The b1-CX thread 5 PR for #35425: the avatar menu, the sign-in page and the profile page's language card offer the same list, all 11 interface languages (the maintainer's ruling 7056785432, option A). When the app's own list is known and does not cover a language, its row says 「应用内容显示为默认语言」. Signed out, the app list is unknown, so the sign-in page lists the 11 without the line. |
… the shell re-renders less during first load (objectstack-ai#37883) Part of objectstack-ai#37575 Part of objectstack-ai#37444 This is slice 2 of the first-render card. It does not bring the list and record pages under 2.5 s, so the card stays open. The section "What is left" below says what still costs the time. Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no skill or doc page names `appContentLanguages` (git grep of `skills/`, `content/` and `docs/`; only two changesets do) **Narrowing (public API of `@object-ui/i18n` and `@object-ui/react`):** `useObjectTranslation()` and `useI18nContext()` no longer return `appContentLanguages`, which objectstack-ai#36040 added to them and which has shipped. `@object-ui/react` re-exports both hooks, so the narrowing reaches that entry too. Read the list with the new `useAppContentLanguages()` instead; both entries export it. The changeset carries the BREAKING section and an ADR-0087 disposition. It ships `patch` because the change is not to the metadata protocol. ## 维护者速读 - 控制台用户打开列表页、记录页时,首屏少做几遍整块重绘,看到的内容和交互不变;同机对照列表页快约 80 毫秒、记录页快约 90 毫秒,首页不变。 - 属于「首屏打开速度」专题,接着上一片侧栏的改动,继续削减首屏前的重复渲染。 - 出错的话,最可能是列表行末按钮、侧栏入口的显隐、或语言菜单的「内容未翻译」提示显示不对;整个提交可以直接撤回。 - 无 ## What changes Between a list's rows' first render and their first paint the grid drew the whole table three more times, and the shell re-rendered large parts of the page for answers few components read. Each cut below removes one such pass; none changes what is drawn. **Grid (`@object-ui/plugin-grid`)** 1. `ObjectGrid`'s loading face now draws inside the same root element the loaded table uses (same type, place and ref). React keeps the element across the swap, so `gridRoot`, and the list page scope answer read off it, is known when the rows first render. Before, the rows drew once with row-end controls and the `_actions` column, the root's ref then answered "list page", and the table drew again without them (plus a right-shadow flip). 2. `useInlineRowActionFold` watches its host from a stable callback ref instead of holding the element in state, so mounting the host no longer re-renders `ObjectGrid` (an 838-component pass). 3. `useRecordCrudVerdicts` publishes a verdict map only when it differs from the published one. It used to publish a new empty `Map` on every read before anything was asked, which re-rendered the grid for nothing. **Shell** 4. `@object-ui/i18n`: the app's own locale list (`appContentLanguages`) moves to its own context, read with the new `useAppContentLanguages()`. The list lands late in boot; in the main context it re-rendered every `useObjectTranslation` reader (about 1,900 components on a list page). `useObjectTranslation()` and `useI18nContext()` no longer carry the field; its two readers (`LocaleSwitcher`, the profile page's language card) use the new hook. `@object-ui/react` re-exports the new hook beside the two it re-exports already (contract review S1). This removal narrows the published API: it is declared `Clause-②: yes (narrowing)` above and in the changeset, with a BREAKING section that names the replacement hook and the reason (about 1,900 first-load components no longer re-render when the list lands). 5. `@object-ui/layout`: the row memo from objectstack-ai#37722 also compares the capability checker by what it answers for a leaf row (`requiresObject`, `requiresService`), as it already did for the three target resolvers. ## Tests Each pin fails on `main` and passes here; I checked this by running each one against the `main` version of the source: - `plugin-grid/src/__tests__/listGridFirstRender-37575.test.tsx`: a list page grid never puts a row-end control in the DOM, not even for one commit (a MutationObserver reads added and removed nodes); attaching the fold's host renders nothing; re-reading verdicts with nothing answered keeps the same lookup. - `i18n/src/__tests__/provider-appContentLanguages-37575.test.tsx`: a memoised translation reader is not re-rendered when the list lands; a reader of the list is. - `layout/src/__tests__/NavigationRenderer.rowMemo-37575.test.tsx`: a new capability checker with the same answers redraws no leaf row, and one that hides a row removes it. Two list tests changed. `plugin-list` `ListView.harness` (objectui#6917 block) and `app-shell` `ObjectView.titleViewSwitcher-27594` read the record-count bar, which a grid does not draw: the grid draws the count in its resident footer row (`data-table-summary-lead`, objectstack#35702), and ListView hides the bar once the grid says so. The tests caught the bar in the frames before that, frames the grid no longer spends. They now read the grid's footer count. The expected numbers are unchanged, and both pass on `main` too. **Taken back out (head 6049056):** a first version mounted each sidebar row's Radix tooltip only in the icon rail, which saved about 750 mounts. Folding or docking the sidebar then swapped the row's wrapper, so its button remounted and keyboard focus was lost (`UnifiedSidebar.railOverlay-27593`, `UnifiedSidebar.hiddenCollapse-35062` caught it). The primitive under `components/src/ui` is not edited here, so that cut needs its own design. ## Acceptance notes <details><summary>Readings: Lighthouse 13.6.0 desktop, HTTP/2 TLS front, 10 runs per page, the objectstack-ai#37444 method; base and PR built and measured in the same session, back to back</summary> Production console build served by `objectstack start` (`NODE_ENV=production`) behind the local h2 front, signed in, cold cache, 4-core container. | Page | `main` 1028438 (median of 10) | this PR at 6049056 (median of 10) | Δ | |:--|--:|--:|--:| | Home | 2207 | 2214 | +7 (noise) | | Object list | 2768 | 2685 | −83 | | Record page | 2594 | 2504 | −90 | Sorted runs: main home 2130…2289, list 2583…2964, record 2494…2883; PR home 2143…2371, list 2516…2835, record 2417…2676. The machine read about 90 ms slower than the readings at session start (main list 2662 then, 2755 now), which is why both columns come from the same hour. React commit census, list page, on the build that still had the tooltip cut: components re-rendered before the rows mount went from about 10,300 to about 6,000. Without that cut the mounts stay as on `main`. Between the rows' DOM insertion and the first paint after it there is no commit any more (Performance observer + commit hook timestamps). </details> <details><summary>What is left: why the list and record pages are still over 2.5 s</summary> - Lighthouse's main-thread breakdown on the list page is about 2.0 s of script evaluation, almost all of it React render work attributed to `vendor-react`. The main thread is busy from about 600 ms to the paint. - Of what this PR leaves before the rows, the passes are mostly real content arriving: translation bundles (the `t` identity), object labels as the metadata store fills (`MetadataProvider`'s global `version` counter re-renders every metadata reader on each bump, 6 bumps on a list page), the app menu. Cutting those needs a selector-style metadata store, not a memo. That is an L-size change in `app-shell`, the next lever for this card. - Each row's ⋯ menu still mounts a Radix `DropdownMenu`, whose Popper anchor re-renders its trigger once (a ~460 component pass). Mounting the menu on first pointer or focus would remove it. - After the rows mount, 4 passes remain after the first paint and do not delay LCP: the view bar (`ManageViewsDialog`'s view-id array), the table's right shadow (measured in a layout effect), the object schema arriving, and the columns reseed. </details> ## Verification Read first, by risk: 1. `ui/packages/plugin-grid/src/ObjectGrid.tsx`, the loading branch: the root element must stay the same type, place and ref as the final return, or the fix silently stops working (the MutationObserver pin catches that). 2. `ui/packages/layout/src/NavigationRenderer.tsx`, `sameRowAnswers`: the capability checker is compared by answers for leaf rows. 3. `ui/packages/i18n/src/provider.tsx`: the new context and `useAppContentLanguages()`. Two-minute check: `pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/listGridFirstRender-37575.test.tsx packages/i18n/src/__tests__/provider-appContentLanguages-37575.test.tsx packages/layout/src/__tests__/NavigationRenderer.rowMemo-37575.test.tsx`. All the tests should pass. Local runs: the `plugin-grid` package (317 files, 2,794 tests), `layout`, `i18n`, the console's `pages/system` tests and the `LocaleSwitcher` tests all pass. Type checks pass for `i18n`, `layout`, `plugin-grid`, `app-shell` and the console. `eslint` on the changed files reports 0 errors. All 39 `dispatch-gates --commands` pass. One of them, `vitest run scripts/`, was killed for memory in the batch run, and I re-ran it on its own with 2 workers: 172 files passed. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgTd1y1ncyDVcgVtep5 <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgTd1y1ncyDVcgVtep5 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgTB7jMdUGcVwaMo3CH
Fixes #35425
Part of epic #34571 (area b1-CX). Maintainer ruling 7056785432, option A: 「两处都列全部 11 种」. Flow: dev-thread rule (the card thread builds itself; L1 at L1-a, the seat runs the declaration L2).
What changes
@object-ui/i18nprovider.offerableLanguagesis now every platform locale table language (11 today), whatever the app ships, and nevernull. A new context field,appContentLanguages, carries the table languages the app's own/api/v1/i18n/localeslist covers, ornullwhen not known (in flight, noloadLocaleswiring, signed out, a failed read, or an answer naming no table language). Theprovisionalself-heal still judges a stored value against the table, so an out-of-table code (th) is still reverted and purged.LocaleSwitcher(the sign-in page footer and the account menu are this one component) lists all 11. When the app list is known and leaves a language out, that row carries one muted line:console.localeSwitcher.appContentDefault, "App content shows in the default language" / 「应用内容显示为默认语言」 (says "default language", not "English", per the ruling). Signed out nothing is read about the app, so the sign-in page lists the 11 with no line. The menu's width is bounded (max-w-[min(20rem,calc(100vw-2rem))]) so a long hint wraps.appContentLanguages(never for "Use the deployment default", never for a stored out-of-table tag).console.localeSwitcher.appContentDefaultin the ten hand-written packs;zh-Hantregenerated withgen:zh-hant.GET /api/v1/i18n/locales, the language packs, the organisation default-language setting (it does not readofferableLanguages).Why
The account menu offered the platform table ∩ the app's declared locales (four on HotCRM), while the sign-in page, which has no session to ask the app with, offered all eleven. A language picked on the sign-in page (German, Korean) was then missing from the menu after sign-in. The ruling loosens ruling F of #29349 (implemented by #30514): one list everywhere, and the menu hint F rejected is now wanted.
Verification
@object-ui/i18nfull suite: 105 files, 1962 passed / 13 skipped.provider-app-locale-restorerewritten: offered = the table (also while in flight and unwired);appContentLanguages= table ∩ app list in app order, region variants read through the table,nullfor[],['th'], in flight and unwired; a storeddethe app does not ship is kept; a storedthis still reverted.LocaleSwitcher.appLocalesrewritten (12 cases): 11 rows for a four-language app with exactly 7 hints; a sign-in-pagedestays ticked after the app list lands and its hint reads in German; no hint while unknown (in flight,[], failed,['th']);thnever offered; stored spellings one row each, unmarked.ProfilePage*,i18nAfterSignIn-12034,loadLocales*,AuthFooter,LoginPagesuites: 18 files, 139 + 3 newProfilePage.languagecases passed (hint on an unshipped choice, none for the default, none while unknown, none forth).type-checkfor@object-ui/i18nand@object-ui/app-shell: clean. eslint on touched files: 0 errors.pnpm dev:crm -- --fresh(app-crm declaresen+zh-CN) + console on Vite, 1280 and 375, account with no saved language: sign-in menu lists 11 and no hint → pick Deutsch → sign in → interface still German, account menu lists 11 with Deutsch ticked and the German hint on every row but English / 简体中文 → switch to 한국어 and 简体中文, hint follows the interface language. Screenshots in the project's evidence folder (build-seat1/35425/).overlap-check.mjsclean before each push (shares the locale packs with feat(ui): one lighter dialog surface, a single column for short create dialogs, and 「Create more」 (#35980) #36038, fix(ui): a view a read-only package ships hides only Delete in Manage views and opens its view panel read-only #36037, feat(console): a change on a list is a draft, with Discard and Save (#35955 PR 1) #36026, feat(list): a phone list gets its own top row, one row of pills, and bottom-sheet sort, filter and view panels that apply on ✓ #36024: all merge cleanly).Acceptance notes (behaviour this PR does not change):
sys_user.locale) gets that language after sign-in rather than the sign-in-page pick: the pick is saved only when they have none (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). The picked language is still listed and selectable in the menu.Clause-②: yes (widening)
Metadata-protocol: none
@object-ui/i18naddsappContentLanguagesto the i18n context and the locale keyconsole.localeSwitcher.appContentDefault;offerableLanguagesloses| null(an output that is nevernullnow); nothing removed.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code