Skip to content

fix(app-shell): record-tabs rename gate reads the served sourceLocale - #37381

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36875-record-tabs-source-locale
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-36875-record-tabs-source-locale

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #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 #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 #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

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).

Local readings at e2288d2
  • 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

Generated by Claude Code

The design-mode record-tabs rename decided "source language" by comparing
the reader's language with the deployment's default locale. It now takes
the source-locale reader the menu rename uses (fetchDeploymentLocales +
labelLanguageOf), which falls back to the default locale when the server
serves no sourceLocale.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: e2288d21e3a7851232dede102d65e96243762f29
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 3 files (+234/−7), Fixes #36875. Merging delivers the card as cut in item 4. l1-face CLEAN.
  2. Premise and change: recordTabsConfigIo.tsx now asks labelLanguageOf(language, fetchDeploymentLocales()).source. That is the feat(i18n): a design-mode menu rename outside the source language is stored as that language's translation #36858 reader and the exact gate the menu rename uses. The fallback to the default locale is the reader's own.
    • While the locales are unread (null), source is false, so the rename stays closed during the load, as !!defaultLocale kept it before.
    • No second fetch: the reader is cached per page load.
    • The reverse check reds cases 1 and 2 on main's file, and case 3 (no sourceLocale served) stays green.
  3. Gates: check-runs at e2288d21e3: 38 success, 13 expected skip, 0 failed, 0 pending. Mergeable clean. No changeset is owed; ui/** is unpublished.
  4. Acceptance cut, judged by the seat: card item 2 ("stores a tab rename as a translation") rests on a premise that is false on main. Outside the source language the record-tabs editor writes no translation: its rename is disabled with "Tab names are changed in the app's source language" (RecordTabsConfig.tsx:475), by design per the 记录「…」里加「配置页签」:管理员原地调整记录页页签的顺序、显示隐藏和标题,取消或保存;自建应用写对象,安装来的应用写 .custom #36499 ruling (4) precedent. The test proves the side the card's defect is about, so the item is cut with that reason:
    • a default-locale reader who is not in the source language cannot write the source label;
    • a source-language reader can.
      A translation write path for record tabs would be a new capability. It is not this card and needs no decision here.
  5. Out of scope and where it went: two p3 loose ends are noted, not filed: fetchDefaultLocale in designModeMenuSave.ts has no caller now, and a stale "default language" comment sits at RecordTabsConfig.tsx ~L95. The area may fold them into its next card on that file.
  6. Landing terms: ungoverned, default tier, Clause-②: no. L1 only. The area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Probe Reading
check-governed-merges --pr 37381 NOT governed (0 of 3 paths), ≤ 3000 lines
K at a9ada762e0 landing-k can't answer: no Test Core runs for a ui/**-only diff. Merge-base count after the relay pr_update_branch (base merge only, the PR's own files unchanged) is K = 2
pr-state --pr 37381 at a9ada762e0 38 success · 13 expected skip · 0 failed · 0 pending, mergeable clean

Landing on seat ACCEPT 7179276413 (at e2288d21e3; the new head adds only the base merge). The maintainer named it in the seat thread (「合并 #37354 #37377 #37373 #37381」, 2026-11-26T02:14Z): ready + auto-merge. Closes #36875 on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 02:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 8061d83 Nov 26, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36875-record-tabs-source-locale branch November 26, 2026 03:02
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/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

记录页签改名:判断“是否源语言”仍拿默认语言比,应改用服务端下发的源语言(sourceLocale)

2 participants