Skip to content

feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation - #36858

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-36504-menu-rename-translation
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-36504-menu-rename-translation

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #36504
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #36873 (skills/objectstack-i18n/SKILL.md:387 names GET /api/v1/i18n/locales but not its answer, so it does not name the sourceLocale member this PR adds)

repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU

维护者速读

  • 管理员在设计布局模式下改菜单名称时,用非源语言(例如中文界面、英文源语言)改的名字只对该语言生效,其他语言仍显示原名称;以前在非默认语言下改名会被禁止,或在默认语言下改名会覆盖所有语言。
  • 属于设计布局(应用内直接调整菜单)专题,补上“菜单改名按语言落地”这一半,并让服务端告诉控制台哪种语言是源语言。
  • 出错时最坏情况是某个语言下的新名称没有生效(显示原名称),原有名称不会被改坏;改动可通过在 Studio 删除对应的翻译条目直接撤回。
  • 无

The contract widening (for the contract-tier review)

GetLocalesResponseSchema gains one optional member, sourceLocale: string (packages/spec/src/api/protocol.zod.ts). It is the declared i18n.sourceLocale, else the default locale: the collapse every metadata-document translator already makes (getSourceLocale?.() ?? getDefaultLocale?.(), the caller's to make per the II18nService.getSourceLocale contract). 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 own isDefault mark named for i18n.defaultLocale. The shard moved, measured: packages/spec/authorable-surface/api.json gains api/GetLocalesResponse:sourceLocale (regenerated, not hand-edited), so Metadata-protocol: added and @objectstack/spec minor. The one producer is the dispatcher's /i18n domain (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/locales names the source locale (above).
  • Design mode, 「Rename and icon」: the name field is open in every language. Where the name lands is the save's rule (labelGoesToTranslation, designModeMenuModel.ts):
    • typed in the source language over an entry shown by its stored label: the stored label, as before;
    • typed in any other language, or in the source language over a translation the reader was shown: that language's translation, and the stored label is kept.
      The dialog says so when the name will be a translation.
  • The translation write (designModeMenuSave.ts): the translation item APP_menu_LOCALE (crm_menu_zh_cn), key apps.APP.navigation.ID.label (the key translateApp reads), in the package the menu is written to: the app's own when writable, else its .custom pair (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.
  • N5 (comment 7083013814): a link added outside the source language is stored without a label, its typed name written as that language's translation, keyed by the id the entry is stored under (rebaseMenuEdits now reports a fresh id through writtenAs). Measured: AppSchema accepts a label-less url entry, so no placeholder is invented; a source-language reader sees the URL until someone names it there.
  • Unknown languages (the locales read failed): every typed name is a translation, which never changes what another language reads.
  • Strings: designMode.menu.renameSourceOnly is replaced by renameTranslation, and translationPendingDraft is added, in all eleven packs (zh-Hant regenerated).
  • Docs: the two route tables that list /i18n/locales say it names the source locale; content/docs/references/api/protocol.mdx regenerated.

Done-when, item by item

  1. GET /i18n/locales exposes the source locale, pinned: packages/runtime/src/i18n-supported-locales.test.ts (real AppPlugin + memory i18n + dispatcher; defaultLocale: 'zh-CN', sourceLocale: 'en' answers sourceLocale: 'en'; no declaration answers the default) and protocol.test.ts (the parse keeps the member).
  2. A zh-CN rename over an English source writes the zh-CN translation and leaves the stored label; read back through translateApp, zh-CN shows the new name and an English reader the base label (designModeMenuSave-36363.test.ts, and end to end in DesignModeMenu-36363.test.tsx).
  3. The guard is relaxed: both former guard pins are rewritten to the new behaviour.
  4. Object and field labels: not served by this path. The console edits no object or field label in design mode today, and a translation of those lives under objects.OBJECT... and is read by translateObject with 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 .custom pair 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 is packages/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 regenerated protocol.mdx; authorable-surface regenerated over the merged tree).
  • pnpm --filter @objectstack/runtime typecheck: tsc --noEmit clean; check:test-typecheck names 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-check of @object-ui/app-shell and @object-ui/i18n: NOT MEASURED locally (the ui project references need every ui package's dist); 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`)
  • The producer stops emitting sourceLocale (ablation-replace.mjs on domains/i18n.ts): i18n-supported-locales.test.ts red (exit 1); restored clean.
  • labelGoesToTranslation answers "stored" outside the source language: designModeMenuSave-36363.test.ts and DesignModeMenu-36363.test.tsx red (exit 1); restored clean.

Acceptance notes

  • Overlap: fix(console): report editing is its own entry, mutually exclusive with design mode #36848 (report editing, this area, draft) conflicts textually in DesignModeMenu.tsx (its removal of the report-slot block meets this PR's labels argument on the report save) and designModeMenuCreate.ts (imports). Mechanical; the second to land resolves.
  • File surface: designModeMenuCreate.ts is 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.
  • A translation item of another name for the same locale in the pair that keys the same navigation id merges by item name order (readAuthoredTranslationLayer); the design mode writes and reads only its own APP_menu_LOCALE item.
  • In the source language, a rename over a stored inline locale map (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); with sourceLocale now 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 (prepareAppMenuSave label split and writeMenuTranslation), 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 the objectstack#36504 describes 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

…is stored as that language's translation

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

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/runtime, @objectstack/spec, touching 2 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/permissions/system-context.mdx (via handleI18nRequest (symbol, a top-level function))
What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 180 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 5c2e34cdb2b436f356ebba523e284e239f6ea351 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7742278970ec0164a60d3bd306e28ad1ac515b2b — the merge of head 2561fd5e28d735caf4367ec82a73cf68960c424c into base 5c2e34cdb2b436f356ebba523e284e239f6ea351, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 5c2e34cdb2b436f356ebba523e284e239f6ea351 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8

Contract-review-claim: session_01WGufzesUz1Y8VZuKJRhVL8 · head 2561fd5 · 2026-11-24T06:00Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 2561fd5e28d735caf4367ec82a73cf68960c424c
Local-runs: none
Scope: packages/spec/src/api/protocol.zod.ts + packages/runtime/src/domains/i18n.ts, packages/spec/authorable-surface/api.json, packages/spec/src/api/protocol.test.ts, packages/runtime/src/i18n-supported-locales.test.ts, packages/runtime/src/domains/i18n-anonymous-deny.test.ts, content/docs/references/api/protocol.mdx

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 f46ce5b4af), and the check-runs on this head (63 success, 11 skipped, none failing or pending). The console files (ui/packages/app-shell/**, ui/packages/i18n/**) are the lane seat's remainder at its own tier; they were read here only to judge the declared deviations and the consumer of the new member.

① Derived judgments

  • GetLocalesResponseSchema gains optional sourceLocale: z.string(): a widening, right. The body is a z.object (strips unknown keys), so the accept-set grows by one optional member and nothing that parsed before stops parsing. The input type GetLocalesResponse (re-exported by @objectstack/client, the return type of client.i18n.getLocales and of ObjectStackProtocol.getLocales) gains an optional member: no producer and no consumer breaks. Clause-②: yes (widening) is the right declaration.
  • packages/spec/authorable-surface/api.json gains api/GetLocalesResponse:sourceLocale and nothing else: right. One added row, matching the one added member; Metadata-protocol: added is the right kind.
  • Runtime accept-set: GET /i18n/locales body gains sourceLocale when the i18n provider reports a source or a default locale: right. The value is getSourceLocale?.() else getDefaultLocale?.(), which is the collapse II18nService.getSourceLocale assigns to the caller (contracts/i18n-service.ts: the provider reports only what was declared). The member is omitted, not emitted empty, when neither is known, which is what the schema's description says. No other producer of this body exists: toLocaleDescriptors has this one call site, and service-i18n's ledger row is disposition: 'sdk'. The discovery document's locale block is a different shape and is untouched.
  • No narrowing anywhere in the diff. The only removal is the UI string key designMode.menu.renameSourceOnly in the eleven @object-ui/i18n packs; its one reader (DesignModeMenu.tsx) is removed in the same diff, and designMode.recordTabs.renameSourceOnly (still read by RecordTabsConfig.tsx) is a different key and stays.
  • Console exports: fetchDefaultLocale and isSameLanguage keep their signatures (recordTabsConfigIo.tsx still imports both); rebaseMenuEdits gains an optional fourth parameter; the save input type gains optional labels. All additive.

② Semver level

  • Changeset .changeset/36504-menu-rename-translation.md: @objectstack/spec minor, @objectstack/runtime patch, @object-ui/app-shell patch, @object-ui/i18n patch. Every published package the diff touches is listed (content/docs/** is not a package). Spec minor is right for an added optional response member. The other three sit in the same fixed group as spec in .changeset/config.json, so they are released at the group's level whatever the line says; patch on them is not wrong.
  • Clause-②: yes (widening) — on the PR body and in the changeset body, and it matches the diff.
  • Metadata-protocol: added is on both as well. Check Changeset is green on this head.

③ Boundary flags

  • open_questions: empty. Nothing to answer.
  • Deviation: designModeMenuCreate.ts outside the claim's file list — accepted. One type line (AppMenuSaveInput & { item }) and the matching import. Without it the dashboard and report saves from the picker could not carry labels, and a label staged in a non-source language before 「New dashboard…」 would land in the stored label, which is the defect the card closes. It is the same save path the claim names, not a new surface.
  • Deviation: Done-when item 4 (object and field labels) — satisfied by its second arm; Fixes #36504 is right. The card's item reads "the same path serves object and field labels if the console later edits them, or a note says why not". The PR body gives the note, and it holds against the code: the console edits no object or field label in design mode, and those translations live under objects.… and are read by translateObject, not by the apps.APP.navigation.ID.label key translateApp reads (i18n-resolver.ts:2142). Items 1 to 3 and the thread's N5 (comment 7083013814) are each implemented and pinned. Part of would leave the card open with nothing left to build under it.
  • Deviation: two pushes while overlap-check exited 1 against fix(console): report editing is its own entry, mutually exclusive with design mode #36848 — noted. The overlap is textual, named in the PR body, and is the seat's to sequence; it changes nothing in this record's scope.
  • Skills-docs: follow-up #36873 — acceptable, and the right arm. The rule (pm-dispatch SKILL.md:321) allows skills/** edits only on domain:skills PRs and sends every other PR to follow-up #N; this is a domain:ui PR. skills: objectstack-i18n names GET /api/v1/i18n/locales but not the sourceLocale member PR #36858 adds to its answer #36873 is open and names the file and lines. No skill text is made false: skills/objectstack-i18n/SKILL.md:387 names the route without its answer, and :44 lists the tooling that reads the config key; neither says the server does not serve it. In content/docs the two hand-written route tables that list /i18n/locales are updated in this PR and references/api/protocol.mdx is regenerated; no page describes the old rename guard.
  • Security — the runtime change does not change who may read the endpoint. handleI18nRequest still refuses an anonymous caller in its first statement, ahead of the service probe and of the /locales arm; the new lines sit below that gate. The i18n-anonymous-deny.test.ts hunk changes one literal, the body a signed-in caller is served on the locale-list face (it gains sourceLocale: 'en'); no deny assertion is touched. The new member is a deployment config value served on the same floor as the locale list beside it. security_findings: none agrees with the diff.
  • SQL push-down: no finding. The diff adds no query, no id materialisation and no in-app join. The runtime reads two in-memory accessors; the console reads one translation item by name through /layers.
  • Out-of-scope items the report lists with carrier: none — escalated to the seat. (a) RecordTabsConfig's tab-rename gate still compares the session with the default locale, the same gap this card closes for menus, and sourceLocale is now there to close it; (b) a source-language rename over an inline locale-map label replaces the map with a string. Neither is introduced here and neither blocks this head, but each needs a card or a stated reason before ACCEPT (filing-gate).
  • Author: the PR's user.login is objectstack-fleet[bot]; no off-relay author to name.

④ Design judgment

  • packages/spec/src/api/protocol.zod.ts — holds. Against the card: Done-when item 1 asks that GET /i18n/locales expose the source locale. A top-level sourceLocale beside locales, not an isSource mark on a row, is the right place: the declared source locale need not be one of the supported locales the rows list, so a row mark could have nothing to mark. z.string() matches the sibling code. Optional is right: a provider that implements neither accessor leaves the server with nothing true to say. The name follows the config key i18n.sourceLocale. The jsdoc's claims were checked against the code it cites: the collapse it describes is the one II18nService documents, and the first consumer (fetchDeploymentLocales in designModeMenuSave.ts) reads the member and falls back to the default locale when an older server omits it, so the member is optional on both ends.
  • packages/runtime/src/domains/i18n.ts — agrees with the contract. It emits exactly what the schema describes. i18n-supported-locales.test.ts pins both arms through a real AppPlugin, memory i18n and the dispatcher, parsing the body with the schema itself; the dev's ablation of the spread turned that file red.
  • packages/spec/authorable-surface/api.json, content/docs/references/api/protocol.mdx — regenerated rows that match the member; the generated-artefact gates are green on this head.
  • First consumer, read not reviewed: the translation item the console writes (name, locale, apps.APP.navigation.ID.label) is a shape TranslationItemSchema accepts and the key translateApp reads, so the member has a consumer whose write resolves.

No must-fix, no should-fix.

Nits (no effect on correctness or the contract):

Implemented-by: claude/issue-36504-menu-rename-translation
Reviewed-by: session_01WGufzesUz1Y8VZuKJRhVL8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8

席位核对 — ACCEPT · repo:objectstack#3 · head 2561fd5 · 2026-11-24T06:05Z

L1 read of #36858 against card #36504. Head 2561fd5e28d735caf4367ec82a73cf68960c424c; dev report 7123427766. Contract-review claim 7123487532. CONTRACT_REVIEW_TIER L2 record 7123562177: PASS, clean round.

Face. l1-face.mjs --pr 36858: every item ok. All checks are now green at this head (Check Changeset was pending on the first read and has since passed); mergeable_state clean. check-governed-merges.mjs says NOT governed (0 of 28 paths; 995 changed lines). Clause-②: yes (widening), Metadata-protocol: added. Skills-docs: follow-up #36873: true. skills/objectstack-i18n/SKILL.md:387 names the endpoint, not its body, so no skill text is made false, and the two hand-written route tables in content/docs are updated here.

Read and sound.

  • Server: handleI18nRequest answers sourceLocale = declared i18n.sourceLocale, else the default locale, and leaves it out when neither is known. The anonymous deny is still the handler's first statement, so who may read the endpoint is unchanged. The spec member is optional on a stripping object, with one api.json row. The changeset levels are right: spec minor; runtime, app-shell and i18n patch.
  • Console: splitLabelEdits and labelGoesToTranslation send a label edit to the stored label only when the reader is in the source language and the entry is shown by its stored label. Every other edit becomes labels for APP_menu_LOCALE at apps.APP.navigation.ID.label, which is the key translateApp reads, and the entry keeps its served label. writeMenuTranslation reads the layered item and merges per id (a cleared name deletes it), then drafts with ifNoneMatch: '*', then publishes with the publish pin. A refused publish resets the draft, and a pending draft is said in the new translationPendingDraft text. When the locales read fails, labelLanguageOf sets source to false, so the failure falls on the safe side: a translation, never an overwrite of the base label.
  • Done-when items 1-3 are pinned (endpoint pin, zh-CN over English source with the English reader keeping the base label, guard relaxed). Item 4 is met by its "or a note says why not" arm, so Fixes is right.
  • designModeMenuCreate.ts changes by one type line (AppMenuSaveInput & { item }) so that picker-created items carry the label language. This is a mechanical adjacent change outside the claim list, declared in the report; accepted.

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 carrier: none items, which the L2 escalated:

Notes (nit, no action required):

  • N1. The changeset's declaration line still reads Skills-docs: follow-up owed — skills/objectstack-i18n/SKILL.md, while the PR body says follow-up #36873. The changeset text ships into the CHANGELOG, so #36873 would read better there.
  • N2. The Done-when item 4 note lives only in the PR body. One sentence in the designModeMenuSave.ts module doc would keep it next to the code.
  • N3. fetchDeploymentLocales caches a failed read (null) for the rest of the page load. That is safe, since every rename then goes to a translation, but a source-language rename made after a transient failure lands in that locale's translation rather than the base label. Retrying on the next save would avoid it.
  • N4. isSameLanguage matches a region-less tag to any region (zh = zh-TW). That is by design for en/en-US; recorded for a zh/zh-TW deployment.
  • N5. The textual overlap with fix(console): report editing is its own entry, mutually exclusive with design mode #36848 in DesignModeMenu.tsx and designModeMenuCreate.ts is known; whichever PR lands second rebases.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU

Landing · 2026-11-24T06:06Z · ACCEPT 7123581719 at head 2561fd5

reading value
check-governed-merges.mjs --pr 36858 NOT governed · +895/−100 (995 ≤ 3000)
landing-k.mjs --pr 36858 OK · K = 7 < 15 (main 76bff41) · no new locale pack under a label PR · no shared book moved under this PR's
contract review PASS 7123562177 at 2561fd5 (contract tier, clean round)
checks at 2561fd5 63 success, 11 expected skip, 0 failed or pending; mergeable clean

Open findings: nits only (L1 N1–N4). Two out-of-scope carrier: none items (RecordTabsConfig tab-rename gate still compares with the default locale; a source-language rename over an inline locale-map label replaces the map) go to the seat for cards. Skills-docs: follow-up #36873. Textual overlap with #36848 (DesignModeMenu.tsx, designModeMenuCreate.ts): the one that lands second rebases. State: ready + auto-merge (Tier S). On MERGED, #36504 closes by Fixes; area ux-A removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36504-menu-rename-translation branch November 24, 2026 06:43
os-support-ai pushed a commit that referenced this pull request Nov 24, 2026
…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
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… 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>
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 tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants