Skip to content

fix(console): the approvals inbox names the flow, the step and the object in the reader's language - #27040

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-0glj6o
Oct 28, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-0glj6o

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread
Fixes #26883

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:审批收件箱的所有审批接口调用改走控制台的认证 fetch(和申请详情页同一条通道),请求带上用户选择的界面语言;对象筛选下拉显示对象标签而不是机器名。
  • 为什么改:服务端审批接口早已按 Accept-Language 从应用语言包翻译流程/步骤/对象标签,但收件箱用裸 fetch,只带浏览器语言,所以中文用户在收件箱看到英文。
  • 风险与回滚:低;只换了传输层(额外带上 X-Tenant-ID 与界面语言头,和详情页一致),回滚即还原 approvalsApi.ts 的 call。
  • 先看:ui/apps/console/src/services/approvalsApi.ts 的 call;ApprovalsInboxPage.tsx 的 objectOptions;新测试 ApprovalsInboxPage.readerLocaleLabels-26883.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run apps/console/src/pages/system/ApprovalsInboxPage.readerLocaleLabels-26883.test.tsx,预期 6 个全过。
  • 需要你做的:无,席位落地;Setup › 审批申请 列表那一半走服务端,另立卡(见 Acceptance notes)。

What changes

  • approvalsApi.call (every inbox read and decision) now goes through createAuthenticatedFetch() from @object-ui/auth, the transport approvalRequestsDataSource.ts (the request page) already uses. It stamps the Bearer (as before), X-Tenant-ID, and the active UI language as Accept-Language. The hand-built Bearer header is gone because the wrapper sets it.
  • The approvals door already serves process_label, step_label and object_label in the request's Accept-Language from the app's pack (flows.FLOW.label, flows.FLOW.approvals.NODE.label, objects.OBJECT.label; reader-locale-labels.ts in @objectstack/plugin-approvals, shipped in 18.1.0), keeping the stored label when the pack has no entry. So the row, the process filter and the object column now show the pack's text with no client-side resolver.
  • Bounded in-place fix, same defect class and same file: the inbox's object filter listed machine names (opportunity); it now lists each object by the label the row serves, and the search haystack includes object_label.
  • Changeset: @object-ui/console patch.

Why

The card's mechanism assumption (the inbox shows the stored English with no lookup, fix by a client lookup) is disproved on origin/main 5e99bd93: the server translates per reader, and the inbox simply never told it the reader's language. A bare fetch sends only the browser's language, so a zh-CN user on an en-US browser got English. Same root cause and same fix shape as the /forms/:name select-option fix (.changeset/26452-form-options-locale.md). No second resolver, nothing stored changes, no server change.

Tests

New ui/apps/console/src/pages/system/ApprovalsInboxPage.readerLocaleLabels-26883.test.tsx: the real I18nProvider writes the html element's lang attribute, the real createAuthenticatedFetch reads it, and a global fetch stand-in for the door answers in the language it is asked for.

  • the inbox asks the door with Accept-Language: zh under a zh UI;
  • the queue row shows 大额商机审批 / 销售经理审核 / 商机, not the English;
  • a flow the pack does not cover keeps its stored labels;
  • the process and object filters list the shown labels;
  • search matches the shown text and the machine name;
  • control: an English UI reads the stored English.

Acceptance notes

Verification

Ablation

Commit 120f45fd. node scripts/ablation-replace.mjs replaced const res = await createAuthenticatedFetch()( with const res = await fetch( in approvalsApi.ts (anchor 1 to 0, blob 5ada17474e93 to 473dc3b025d1), ran the new file: 5 failed, 1 passed (the untranslated-flow fallback, which is expected to hold either way). Restored: blob equals HEAD, git diff HEAD empty.

Local gates

Head 2c07fcd0 (after merging origin/main 7eb613c3). node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 33 families; all 33 ran, every one exit 0; --ran reconciliation: 33 derived, 33 run, 0 NOT-MEASURED.

Package checks on the same head: pnpm --dir ui exec vitest run apps/console/src/pages/system/ApprovalsInbox apps/console/src/services/approval apps/console/src/__tests__/approvalsInboxComponentRef.test.tsx: Test Files 29 passed, Tests 204 passed. pnpm --filter @object-ui/console type-check: exit 0.

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (CI-owned).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec not touched.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code


Generated by Claude Code

@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 Oct 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#5 · session_01JQwxbXGpVJHZTXXerMoY4C · head 2c07fcd0 · 2026-10-28T02:54Z

席位意见:审批收件箱改走控制台的认证 fetch(与申请详情页同一通道),带上用户选择的语言,服务端审批接口本来就按语言给出流程、步骤、对象的译名;对象筛选也显示译名。Setup › 审批申请列表读的是通用数据接口,属服务端,另立卡 #27041。

  1. Shape: Fixes #26883 (amended by the seat from Part of, the Setup half now Setup › Approval Requests list shows the stored flow and step labels under zh-CN: the data-door read of sys_approval_request skips the reader-locale labels the approvals door applies #27041); 4 files, +281/−10: ui/apps/console/src/services/approvalsApi.ts (call goes through createAuthenticatedFetch()), ApprovalsInboxPage.tsx (object filter {value,label}, search matches object_label), one new test file (244 lines), and a patch changeset for @object-ui/console.
  2. Premise measured: the order's mechanism assumption (the inbox reads stored labels and needs a client translator) was wrong, and the dev measured why: the approvals door already localizes process_label / step_label / object_label by Accept-Language (plugin-approvals reader-locale-labels.ts), and the inbox's bare fetch carried only the browser's language. The seat read createAuthenticatedFetch: it keeps the Bearer (API paths), adds X-Tenant-ID and the UI language, and merges the caller's headers, so no header the inbox sent is lost. No second translator. Dev: 6 new tests; back to bare fetch turns 5 red.
  3. Gates / check-runs: PR check-runs on 2c07fcd0: 45 success, 12 skipped, 0 failure; Lint & Repo Gates, TypeScript Type Check and Check Changeset success. Dev's local run: 33 derived, 33 run, --ran reconciled; 29 files / 204 approvals tests and console type-check green.
  4. Accepted deviations: the order's translator shape replaced by the transport fix (measured, smaller); the PR body's line 3 and one Acceptance-notes sentence edited by the seat through the relay (os-dev writes its body once); a merge of origin/main with a disjoint hunk in approvalsApi.ts.
  5. Out of scope: Setup › Approval Requests (sys_approval_request list) reads the generic data door with stored labels: filed Setup › Approval Requests list shows the stored flow and step labels under zh-CN: the data-door read of sys_approval_request skips the reader-locale labels the approvals door applies #27041 (domain:server, plugin-approvals). Skills-docs: none — console transport only.
  6. Landing: not Tier H (no governed path, +291 lines); ready for landing (ready + auto-merge).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 28, 2026 02:55
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 28, 2026 02:55
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit cbb3a1a Oct 28, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-0glj6o branch October 28, 2026 04:39
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.

Approvals inbox and Approval Requests list show the flow and step labels in English under zh-CN, although the app's pack translates them

2 participants