Skip to content

fix(app-shell): Studio's New similar notices for a flow and a permission set read in the console's language - #29861

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-j5l6y7
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-j5l6y7

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread
Fixes #29727

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:Studio 里流程与权限集"新建类似"后的提示条,按服务端新给的 noticeCode 显示控制台自己的中英文句子(权限集三种落点各一句,带上应答里的软件包);权限矩阵编辑器里的克隆提示同样处理。
  • 为什么改:中文界面下这两处提示一直显示英文原句,中文用户做"新建类似"时第一眼就看到英文。
  • 风险与回滚:只改显示;不认识的码、没有码、或该带软件包却没带时,照旧原样显示服务端的英文 notice。回滚即撤销本 PR。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/permission-set-clone.ts(三种落点的映射与回退)、ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx(两条提示条把码带过页面跳转)、ui/packages/i18n/src/namespaces/studio/zh.ts(新增四句中文)。
  • 两分钟验证:在 ui/ 下运行 pnpm exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.accessNewSimilar-28573.test.tsx,预期全绿,其中 zh 用例逐一看到三种落点的中文句子。
  • 需要你做的:无,席位落地。

What changes

Leg 2 (ui) of #29727. Leg 1 (#29823) made both clone answers carry a stable noticeCode beside the English notice. The Console now maps each known code to its own studio-namespace sentence, in en and zh, and keeps the wire notice for anything else. It follows the existing code-to-key pattern (CloudConnectionPanel's translateFailureCode): one function per door with literal keys, no new mechanism, nothing imported from packages/runtime.

  • Flow (FlowItemMoreMenu.tsx): FlowCopied gains an optional noticeCode, read as sent. New flowCloneNoticeText maps FLOW_CLONE_DISABLED_COPY to engine.studio.auto.newSimilar.notice and returns notice for any other code or none.
  • Permission set (permission-set-clone.ts): PermissionSetCloned gains an optional noticeCode, read as sent. New permissionSetCloneNoticeText maps PERMISSION_SET_CLONE_ENVIRONMENT_WIDE, _IN_PACKAGE and _IN_CREATED_PACKAGE to perm.clone.notice.environmentWide, .inPackage and .inCreatedPackage. The two package landings name the answer's package. If that package is missing, the function returns the wire notice instead of making a sentence up.
  • Studio surface (StudioDesignSurface.tsx): the Automations and Access "New similar" strips keep noticeCode in their state and in the navigation arrival that carries a copy to its package's pillar. They render the mapped sentence.
  • Permission matrix (PermissionMatrixEditor.tsx): the cloned-notice line renders the mapped sentence. The diff there is that line and its import.
  • Studio packs (namespaces/studio/en.ts, zh.ts): four keys, added in both packs together. The en rows are the server's sentences, with {package} where the server names the package.
  • Changeset: @object-ui/app-shell and @object-ui/i18n, patch.

Tests

New top-level describes in the existing harness files, each over the real component:

  • AutomationsPillar.newSimilar-28567.test.tsx: in zh, FLOW_CLONE_DISABLED_COPY shows the zh sentence on the copy's pillar, after the navigation to the pair. CONTROL: an unknown code shows the wire notice, and so does a missing code.
  • StudioDesignSurface.accessNewSimilar-28573.test.tsx: in zh, each of the three landings shows its zh sentence, and the two package landings name the answer's package. CONTROL: an unknown code shows the wire notice, and so does a missing code.
  • PermissionMatrixEditor.cloneToCustomize.test.tsx: in zh-CN, an embedded host's clone notice shows the zh sentence with the package. CONTROL: an unknown code shows the wire notice.
  • The existing en cases send no code, so they keep pinning the wire notice verbatim. They pass unchanged.

Acceptance notes

  • "The package label" in the order is read as the package the server's sentence names, which is the answer's data.package (an id, as the strip's existing "Saved the copy NAME in package PACKAGE" line also shows).
  • zh wording follows the vocabulary that has landed: 已停用 / 启用 for a flow's off/on state, 动作 for actions, 岗位 for positions.
  • Screenshots, zh-CN, before (main's sources) and after, on a live pnpm dev showcase backend with the Console under Vite. They show "New similar" on the read-only com.example.showcase package's flow and permission set, both landing in a newly created com.example.showcase.custom. The four PNGs are in the project folder under issue-29727/. In the before shots the second line is the server's English. In the after shots it is the zh sentence.

Verification

Readings at 40f355ea/d2be8c2f (the code and changeset). After merging origin/main at 99c06965, the post-merge reruns are at head b4ee61da. Delta vs main: exactly the 10 files above.

Premise on main: the five known-code zh pins red, the English sentence on screen

The new tests, with the six implementation files restored to 42ff86f6: Test Files 3 failed (3), Tests 5 failed | 48 passed (53). The five failures are the five known-code zh pins. The flow pin's failure prints the banner text as received, which is the English sentence: "The copy is switched off and does not run until you switch it on, and it still uses the same subflows, actions and objects as the original." The CONTROL pins pass on main, as they should.

Fixed head: 53/53, then 69/69 after merging main
  • The three suites: Test Files 3 passed (3), Tests 53 passed (53).
  • Post-merge at b4ee61da, the three suites plus the two matrix suites main touched (columnHeaders-29729, badge): Test Files 5 passed (5), Tests 69 passed (69).
  • turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 66/66 tasks, before and after the merge.
  • pnpm exec eslint on the nine touched source and test files: 0 errors.
Ablation: four mutations through scripts/ablation-replace.mjs, each landed on disk, each red, each restored (blob hash equal to HEAD)

The ui vitest config aliases @object-ui/i18n and app-shell to src, so no dist step is involved.

  • A1: drop the flow mapping. 1 failed / 52: the zh known-code pin.
  • A2: map every flow code. 2 failed / 51: both flow CONTROL pins.
  • A3: map every permission-set code (the default branch). 15 failed / 38: every CONTROL and every en wire-notice pin across the Access and matrix suites.
  • A4: no permission-set code matches. 4 failed / 49: the three landing pins and the matrix pin.
Gates
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 35 families. Each was run with its exit code captured before any pipe, all exit 0, including check-sdui-manifest and its self-test and pnpm --dir ui exec vitest run scripts/ (Test Files 170 passed | 2 skipped (172)). --ran: 35 accounted, 35 run, 0 NOT-MEASURED.
  • ui/scripts/check-i18n-en-drift.mjs: exit 0 (0 en values changed, 4 designer keys added).
  • Re-run at b4ee61da: check-sdui-manifest, check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check:nul-bytes and check-i18n-en-drift all exit 0.
  • No new data-source write site, so the write census needs no entry.

Generated by Claude Code

The flow and permission-set clone answers name their notice by a code;
these pins ask a zh screen to show the sentence in zh, and the wire notice
for an unknown or missing code.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRCNECdyCZ6R9rvtF7
The flow and permission-set clone answers carry a noticeCode beside the
English notice. Studio's Automations and Access strips and the permission
matrix's clone notice map each known code to an en/zh studio key, naming
the answer's package where the sentence does, and show the wire notice
for an unknown or missing code.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRCNECdyCZ6R9rvtF7
@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 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

席位核对 — ACCEPT · domain:ui#5 · head b4ee61da · 2026-11-03T08:37Z

  • 形态: draft PR on main. The body has Fixes #29727 and no other card number next to a closing keyword; this is leg 2, and leg 1 (server) landed as PR feat(runtime): flow and permission-set clone answers name their notice by a stable noticeCode #29823 with Refs, so the merge closes the card. 10 files, +314/−33 (non-test 7 files, +195/−26), Tier S: check-governed-merges --pr 29861 finds no governed path and 347 lines. The body carries 维护者速读 and both declaration lines (Clause-②: no, Metadata-protocol: none), which match the claim amendment (the seat's measured ruling) and the changeset .changeset/29727-clone-notice-translated.md. The files are exactly the amended claim surface, including the one approved import line in PermissionMatrixEditor.tsx.
  • 前提实测: with the six implementation files at 42ff86f6, the five known-code zh pins go red and the flow banner's received text is the server's English sentence. Live zh-CN before and after screenshots on a showcase backend (the read-only com.example.showcase flow and permission set, both landing in a new .custom) are in issue-29727/.
  • diff read:
    • flowCloneNoticeText maps FLOW_CLONE_DISABLED_COPY to engine.studio.auto.newSimilar.notice; any other code or none returns the wire notice.
    • permissionSetCloneNoticeText maps the three PERMISSION_SET_CLONE_* codes. The two package landings interpolate the answer's package, and fall back to the wire notice when the answer names none, so no sentence is made up. A noName or noPackage Access strip passes package: null, which falls back the same way.
    • Both readers copy noticeCode only when it is a non-empty string. The Automations and Access strips carry it through their navigation arrival, so the translated sentence survives the move to the copy's pillar.
    • The en rows equal the server's sentences byte for byte (FLOW_CLONE_NOTICE in flow-clone.ts, permissionSetCloneNotice in permission-set-clone.ts at origin/main), with {package} where the server names the package. zh uses the landed vocabulary (已停用 / 启用, 动作, 岗位). en and zh are added together, so the en-drift gate holds.
    • Nothing is imported from packages/runtime; neither changed type is on app-shell's exports.
  • 门禁 check-runs (pinned to head b4ee61da2cb65c23eda4d34d48b977c6902c0d9a): 44 success, 11 skipped, 0 failed, 0 pending (latest run per check); check-expected-skips --pr 29861 exit 0 (11 skipped runs, each in main's roster); mergeable_state clean. Dev local: 35/35 derived gates exit 0 with --ran 0 NOT-MEASURED (check-sdui-manifest and ui scripts 170/170 included), en-drift exit 0, app-shell and i18n type-check 66/66, eslint 0 errors. Tests 53/53 on the fix, 69/69 after the main merge (with the two matrix suites main touched). Four ablations red as expected (A1 1/52, A2 2/51, A3 15/38, A4 4/49) and restored.
  • Contract review: none owed. Clause-②: no, no spec, governed, published-export or narrowing face, so CI and the seat's read decide (as on Studio: zh-CN first screens stop mixing English: the clone notice, the new package form, the flow rail group #29706's PR fix(app-shell): zh-CN Studio first screens stop mixing English in the package form, flow rail groups and column picker #29773).
  • 接受的偏差: the approved import line in PermissionMatrixEditor.tsx. "The package label" in the brief is read as the answer's package id, which is what the server's sentence and the strip's existing "Saved the copy … in package …" line both show.
  • 范围外去向: none. Skills-docs: not owed (Clause-②: no, Metadata-protocol: none).
  • 席位意见: the 维护者速读 six lines match the diff the seat read; 需要你做的 = 无 holds (Tier S, no review owed).
  • 落地条款: Tier S, not Tier H. Land by pr_ready + automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 3, 2026 08:38
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 3, 2026 08:38
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit aeeb13f Nov 3, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-j5l6y7 branch November 3, 2026 09:04
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.

runtime: the flow and permission-set "New similar" clone notices carry a code, so the Console can translate them (zh-CN shows English today)

1 participant