Repository navigation
feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation - #36858
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…is stored as that language's translation Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…relaxed rename Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
… for sourceLocale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…nu-rename-translation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 180 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7742278970ec0164a60d3bd306e28ad1ac515b2b && git checkout 7742278970ec0164a60d3bd306e28ad1ac515b2b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5c2e34cdb2b436f356ebba523e284e239f6ea351 2561fd5e28d735caf4367ec82a73cf68960c424c && git checkout -B drift-repro 5c2e34cdb2b436f356ebba523e284e239f6ea351 && git merge --no-ff 2561fd5e28d735caf4367ec82a73cf68960c424c
node scripts/docs-audit/affected-docs.mjs --json 5c2e34cdb2b436f356ebba523e284e239f6ea351
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract-review-claim: session_01WGufzesUz1Y8VZuKJRhVL8 · head 2561fd5 · 2026-11-24T06:00Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 Contract reviewServed-tier: Inputs read: card #36504 (body and all four comments, the claim 7120866660 and the os-dev-report 7123427766 included), PR #36858 (body, 28-file list, net diff against merge-base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
No must-fix, no should-fix. Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 席位核对 — ACCEPT · repo:objectstack#3 · head 2561fd5 · 2026-11-24T06:05ZL1 read of #36858 against card #36504. Head Face. Read and sound.
Changeset, read sentence by sentence. Every sentence matches the diff except the declaration line noted in N1. No must-fix, no should-fix. Out of scope, for the seat (cards to file at landing; neither is touched by this diff). These are the report's two
Notes (nit, no action required):
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU Landing · 2026-11-24T06:06Z · ACCEPT 7123581719 at head 2561fd5
Open findings: nits only (L1 N1–N4). Two out-of-scope |
…port-editing-own-entry Conflicts with #36858 (menu rename translation), resolved so both survive: - designModeMenuCreate.ts: keep this branch's dashboard-only creator (no report kind, no saveAndPublishInPackage); take #36858's input type `AppMenuSaveInput & { item: NewMenuItem }` and its import, dropping the now-unused `Menu` import, so the dashboard path carries `labels`. - DesignModeMenu.tsx: drop the report-slot block #36858 had edited to pass `labels`; the dashboard save keeps #36858's `labels`. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
…note say which toolbar draws Refresh (objectstack-ai#36872) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB9Gqqp1VYZwEqbXEm1YsTjU)_ Fixes objectstack-ai#36353 Clause-②: no Metadata-protocol: none repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB ## 维护者速读 - 用户无感:视图元数据里「紧凑工具栏」这一项的说明文字改了,写明默认就是紧凑工具栏、紧凑工具栏上没有刷新按钮;界面与行为都不变。 - 属于「列表页重做」专题的收尾:上一轮已把「刷新开关只管宽工具栏」写进刷新开关的说明,这次把相邻的工具栏说明和审计台账补齐。 - 出错时最坏是说明文字不准,作者或智能体误判某个开关管哪个工具栏;只改文字,可整体撤回。 - 无。 ## What changes - `packages/spec/src/ui/view.zod.ts`, the `compactToolbar` describe: the first sentence is kept and two are added. It now says the compact toolbar is on by default (omitted or `true`; `false` draws the wide toolbar, one button per control) and that the compact toolbar draws no Refresh button, so `userActions.refresh` governs only the wide toolbar; pull-to-refresh is unaffected by either key. The wording follows the `userActions.refresh` describe that objectstack-ai#36339 landed ("Governs only the wide toolbar's Refresh button (`compactToolbar: false`): the default toolbar has no Refresh, so the toggle changes nothing there."). - `packages/spec/src/ui/view.form.ts`: the view form's `compactToolbar` hint mirrors the new describe. The hint == describe pin (`src/ui/view-form-composite-children.test.ts`, "top-level rows that gained a hint carry their schema description") requires it. - `packages/spec/liveness/view.json`, the `userActions` note: the `userActions.refresh` sentence now says it drives only the wide toolbar's Refresh button and names the reader by line: `showRefresh` at `ui/packages/plugin-list/src/ListView.tsx:2710`, the button at `:8125` behind `!compactToolbar`, measured at `5c2e34cdb`. The verdict stays `live`. - Regenerated, not hand-edited: `content/docs/references/{ui/view,data/object,api/protocol}.mdx` (`check:generated --fix`, which found only `check:docs` stale) and `packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts` (`node scripts/check-i18n-bundles.mjs --write --filter=platform-objects`; translated locales keep their wording). - Changeset `.changeset/36353-compact-toolbar-refresh-describe.md`: patch for `@objectstack/spec` and `@objectstack/platform-objects`. Description text only. `compactToolbar` stays `z.boolean().optional()` and `userActions.refresh` is not touched, so no key, type, default or optionality changes and the accept set is the same. What the new sentences rest on, read on `origin/main` `5c2e34cdb` (`ui/packages/plugin-list/src/ListView.tsx`): 1. Default: `compactToolbar: schema.compactToolbar !== false` (`:2718`). The plugin-list registry input already says "On by default; `false` draws one toolbar button per control" (`ui/packages/plugin-list/src/index.tsx:236`). 2. No Refresh in the compact toolbar: the only Refresh button is `toolbarFlags.showRefresh && !toolbarFlags.compactToolbar` (`:8125`, `data-testid="refresh-button"`). `ViewSettingsPopover` gets no refresh prop (the `viewSettingsElement` at `:7548`), and `components/ViewSettingsPopover.tsx` has no `refresh` hit at all. 3. Pull-to-refresh: `usePullToRefresh({ onRefresh: handlePullRefresh, enabled: !!dataSource && !!schema.objectName })` (`:3680`), attached unconditionally to the list root (`ref={pullRef}`, `:7637`). It reads neither `compactToolbar` nor `userActions.refresh`. Prior rulings: `check-prior-rulings --paths` over both files lists 146 hit lines. The ones near the edited lines (view.zod.ts `:3710` ruling 6095014058 letter A on `sharing`, `:3733` objectstack-ai#15184 ruling B on composition order, `:1935`/`:1946` the `hideFields`/`editInline` defaults; view.json `:236`, `:250`, `:254`) are about other keys, and none governs `compactToolbar` or the refresh scope. No ADR names `compactToolbar`. The scope sentence restates what objectstack-ai#36339's describe already says (contract review record 7076152814, N2 and N3), and no ruling is reversed. Read first, by risk: 1. `packages/spec/src/ui/view.zod.ts`, the `compactToolbar` line: this is the published schema text, and the contract review reads it. 2. `packages/spec/liveness/view.json`, the `userActions` note: the line numbers it cites. ## Tests Final head: `ca02fd3f8`. Every local reading below was taken against that head's tree. <details><summary>Local readings (builds and tests under scripts/pm/os-verify-lock.sh)</summary> - `pnpm --filter @objectstack/spec build`: VERDICT command-exit 0. - `pnpm --filter @objectstack/spec check:generated --fix`: rebuilt the package first, and regenerated only `check:docs` (`content/docs/references/**`), the one artifact it found stale. A re-run of `check:generated` then exited 0. - `pnpm --filter @objectstack/spec test`: Test Files 885 passed (885), Tests 28146 passed, 1 todo (28147), exit 0. - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/platform-objects test`: Test Files 125 passed (125), Tests 2126 passed (2126), exit 0. `typecheck`: exit 0. - The hint == describe pin `src/ui/view-form-composite-children.test.ts`: Test Files 1 passed (1), Tests 20 passed (20), VERDICT command-exit 0. With `view-form-pagination.test.ts` and `view.test.ts`: 3 files, 573 tests passed. - `node scripts/check-i18n-bundles.mjs`: before the regeneration, "platform-objects: 1 bundle(s) drifted from the schema". After `--write --filter=platform-objects`: "OK (10 package(s), all bundles in sync)". This ran after the build of the `@objectstack/cli` + `@objectstack/platform-objects` closure (VERDICT command-exit 0). </details> No ablation and no reverse verification: the diff changes description text, a ledger note and generated output, and no tested behaviour. ## Acceptance notes - Card "Done when" 1 (describe states the default, no Refresh in the compact toolbar, pull-to-refresh unaffected, matching `ListView.tsx` on `main`; form hint, regenerated docs and the hint == describe pin in step): done; see the three readings above. The pin passes. - Card "Done when" 2 (liveness note names the wide-toolbar scope and the current reader line): done (`:2710` reader, `:8125` button). - Noted, not filed: the note's first sentence still cites `ListView.tsx:374 toolbarFlags`, an older objectui line, for the whole `userActions` row. Only the refresh sentence is in this card's scope. Today the memo is at `ui/packages/plugin-list/src/ListView.tsx:2700-2729`. - Noted, not filed: the ten translated `compactToolbar` hints (and `ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts:440`) carry only the first sentence. They are still true, just less precise than English. Translating them is a translator's edit, as with objectstack-ai#36339's `refresh` hint. - Overlap: `node scripts/pm/overlap-check.mjs` reports a textual conflict with objectstack-ai#36802 in the generated `content/docs/references/data/object.mdx` only. That file is routed `merge=os-regen` (`.gitattributes:159`), so whichever PR lands second regenerates it with `check:generated --fix`. It merges cleanly against `origin/main`, objectstack-ai#36857 (which shares `view.zod.ts`) and objectstack-ai#36858. ## Verification Two-minute check: `pnpm --filter @objectstack/spec exec vitest run src/ui/view-form-composite-children.test.ts` shows 20 passed. `grep -n "compactToolbar: z" packages/spec/src/ui/view.zod.ts` shows the new describe after `z.boolean().optional()`. <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` on the final diff named 112 commands, and all of them ran locally. The `--ran` reconciliation reads "112 derived famil(ies) accounted for, 112 run, 0 NOT-MEASURED". - 108 exited 0. The other four: - Exit 3, PREREQUISITE NOT MET, so NOT MEASURED locally (CI measures them): `node scripts/check-plugin-teardown-shape.mjs --self-test`, because the shallow clone cannot reach its pinned fixture commit; `pnpm check:dual-build-cjs-loads`, because the whole-tree dist is absent; `pnpm --filter @objectstack/spec run check:skill-examples`, because some workspace dists are absent. - Exit 1: `pnpm check:platform-checklist`, "ABSENT SYMBOL `packages/metadata-core/src/anonymous-form-intake.ts#anonymousFormExplicitWithdrawals`" in `docs/qa/platform-checklist/areas/access-security.json`. This diff touches neither file. The symbol is absent from that source at the base `5c2e34cdb` and at the current `origin/main` `d9c799c10`, so it is red independently of this PR, and it is reported to the seat. - `pnpm --filter @objectstack/spec check:generated`: exit 0. `node scripts/check-i18n-bundles.mjs`: exit 0. `node scripts/pm/overlap-check.mjs`: see Acceptance notes. - `node scripts/check-dev-prereqs.mjs` (a local-only family): exit 1, "the workspace is not built" (44 of 108 package dists absent in this container). This describes the machine and says nothing about the diff. - `node scripts/pm/dispatch-gates.mjs --tier`: no path-derived mandate. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…h design mode (objectstack-ai#36848) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB9qsP28anD5tWRUHq8j1xSU)_ Fixes objectstack-ai#36692 Clause-②: no Metadata-protocol: none repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU ## 维护者速读 - 管理员在应用里点「设计布局」时,添加菜单项的「报表」一栏只列已有报表,不再有「新建报表…」;新建报表改在报表列表页右上角的「新建报表」按钮;仪表盘或报表正在编辑时点「设计布局」会提示先保存或取消,设计布局开着时仪表盘和报表的「编辑」按钮不出现。 - 落实维护者「照 Twenty 分开」的裁决:报表和仪表盘的编辑与设计布局是两个入口,屏幕上任何时候只有一套保存/取消。 - 出错时管理员会看到两套保存按钮或点不出新建报表;本改动不碰任何已保存的数据,合并后可直接撤回。 - 无 ## What changes The maintainer's ruling on the decision card (2026-11-23 11:55Z): 「照 Twenty 分开」. Report and dashboard editing are their own entries, mutually exclusive with design mode, so the screen shows one Save/Cancel set at a time. 1. **Design mode stops hosting the report builder.** The `Reports` list in 「Add menu item」 only links reports that exist. Removed: its 「New report…」 row, the cross-mode hand-off module `designModeReportSlot.ts` (deleted, not left unused), the slot block in `DesignModeMenu`, the slot branch in `ReportNewPage`, and the `report` kind of `designModeMenuCreate.ts` (a dashboard is again the one kind made from a name). 「New dashboard…」 is unchanged (change item 4). 2. **A report is created from its own entry.** The reports index (`AppReportIndexView`) header offers 「New report」, linking to the app's `reports/new`. It is gated as the builder is (`useWorkspaceAdminStatus`: workspace admin, resolved) and shown on an empty index too. The builder's Save and Close in its own header are the only Save/Cancel set; Close goes back to the index. 3. **Two-way exclusion, through one hold on the shell's design-mode store** (`designMode.tsx`): - `useHoldDesignModeOut(open)`: a dashboard's or report's own editor holds the mode out while it is open (or opening). Wired into `useDashboardInPageEdit`, `ReportView` (builder and inspector panel) and `ReportNewPage`. - The mode's `enter` now answers `boolean`: while anything holds the mode out, it refuses with a toast, "Save or cancel your dashboard or report changes before designing the layout." (zh-Hans 「请先保存或取消仪表盘、报表的修改,再设计布局。」). 「Design layout」 in the app menu stays drawn and refuses through it. - While the mode is on, `useDesignModeActive()` hides the dashboard's Edit (`useDashboardEditOffered`), the report page's Edit, and the index's 「New report」. - `ReportNewPage` reached while the mode is on (an in-app navigation keeps the mode) draws no builder: an Empty says "Finish designing the layout first" / "A report is built outside the design mode. Save or cancel the layout, and the builder opens here." It holds the mode out only while it draws the builder, so the bar's Save or Cancel opens the builder in place (L1-a S1, 7122753474). - This also closes the path the card measured: the bar's Cancel ending design mode while a dashboard stays in edit. The bar can no longer appear while an editor is open. 4. **Strings:** `designMode.editorOpen`, `console.reportIndex.newReport`, `report.builder.designModeOnTitle` and `report.builder.designModeOn` were added to all 11 packs (zh-Hant regenerated with `gen:zh-hant`). `designMode.menu.newReport`, `designMode.menu.newReportLeft` and `report.builder.addsToMenu` were removed from all 11 packs. The de quote-pair ledger drops 134 to 133 because `newReportLeft` is gone. Untouched rulings: objectstack-ai#36363 ruling (4) (menu labels) and `designModeMenuCreate.ts` ruling C / ADR-0146 D2 「定制都进 .custom」. Docs and skills: neither `content/docs` nor `skills/` teaches "New report… from design mode". The one `New report` hit, `content/docs/data-modeling/analytics.mdx`, is about Studio's dataset picker, so nothing is owed. **Read first (by risk):** 1. `ui/packages/app-shell/src/layout/designMode.tsx`: the `heldOut` counter, `enter`'s refusal and `useHoldDesignModeOut`. 2. `ui/packages/app-shell/src/views/DashboardInPageEditor.tsx`: `useDashboardEditOffered` now also reads the mode. The design mode's 「New dashboard…」 landing (`dashboardEditArrival`) still opens the edit state, because `saveWith` leaves the mode before it navigates and the arrival effect waits on `editOffered`. 3. `ui/packages/app-shell/src/layout/DesignModeMenu.tsx`: the removed report block and picker row. **Two-minute check:** as admin in the showcase app, open Reports. 「New report」 is at the top right. Open a dashboard, press Edit, then choose app menu, then 「Design layout」: a red toast says to save or cancel first, and no purple bar appears. ## Tests New pins go into each component's existing harness as a top-level `describe` where there is one (`designMode-36362`, `SidebarAppMenu-36112`, `DesignModeMenu-36363`, `designModeMenuCreate-36364`, `DashboardView.inPageEdit-36372`). New card-named files were added where the component has only per-card files: `ReportView.designModeExclusion-36692`, `ReportNewPage-36692` and `AppReportIndex.newReport-36692`. - Exclusion while an editor is open: `enter` refuses with the prompt and the mode stays off. This is pinned on the store, on the 「Design layout」 door, on the dashboard edit state (no bar, so no bar Cancel), on the report builder, on the report inspector panel, and on the new-report builder. Two editors hold the mode out until both close, and an editor unmounted while open lets go. - Exclusion while the mode is on: no dashboard Edit, no report Edit, no 「New report」 on the index; each comes back once the mode is left. - The picker: `Reports` lists existing reports not yet in the menu and has no 「New report…」 row. Picking a report stages it with the mode, writes nothing and navigates nowhere. - `ReportNewPage` under the mode (round 2, `ReportNewPage-36692`): mode on at the index, then `reports/new`: the mode stays on, no builder, no Save, the prompt shows; then the bar's Cancel: the mode is off, the builder is drawn, and a later `enter()` is refused; control: mode off, `reports/new` draws the builder with Save and no prompt. - `ReportNewPage` saves on its own (the deleted `ReportNewPage.menuSlot-36364` file's surviving case, ported), and Close goes back to the index. - Removed with the behaviour they pinned: the report-half cases in `DesignModeMenu-36363` and `designModeMenuCreate-36364`, and `ReportNewPage.menuSlot-36364.test.tsx`. <details><summary>Local runs</summary> - Pre-merge head `22dee19f5`: `@object-ui/app-shell` full suite: Test Files 2474 passed, 1 skipped (2475); Tests 23314 passed, 9 skipped. `@object-ui/i18n` suite: 107 files, 2006 passed. `type-check` for both packages exited 0. - After merging origin/main (head `7ea3843ec`, which carries objectstack-ai#36821): the app-shell closure was rebuilt and `type-check` for both packages exited 0. `@object-ui/i18n` suite: 108 files, 2011 passed. Scoped app-shell run (`src/layout/` plus the ReportView, ReportNewPage, DashboardView, AppReportIndex and reportBuilder files): 190 files, 1535 passed. This run was narrowed on purpose; CI's `Test UI` runs the full suite. - Ablation 1, committed fix, `scripts/ablation-replace.mjs`: in `enter`, `if (heldOut > 0) {` was changed to `if (heldOut < 0) {` (anchor 1 to 0, blob `473cab2c7389` to `7793aa4658ec`). Result: 7 failed (every refusal pin across five files). Restored blob equals HEAD and `git diff HEAD` is empty. - Ablation 2: in `useDashboardEditOffered`, `return gated && !designing;` was changed to `return gated;`. Result: 1 failed ("while the mode is on, Edit is not offered"). Restored, blob equals HEAD. - Round 2, head `cccd01739`: `ReportNewPage-36692` 6/6. Ablation 3, committed fix: `if (designing) {` changed to `if (false as boolean) {` (blob `f81d258a824f` to `fa265e66e744`): 1 failed, 5 passed, the mode-on pin red; restored blob equals HEAD. Scoped run (`packages/i18n/` plus app-shell `src/layout/`, ReportView, ReportNewPage, DashboardView, AppReportIndex, reportBuilder): 298 files, 3549 passed, 13 skipped. `type-check` for both packages exited 0. </details> ## Acceptance notes - Browser screenshots: showcase app as admin, console served by Vite from this branch's `ui/` against a `--seed-admin` backend on its own port. The files are in the project files under `issue-36692/`: - `1-reports-index-new-report.png`: the reports index with 「New report」. - `1b-builder-one-save-set.png`: the builder it opens, showing only its own Discard/Save. - `2a-design-mode-index-no-new-report.png`: design mode on, so no 「New report」. - `2b-design-mode-reports-picker.png`: the design-mode Reports picker without 「New report…」. The showcase's reports are all in its menu already, so the picker reads "Nothing to add here". - `3-refusal-prompt.png`: the dashboard in edit, and 「Design layout」 refused with the prompt. - `4-design-mode-dashboard-no-edit.png`: design mode on, so the dashboard has no Edit. - A typed `reports/new` URL reloads the page, so the mode is gone. An in-app navigation to `reports/new` keeps the mode, and there the page now draws the prompt instead of the builder (round 2). The index link is hidden while the mode is on. - Open PR objectstack-ai#36858 overlaps this branch textually in `DesignModeMenu.tsx` and `designModeMenuCreate.ts` (this PR removes the report half there). Whichever lands second resolves it. - `objectstack-ai#36791` will conflict with this branch on the de quote-pair ledger counts (`de-quote-pairing-3876.test.ts`). Whichever lands second re-counts. ## Verification Derived gate families (`dispatch-gates.mjs --commands` at `7ea3843ec`) were run locally; their results are in the report comment on the card. CI carries the full farm. --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU)_ <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…objectstack-ai#37381) Fixes objectstack-ai#36875 Clause-②: no Metadata-protocol: none ## 维护者速读 用户能看到什么变化:搭建者在设计模式里给记录页签改名时,「能不能改名」改按应用的源语言判断,不再按部署的默认语言判断;默认语言与源语言相同的部署用户无感。 为什么做:接着菜单改名已改用源语言的那项工作,把记录页签改名补齐到同一种判断。 出错会怎样:默认语言与源语言不同的部署上,页签名可能被当成源文字写入或该能改时改不了;本改动只换判断依据,可直接撤回。 要你做什么:无 ## What changes `ui/packages/app-shell/src/views/recordTabsConfigIo.tsx` decided "source language" with `fetchDefaultLocale()` + `isSameLanguage(language, defaultLocale)`. It now reads the deployment's languages through the reader PR objectstack-ai#36858 added, `fetchDeploymentLocales()`, and asks `labelLanguageOf(language, locales).source`, the exact gate the menu rename uses. That reader takes the served `sourceLocale` and falls back to the default locale when the server serves none, so the fallback is the reader's own. No second fetch: the reader is cached per page load and shared with the menu. What the editor does with the answer is unchanged: in the source language a rename opens and writes the stored label; in any other language the rename button is disabled with the hint "Tab names are changed in the app's source language". ## Tests New file `ui/packages/app-shell/src/views/__tests__/RecordTabsConfig-36875.test.tsx`, same harness as the objectstack-ai#36499 suite, the `GET /i18n/locales` fake now serving `sourceLocale`: 1. default locale zh-CN, source en, reader in zh-CN: rename disabled with the source-only hint, Save disabled, nothing written. 2. default locale zh-CN, source en, reader in en: rename opens, Save writes `relatedLists` `[{ list: 'contact', label: 'Contacts we know' }, 'task']` through the draft save, then publish. 3. no `sourceLocale` served: the default locale is the source, as before (zh-CN reader renames, en reader cannot). Reverse check (one-off, no file kept): with the fix committed (`e2288d21`), `recordTabsConfigIo.tsx` was put back to `origin/main` and the new file run. Cases 1 and 2 turned red (`Tests 2 failed | 1 passed (3)`), case 3 stayed green as expected (fallback behaviour is unchanged). Restored with `git checkout HEAD -- PATH`; HEAD blob hash matched, `git diff HEAD` empty. ## Acceptance notes - Acceptance item 2 says the test "stores a tab rename as a translation". The record-tabs editor has no translation write path: outside the source language its rename is closed by design (objectstack-ai#36499, ruling (4) precedent), it never writes a translation. The test therefore proves the side the fix controls: a reader in a default locale that is not the source language cannot write the tab name as the source label, and a reader in the source language can. Adding a translation write to record tabs would be a new capability, not this card. - `fetchDefaultLocale` in `layout/designModeMenuSave.ts` has no caller after this change (it was the only one). Left in place: that file is the objectstack-ai#36858 reader's and outside this card's file surface. - The lazy-import comment in `RecordTabsConfig.tsx` (~L95) still says "the default language"; comment only, outside the file surface. - No other design-mode rename path gates on the default locale: `git grep` for `fetchDefaultLocale` / `isSameLanguage(` under `ui/` finds only the reader itself. ## Verification Two-minute check: `cd ui && pnpm exec vitest run packages/app-shell/src/views/__tests__/RecordTabsConfig-36875.test.tsx` → 3 passed. Read first: `ui/packages/app-shell/src/views/recordTabsConfigIo.tsx` (the whole change is the gate line and the fetch it reads). <details><summary>Local readings at e2288d2</summary> - `pnpm --filter '@object-ui/app-shell^...' build` → VERDICT command-exit 0 - `cd ui && pnpm exec vitest run --maxWorkers=2` the three RecordTabsConfig suites + `packages/app-shell/src/layout/` → Test Files 167 passed (167), Tests 1467 passed (1467) - `pnpm --filter @object-ui/app-shell run type-check` → exit 0 - `node scripts/pm/dispatch-gates.mjs --commands`: 38 derived commands, all exit 0; `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero). `pnpm --dir ui exec vitest run scripts/` was OOM-killed on the first unlocked run on the shared box, rerun under the verify lock with `--maxWorkers=2`: 172 passed, 2 skipped files. - `node scripts/pm/overlap-check.mjs --branch=HEAD` → VERDICT clean exit 0 </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv)_ Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
… the default and source locale (objectstack-ai#37614) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#36873 Clause-②: no (published prose only; names a member the locales read already returns on main) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:AI 助手照多语言技能文档写客户端时,现在知道 `GET /api/v1/i18n/locales` 的应答里除了标出默认语言,还会给出 `sourceLocale`,也就是界面上直接写的文字是哪种语言。以前文档只说了有这个接口,没说它返回什么。 - 为什么做:这个字段已经由 objectstack-ai#36858 加到接口里,技能文档还没跟上,是那张卡欠下的技能说明。 - 出错会怎样:只改技能文字,不动产品。写错的话助手可能把译文写到错误的语言上,撤回这次改动即可。为了不让文档变长,同一文件里压缩了两处说法,没有删掉任何事实。 - 要你做什么:这是受管的技能文件,需要审批人批准后才能合并。 ## What changes `skills/objectstack-i18n/SKILL.md`, plus a `patch` changeset for `@objectstack/skills`. - **Registration** (the sentence that names the plugin's routes). Before: "It self-registers `GET /api/v1/i18n/locales`, `/translations/:locale` and `/labels/:object/:locale`." After, it adds: "the locales answer marks the default locale (`isDefault`) and names `sourceLocale` (the declared one, else the default)". Checked against `GetLocalesResponseSchema` in `packages/spec/src/api/protocol.zod.ts`. - **Paid in the same file, no fact removed, net line count unchanged:** - The note that the contract's `.ts` source does not ship is now one line ("Only `src/**/*.zod.ts` ships, so the contract's `.ts` source is not in `node_modules` to read."). - The optional-methods sentence drops "Treat them as" ("… that **no shipped implementation provides**: extension points for a custom workbench or TMS adapter."). Small calls made here (no card): - The clause sits at the Registration sentence rather than the `sourceLocale` config-table row, because that is where a client author meets the route. - It does not say the member is absent when the server knows neither a declared source locale nor a default (the schema's `.describe()`), nor name the answer's other optional member, `fallbackChain`. The card asks for one clause on `sourceLocale` only. ## Why PR objectstack-ai#36858 (objectstack-ai#36504) made `GET /api/v1/i18n/locales` name the source locale. The skill named the route and said nothing about its answer, so an agent building a client that writes translations had no pointer to it. ## Verification Run at `911e5701c`, each exit 0: - `node scripts/check-skills-token-ratchet.mjs`: `skills/objectstack-i18n/SKILL.md` is 6306 tokens, ceiling 6333. - `node scripts/check-skill-links.mjs`. - `node scripts/check-skill-identifier-liveness.mjs`. - `node scripts/check-skill-top-level-keys.mjs`. - `pnpm --filter @objectstack/spec check:skill-refs`: 10 generated files in sync. - `pnpm --filter @objectstack/spec check:skill-docs`: in sync. - `node scripts/pm/overlap-check.mjs`. The sentence was drafted by a contract-tier subagent, as `dispatch-gates --tier` requires for `skills/**`, and reviewed and narrowed here. Contract review (L2) is owed before landing: `skills/**` is a governed surface (Tier H). ## 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_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Yibo Wang · project thread
Fixes #36504
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #36873 (
skills/objectstack-i18n/SKILL.md:387namesGET /api/v1/i18n/localesbut not its answer, so it does not name thesourceLocalemember this PR adds)repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU
维护者速读
The contract widening (for the contract-tier review)
GetLocalesResponseSchemagains one optional member,sourceLocale: string(packages/spec/src/api/protocol.zod.ts). It is the declaredi18n.sourceLocale, else the default locale: the collapse every metadata-document translator already makes (getSourceLocale?.() ?? getDefaultLocale?.(), the caller's to make per theII18nService.getSourceLocalecontract). It is absent only when the server knows neither. The name follows its config key (i18n.sourceLocale,translation.zod.ts), the precedent being the body's ownisDefaultmark named fori18n.defaultLocale. The shard moved, measured:packages/spec/authorable-surface/api.jsongainsapi/GetLocalesResponse:sourceLocale(regenerated, not hand-edited), soMetadata-protocol: addedand@objectstack/specminor. The one producer is the dispatcher's/i18ndomain (packages/runtime/src/domains/i18n.ts); service-i18n serves no body of its own for this route (its ledger row points at the SDK).What changes
GET /api/v1/i18n/localesnames the source locale (above).labelGoesToTranslation,designModeMenuModel.ts):The dialog says so when the name will be a translation.
designModeMenuSave.ts): thetranslationitemAPP_menu_LOCALE(crm_menu_zh_cn), keyapps.APP.navigation.ID.label(the keytranslateAppreads), in the package the menu is written to: the app's own when writable, else its.custompair (ADR-0146 D2). The item as stored is read through/layers, its other keys kept, and written by the menu's confirmed-save rule (first-write pin, publish pinned to the row read, a refused publish discards the draft). It is written before the menu; a translation-only save writes no app.rebaseMenuEditsnow reports a fresh id throughwrittenAs). Measured:AppSchemaaccepts a label-lessurlentry, so no placeholder is invented; a source-language reader sees the URL until someone names it there.designMode.menu.renameSourceOnlyis replaced byrenameTranslation, andtranslationPendingDraftis added, in all eleven packs (zh-Hant regenerated)./i18n/localessay it names the source locale;content/docs/references/api/protocol.mdxregenerated.Done-when, item by item
GET /i18n/localesexposes the source locale, pinned:packages/runtime/src/i18n-supported-locales.test.ts(realAppPlugin+ memory i18n + dispatcher;defaultLocale: 'zh-CN', sourceLocale: 'en'answerssourceLocale: 'en'; no declaration answers the default) andprotocol.test.ts(the parse keeps the member).translateApp, zh-CN shows the new name and an English reader the base label (designModeMenuSave-36363.test.ts, and end to end inDesignModeMenu-36363.test.tsx).objects.OBJECT...and is read bytranslateObjectwith its own packaged-base and field-patch ranks (ADR-0146 D10), so it needs its own split rule rather than this menu's. The locale read (fetchDeploymentLocales,labelLanguageOf) is shared and reusable.Server-side reach, measured before building the console half
A translation row in the
.custompair is served at rank 1 on the override (getPairTranslationBundle→pairBundle,labelCatalogs), for nodes the override changed and nodes it left alone; the real-boot pin ispackages/objectql/src/protocol-custom-override-bare-slot-envelope.test.ts(the #30504 describe: a node on the pair's override reads the pair's translation). An own-package app's row reaches the deployment catalog through the authored-translation sync.Tests
Local readings (head after the last fix commit)
pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/api/protocol.test.ts src/system/i18n-resolver.test.ts: Test Files 2 passed, Tests 811 passed.pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/i18n-supported-locales.test.ts src/i18n-success-envelope.conformance.test.ts src/domains/i18n-anonymous-deny.test.ts: the anonymous-deny literal needed the new member (fixed in this PR); see the report comment for the final reading.ui:vitest run --maxWorkers=2 packages/app-shell/src/layout/__tests__/ packages/i18n/src/__tests__/plus the two RecordTabsConfig suites (which share the locales read): 271 files, one stale zh-Hant catalogue (regenerated in this PR); final reading in the report comment.pnpm --filter @objectstack/spec check:generated: 14 of 14 current after--fix(check:docs regeneratedprotocol.mdx; authorable-surface regenerated over the merged tree).pnpm --filter @objectstack/runtime typecheck:tsc --noEmitclean;check:test-typechecknames three files this diff does not touch (boolean-written-spelling-row-scope.test.ts,meta-object-publish-column-changes.test.ts,organization-ownership-boot-guard.turso-remote.kernel.test.ts), left to CI's reading.type-checkof@object-ui/app-shelland@object-ui/i18n: NOT MEASURED locally (the ui project references need every ui package'sdist); CI's Type Check UI carries it.Ablations (one per tested behaviour, restored by `git checkout HEAD`, restore proven by an empty `git diff HEAD`)
sourceLocale(ablation-replace.mjsondomains/i18n.ts):i18n-supported-locales.test.tsred (exit 1); restored clean.labelGoesToTranslationanswers "stored" outside the source language:designModeMenuSave-36363.test.tsandDesignModeMenu-36363.test.tsxred (exit 1); restored clean.Acceptance notes
DesignModeMenu.tsx(its removal of the report-slot block meets this PR'slabelsargument on the report save) anddesignModeMenuCreate.ts(imports). Mechanical; the second to land resolves.designModeMenuCreate.tsis touched for one type line (AppMenuSaveInput & { item }) so a dashboard or report created from the picker carries the label language too; without it a zh rename staged before 「New dashboard…」 would be written to the stored label.readAuthoredTranslationLayer); the design mode writes and reads only its ownAPP_menu_LOCALEitem.label: { en, zh-CN }) still replaces the whole map with a string, as before this PR; noted, not changed here.RecordTabsConfig's tab-rename gate still compares the session with the default locale (fetchDefaultLocale, unchanged behaviour); withsourceLocalenow served it can compare with the source locale. Reported to the seat, not changed here.Verification
First read (by risk):
ui/packages/app-shell/src/layout/designModeMenuSave.ts(prepareAppMenuSavelabel split andwriteMenuTranslation),ui/packages/app-shell/src/layout/designModeMenuModel.ts(labelGoesToTranslation,splitLabelEdits,writtenAs),packages/runtime/src/domains/i18n.ts(the locales body).Two minutes:
cd ui && pnpm exec vitest run packages/app-shell/src/layout/__tests__/designModeMenuSave-36363.test.ts— expect theobjectstack#36504describes green, including "a rename under zh-CN over an English source: the zh-CN translation is written and published, the stored label is not".Generated by Claude Code