Skip to content

fix(app-shell): word the flow closure refusal on the Problems list in the Console's language - #30721

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-saey5n
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-saey5n

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #30038

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:流程绑定了本软件包不能用的对象时,Studio「问题」列表不再原样显示服务端的英文打包术语,而按服务端给的规则 id 与路径显示中文(或英文)说明:点名对象、说明软件包能用哪些对象、给出两种改法。
  • 为什么改:New automation: pressing Enter on a typed prefix saves that prefix as the trigger object, and the flow is refused later in English #30038 第 3 项,执行裁决 A(只改 ui,线上形状不动);第 1、2、4 项已随 PR fix(app-shell): New automation never saves a typed prefix as the trigger object #30148 落地。
  • 风险与回滚:只影响这两个规则 id 在三个位置的错误条目;其余条目原样显示。回滚即还原本 PR,无数据或协议影响。
  • 先看:previews/flow-closure-refusal.ts(新渲染模块),previews/flow-problems.ts(接入点一行),draftVerdict.ts(保留 code)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/previews/flow-problems.closureRefusal-30038.test.ts,预期 7/7 通过。
  • 需要你做的:无,席位落地。

What changes

  • New module ui/packages/app-shell/src/views/metadata-admin/previews/flow-closure-refusal.ts: closureRefusalMessage(entry, flow, locale) words the publish refusal from the served entry's code and item-relative path, and only at the ruling's three positions: flow-trigger-unknown-object at nodes.N.config.objectName and nodes.N.config.timeRelative.object, flow-input-unknown-object at variables.N.objectName. The object name is read from the flow on screen at that path. Any other code, any other position, or no name at the path answers undefined.
  • code threaded through the three ui-internal positions (ruling item 3):
    • previews/flow-problems.ts: ServerDiagnostic gains code?: string; buildFlowProblems uses the new module for an error-level server entry and falls back to the served message (ruling item 4).
    • draftVerdict.ts: verdictPreviewEntries (and verdictEntriesStillShown, which wraps it) keeps an error's code. Studio's Automations pillar reaches the Problems list through this function, and its existing { ...entry } spread carries the code on, so StudioDesignSurface.tsx is unchanged.
    • ResourceEditPage.tsx: previewDiagnostics keeps a served error's code on the entries it hands the canvas (it used to drop it).
  • Copy (ruling item 5): three keys engine.flowProblems.closureRefusal.{triggerObject,scanObject,inputObject} in ui/packages/i18n/src/namespaces/studio/en.ts and zh.ts. Those two are every catalogue the studio namespace has. The wording reuses the Console's existing package vocabulary (engine.inspector.objectPicker.outsideReason). The eager language packs ui/packages/i18n/src/locales/*.ts are not touched, so the first-screen English pack carries no new bytes. The studio en catalogue is its own chunk (i18n-ns-studio-en), and ui/scripts/check-eager-closure-budget.mjs does not budget it.
  • One changeset: @object-ui/app-shell + @object-ui/i18n patch.

The wire shape does not move: no packages/** file changes (ruling A).

Tests

  • New previews/flow-problems.closureRefusal-30038.test.ts (7 cases). zh-CN renders Chinese naming the object, at the trigger position. en renders the studio sentence, not the packaging one. The scan and input positions render too. An unknown code, or no code, passes through unchanged. A known code at a position it does not word, at a node with no name, or under the other rule id passes through. A warning under the same id passes through. verdictPreviewEntries keeps code end to end.
  • ResourceEditPage.draftPublishVerdict-26707.test.tsx gains a top-level describe that pins the canvas entry carrying the draft verdict's code. The file's harness already serves a coded refusal.

Acceptance notes

  • Ruling item 2, package id. Deviation, declared. The sentence says "this package" (本软件包) and does not print the package id. The Problems list is built in buildFlowProblems, a pure function whose host (FlowPreview, through MetadataPreviewProps) receives no package. Threading one in would widen past the claim's file surface (preview-registry.ts, FlowPreview.tsx, StudioDesignSurface.tsx), and the package is the one the Studio page is already showing. If the seat wants the id printed, that is a follow-up through MetadataPreviewProps.
  • "Did you mean" is not recomputed (ruling item 2's fallback). The Problems list has no object catalogue, so the sentence says to pick an object from the list or to declare a dependency on the package that defines it.
  • The object name is read from the flow on screen at the served path (ruling item 2), not from the judged body. If the author edits the value before the next verdict read, the sentence names the new value. That is the staleness every served entry already has until the next read.
  • Advisory warnings are not reworded. Both rule ids also raise a no-closure warning with other words. The draft's _diagnostics carries only the publish's refusals in errors[] (withPublishVerdict), so the module rewords error entries only.
  • Not reworded on purpose (outside the ruling's "Problems panel" reach): ResourceEditPage's diagnostics banner and the SchemaForm inline issues still show the served English for these entries.
  • MetadataPreviewProps.diagnostics (preview-registry.ts) does not declare code in its element type. The value passes structurally, and both new pins hold the runtime behaviour. The type line is outside the file surface.

Verification

All readings are on head 1f905121 unless noted.

Tests (lock VERDICT command-exit 0)

pnpm --dir ui exec vitest run --maxWorkers=2 over previews/flow-problems.closureRefusal-30038.test.ts, ResourceEditPage.draftPublishVerdict-26707.test.tsx, draftVerdict.test.ts, previews/flow-problems.test.ts and packages/i18n/src/__tests__/studio-namespace.test.ts: Test Files 5 passed (5), Tests 52 passed (52).

Ablation, three legs (scripts/ablation-replace.mjs, each restored: blob == HEAD, git diff HEAD empty)

The tests import src directly, so no dist/ is involved.

  • Leg A: in flow-problems.ts, closureRefusalMessage(diag, { nodes, variables }, locale) → (undefined as string | undefined). Result: Tests 4 failed | 3 passed (7). All four rendering cases went red. The three pass-through cases stayed green.
  • Leg B: in draftVerdict.ts, deleted the code spread. Result: Tests 1 failed | 6 passed (7), the end-to-end verdictPreviewEntries case.
  • Leg C: in ResourceEditPage.tsx, deleted the code spread. Result: Tests 1 failed | 3 passed (4), the new canvas-code case.
  • The first tries at legs A, B and C were refused before running, because the replacement text sat inside the anchor. They were re-run with a distinct replacement (A) and with --delete (B, C).
Type check

pnpm exec turbo run type-check --concurrency=2 --filter=./ui/packages/app-shell --filter=./ui/packages/i18n: Tasks: 68 successful, 68 total. Both packages ran tsc --noEmit && tsc -p tsconfig.test.json. Lock VERDICT command-exit 0.

Derived gates

node scripts/pm/dispatch-gates.mjs --commands (merge base 4bf9a2d7e, 9 paths, head 1f905121): 35 families, each run with its exit code captured before any pipe, all 35 exit 0. They include pnpm --dir ui exec vitest run scripts/ (lock VERDICT command-exit 0), check:type-check-debt (0 raw tsc errors over the ledger), check:type-check-coverage, check:nul-bytes, check:published-files, check:cross-package-test-inputs, check:test-source-alias, check-adr-0087-registration, check-empty-changeset and check-sdui-manifest. --ran reconciliation: "35 derived famil(ies) accounted for, 35 run, 0 NOT-MEASURED (a DERIVED zero, all 35 recorded an exit code and none of them is 3)". The tests, ablation and type check ran on ac42ace6. 1f905121 only adds the changeset, and every source blob is unchanged. CI check-runs were not awaited.

Lint (per file, CI owns the repo sweep)

npx eslint --no-inline-config over the 8 changed source files: 3 errors, all in ResourceEditPage.tsx at L3444/3577/3600 (react-hooks/static-components). The same file on origin/main, through --stdin, gives the same 3. None is in this diff's hunks.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (Not touched.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (Per-file reading above; the repo sweep is CI's.)
  • 4. One issue, one branch off an up-to-date main, one pull request. (Harness-pinned card-thread branch.)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (Except the 维护者速读 block, which is in Chinese by repo rule.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgU6Ui5Bf4TtimeCqH2


Generated by Claude Code

@github-actions github-actions Bot added size/m 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 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-sales · session_01L6bhgWn6zhNa4LL7VB1rtL

维护者速读

  • 改了什么:Studio 自动化的「问题」列表里,流程因为绑定了软件包依赖范围外的对象而被拒绝发布时,拒绝说明现在按控制台语言显示(中文或英文),用读者能照着做的话说明怎么改;其他条目照旧显示服务器原文。
  • 为什么改:New automation: pressing Enter on a typed prefix saves that prefix as the trigger object, and the flow is refused later in English #30038 第 3 项,裁决 A(6670300925,维护者 2026-11-05 同意):只改 ui,按服务器已经发来的规则 id(code)和条目路径出文案,线上格式不动。以前中文用户看到的是一句讲包闭包的英文。
  • 风险与回滚:只认两个规则 id 的三个位置(触发对象、定时扫描对象、启动输入的对象);对不上的条目一律原样显示服务器的句子。回滚即撤本 PR。
  • 先看:新文件 ui/packages/app-shell/src/views/metadata-admin/previews/flow-closure-refusal.ts,再看 flow-problems.ts 里用它的那一行。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/previews/flow-problems.closureRefusal-30038.test.ts,预期 7 例全绿。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。这是卡上剩下的唯一一项(第 1、2、4 项已随 PR fix(app-shell): New automation never saves a typed prefix as the trigger object #30148 落地),所以用 Fixes。

席位核对 — ACCEPT · head 1f90512

  • 形态:9 文件 +298/−8。check-governed-merges --pr 30721:0/9 条路径落在受管面,306 行 ≤ 3000。Fixes #30038,目标 main。全在认领 6671486399 的文件面内:metadata-admin/ 下三处加一个新模块、studio 命名空间的 en.ts 和 zh.ts、两份测试、一个 changeset。packages/**、ObjectPicker.tsx、首屏语言包 locales/*.ts、StudioDesignSurface.tsx 都没动。
  • 契约:Clause-② no,Metadata-protocol none,与认领一致,ACCEPT 时重读。ServerDiagnostic.code 是 app-shell 内部类型上的可选字段;新模块不进包入口。只读服务器已经在发的 code。
  • 席位自己核对的路径:lint 规则把路径写成 flows[N].nodes[M].config.objectName、…config.timeRelative.object、flows[N].variables[K].objectName(packages/lint/src/validate-flow-trigger-readiness.ts:607、:663、:1053)。服务器写进草稿 _diagnostics 时,itemRelativeIssuePath(packages/metadata-protocol/src/metadata-diagnostics.ts)把它改成相对条目的点分路径(nodes.M.config.objectName),并把 rule 放进 code。PR 的三个正则对的正是这种写法。同一个规则 id 在没有闭包时只是警告,不进 errors[];PR 只改写 error 级的条目,也有测试钉住。
  • 前提实测:dev 报告 6672111940。ServerDiagnostic 原来只有 path、message、severity,code 在 verdictPreviewEntries 和 ResourceEditPage 的 previewDiagnostics 两处被丢掉。新测试 7 例,覆盖:zh-CN 出中文并点出画面上的对象名;en 出 Studio 的英文句;另外两个位置;未知 code 原样透传;已知 code 但位置不对或路径上没有名字时透传;无闭包的警告不改写。测试共 52/52 绿。三处消融(文案调用、draftVerdict 的 code 透传、ResourceEditPage 的 code 透传)各自转红,已还原。type-check 68/68,派生门禁 35/35 exit 0,--ran 0 NOT-MEASURED。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped(ui-only diff 的预期跳过),0 红。
  • 接受的偏差:裁决第 2 项说包 id 取 Studio 当前的软件包。句子里没印包 id,写的是「本软件包」,因为 Problems 列表的构造函数和 FlowPreview 拿不到包;要传进去,得改 MetadataPreviewProps,而它是 app-shell 入口已发布的类型,只为一个名词就要扩一个已发布的契约。读者此刻就在这个包里编辑,「本软件包」指的就是 Studio 当前的包,句子照样能照着做,所以席位接受 dev 推荐的 A。「Did you mean」按裁决的退路不重算,改为提示「从列表选一个对象,或声明依赖」。
  • 范围外:dev 记下两条,都不立卡:(1) ResourceEditPage 的诊断横幅和表单内联提示对这两个规则 id 仍显示英文原句,裁决范围只到 Problems 列表;(2) MetadataPreviewProps.diagnostics 没有声明 code,结构上能传过去,两个新钉子都守住了这个行为。
  • 落地条款:中继 pr_ready + automerge_enable。合并即关卡(Fixes),席位同一笔摘掉 pm:dispatched;GitHub 没自动关卡,就由席位手动关。

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

New automation: pressing Enter on a typed prefix saves that prefix as the trigger object, and the flow is refused later in English

1 participant