Skip to content

fix(app-shell): after a datasource sync, link each new object and name the steps left; the form labels a label-less field like the list - #30493

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-53q18n
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-53q18n

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:ui#5 · os-sales · session_01L6bhgVaDMZ9FxV4kMaNFGU

Requested by Sales · project thread

Part of #30328

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:设置 → 数据源「同步对象」成功后,对话框不再关掉只弹一句「已同步 1 个对象」,而是停在结果页:列出新建的对象并给出可点开的链接,说明还剩两步(加入某个应用、在权限集中授予访问)。另外,没有 label 的字段在新建/编辑表单里改用和列表相同的可读名(part_no → Part no),不再直接显示字段名。
  • 为什么改:同步完的对象不在任何应用里、普通成员没有权限,管理员只能手敲地址才能找到它,也不知道还差什么;同一个字段列表叫 Part name、表单叫 part_name。
  • 风险与回滚:只改前端:数据源页面、表单的 label 回退规则、studio 词条新增 4 行(en/zh)。写了 label 的字段不受影响;同步一个也没建成时行为和原来一样。回滚即还原本 PR,无数据迁移。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/datasource/DatasourceResourcePage.tsx(SyncResultNote、runSync 结尾)、ui/packages/plugin-form/src/sectionFields.ts 的 fieldNameLabel、ui/packages/i18n/src/namespaces/studio/zh.ts 的 engine.datasource.syncNextStep*。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/datasource/DatasourceResourcePage.syncNextSteps-30328.test.tsx packages/plugin-form/src/ObjectForm.fieldNameLabel-30328.test.tsx,预期 7 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

Card #30328, the domain:ui half only. The server half (the object draft's field labels, and which package a synced object lives in and whether it exports under ADR-0146) is #30469, so this PR does not close the card.

  • The sync result. When a Sync run creates at least one object, the dialog stays open on the result instead of closing behind a success toast (SyncResultNote): the count line, one link per created object (label, with the name beside it when they differ), and a box naming the two steps left before people can use it: add it to an app, and grant access in a permission set. The link opens the object under the app the page is in (/apps/SEGMENT/OBJECT, read from the current path; Setup when the path names no app). It is a router Link, so the console navigates in place. SyncResultNote is the only part of the page that reads the router, and it mounts only after a sync, so the page's other test files, which render without a router, are unchanged. A run that creates nothing closes the dialog as before; refused tables still go to the error toast either way. The dialog's footer offers Close on the result.
  • Form labels (item ②). A declared field with no label was drawn in the form under its raw name (ObjectForm generated fields and fromObjectSchema both used field.label || fieldName), while the list draws it under the name with the first letter capitalised and underscores as spaces (objectGridGenerateColumns in plugin-grid, the same expression in four places there). fieldNameLabel() in sectionFields.ts is that rule, and both form paths now use it as the fallback passed to fieldLabel(), so a translation still wins and an authored label is unchanged. FieldSchema.label is optional in the spec, so this is the renderer's rule for valid metadata, not a tolerance for invalid metadata. plugin-grid is unchanged and no @object-ui/core export is added (claim amendment 6658567034).
  • i18n (the widening). Four new studio namespace rows, en and zh: engine.datasource.syncNextStepsOne, engine.datasource.syncNextSteps, engine.datasource.syncNextStepApp, engine.datasource.syncNextStepAccess. The count line reuses engine.datasource.syncedOne / synced and the button reuses engine.close.
  • Changeset. .changeset/30328-datasource-sync-next-steps.md, @object-ui/app-shell, @object-ui/i18n and @object-ui/plugin-form patch.

Branch: the harness-assigned claude/project-thread-53q18n, not claude/issue-30328-*; the card is #30328.

Tests

  • DatasourceResourcePage.syncNextSteps-30328.test.tsx (new, 4 cases), under a MemoryRouter at /apps/setup/metadata/datasource; expectations are read from Studio's table, never retyped:
    • one object: the dialog stays on the result, the link reads Spare Parts (spare_parts) with href /apps/setup/spare_parts, both steps are listed, no success toast, and clicking the link moves the router there;
    • two created and one refused: both created objects are linked, the refusal reaches the error toast once, and the footer Close closes the dialog;
    • none created: the dialog closes, nothing is saved, the refusal is toasted;
    • zh: the result and both steps read in Chinese (guarded as real Han rows).
  • ObjectForm.fieldNameLabel-30328.test.tsx (new, 3 cases): the rule (part_no → Part no); the generated form draws Part no / Unit price and never the raw names; fromObjectSchema draws Part no; CONTROL: an authored label (Supplier) stays in both paths.

Acceptance notes

Verification

Gates and tests ran on e93daf70 (the gate runner started on 8787d0b7; e93daf70, which only types the new plugin-form test's data source, landed while its first five families, the changeset and ADR-0087 checks, were running); the head adds an evidence commit and its removal, the tree is byte-identical (git diff e93daf70 HEAD is empty). Base f273c9fe.

Live rig and screenshots (zh-CN, 1440 wide)

examples/app-showcase objectstack dev --seed-admin --fresh on a private port, the console via vite in ui/apps/console with DEV_PROXY_TARGET, Chromium, browser locale zh-CN. An external SQLite file with table spare_parts (id, part_no, part_name, unit_price, in_stock, 3 rows), registered as POST /api/v1/datasources parts_db (label 零件库, schemaMode: external), then synced through the dialog.

Item ② measured on the base: GET /api/v1/meta/object/spare_parts served the business fields with no label ({"part_no":{"type":"text"},"part_name":{"type":"text"},...}); the list headers read Part name, Part no, Unit price, In stock; the new-record form labels read part_no, part_name, unit_price, in_stock. After: the form reads Part no, Part name, Unit price, In stock.

Before (page restored to the base for the shot): the dialog closes and the toast reads 「已从 parts_db 同步 1 个对象。」.

before sync
before form

After: the dialog shows 「已从 parts_db 同步 1 个对象。」, the link Spare Parts (spare_parts) (href /apps/com.objectstack.setup/spare_parts), and 「还剩两步,其他人才能使用它:」 with both steps. Clicking the link opened the object's list (3 records).

after sync
after link opens the object
after form

Tests, ablation, typecheck, lint
  • pnpm --dir ui exec vitest run packages/plugin-form/src/ObjectForm.fieldNameLabel-30328.test.tsx packages/plugin-form/src/sectionFields.test.ts packages/app-shell/src/views/metadata-admin/datasource/ packages/i18n/src/__tests__/studio-namespace.test.ts on e93daf70: Test Files 11 passed (11), Tests 104 passed (104), lock VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run packages/plugin-form/ on 8787d0b7 (the only later change types the new test's data source): Test Files 223 passed (223), Tests 2452 passed, 1 skipped, lock VERDICT command-exit 0.
  • Ablation 1 (scripts/ablation-replace.mjs, anchor x1 to x0): setSyncResult never called: 3 failed / 1 passed (the none-created case still passes, as it should). Restored, blob equals HEAD, git diff HEAD empty.
  • Ablation 2: fieldNameLabel returns the raw name: 3 failed / 3. Restored, blob equals HEAD.
  • pnpm --filter @object-ui/app-shell run type-check, pnpm --filter @object-ui/plugin-form run type-check, pnpm --filter @object-ui/i18n run type-check (each tsc --noEmit and tsc -p tsconfig.test.json): exit 0.
  • pnpm --dir ui run check:spec-symbols, check:i18n-keys, check:i18n-drift, check:unreferenced-sources, check:esm-specifiers, check:new-line-citations (0 new citations): exit 0.
  • eslint on the five changed source and test files: 0 errors; the warnings are on lines this PR does not change.
Derived gates (35/35 exit 0)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 35 families; every one ran and exited 0. --ran reconciliation: 35 derived, 35 run, 0 NOT-MEASURED (a derived zero, every line carries an exit code). pnpm --dir ui exec vitest run scripts/: 170 files passed, 2 skipped; 4985 tests passed, 2 skipped. CI runs the rest.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVaDMZ9FxV4kMaNFGU

…names the steps left

After Sync creates objects, the dialog stays open on the result: a link to
each created object, opened under the app the page is in, and the two steps
left before people can use it (add it to an app, grant access in a
permission set). A run that creates nothing closes the dialog as before.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVaDMZ9FxV4kMaNFGU
…as in the list

A declared field with no label is drawn under its name with the first letter
capitalised and underscores as spaces, the rule the list header uses, instead
of the raw field name.

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

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif

Contract review

Served-tier: TIER_DEFAULT
Head-sha: e911351eea1d70fcb40c55c32e53b0eced0896de
Local-runs: none

Reviewed 2026-11-05T13:45Z. Face: the Clause-②: yes (widening) declaration alone (PR body and changeset). The committed tree touches no packages/spec/src/**, no governed path, and narrows nothing. This head differs from 6ed40a9b only in comment placement (2 files, +13 −14; the moved fieldNameLabel body is byte-identical).

① Derived judgments

  • @object-ui/i18n gains four studio namespace keys, each in both files that namespace has (en.ts, zh.ts): engine.datasource.syncNextStepsOne, syncNextSteps, syncNextStepApp, syncNextStepAccess. None takes a placeholder. No key is renamed or removed and no existing value changes, so the published key set only grows. The dispatch order said 10 locales, but the studio namespace is en + zh only by its index.ts header; the PR follows the namespace. ✔
  • fieldNameLabel is exported from ui/packages/plugin-form/src/sectionFields.ts but not from the package entry. src/index.tsx re-exports only sectionEntryName from that module, and the package's one exports entry is .. So it is not published. ✔
  • Form label fallback. A declared field with no label now renders under the list's sentence-case rule (part_no → Part no) on both form paths (SimpleObjectForm's generated fields and fromObjectSchema). An authored label still wins, and the value still passes through the host's fieldLabel translator first. This is a display change, not an accept-set change. ✔
  • DatasourceResourcePage keeps the Sync dialog open on its result when at least one object was created; a run that created nothing closes it as before. No exported signature changes. ✔

② Semver level

  • .changeset/30328-datasource-sync-next-steps.md: @object-ui/app-shell, @object-ui/i18n and @object-ui/plugin-form patch, declared Clause-②: yes (widening) / Metadata-protocol: none. Additive keys at patch match the lane's precedent (.changeset/30335-datasource-delete-names-bound-objects.md). ✔

③ Boundary flags

  • The dev raised the 10-locale instruction against the studio namespace's en + zh rule; answered above.
  • Author check: the PR's user.login is objectstack-fleet[bot] (relay pr_create).

Implemented-by: session_01L6bhgVaDMZ9FxV4kMaNFGU
Reviewed-by: session_01L6bhgVwQZbHRRM9CaXeKif

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · os-sales · session_01L6bhgVwQZbHRRM9CaXeKif

维护者速读

  • 改了什么: 设置 → 数据源「同步对象」成功后,对话框停在结果页:列出新建的对象和可点开的链接,并说明还剩两步(加入某个应用、在权限集中授予访问)。之前对话框直接关掉,只弹一句「已同步 1 个对象」。另外,没写 label 的字段在新建和编辑表单里改用和列表相同的可读名(part_no → Part no)。
  • 为什么改: After syncing a table from a datasource, nothing tells the administrator what to do next, and form labels are raw column names #30328 的 ui 一半。同步出来的对象不在任何应用里,普通成员也没有权限,管理员只能手敲地址去找,也不知道还差什么;同一个字段在列表里叫 Part name,在表单里叫 part_name。
  • 风险与回滚: 只改前端:数据源页面、表单 label 的回退规则、studio 新增 4 个词条(en/zh)。写了 label 的字段不受影响;一个对象都没建成的同步,行为和原来一样。回滚就是撤销本 PR,没有数据迁移。
  • 需要您做的: 无。本 PR 不在受管面,共 435 行。席位会经合并队列落地。
  • 席位意见: ACCEPT。

席位核对 — ACCEPT · domain:ui#5 · head e911351eea1d70fcb40c55c32e53b0eced0896de

  • 形态: draft,作者 objectstack-fleet[bot](中继 pr_create),目标 main,Part of #30328(只做 ui 一半)。共 8 个文件,+411 −24。check-governed-merges --pr 30493:NOT governed;435 行,未超 3000。mergeable_state 读为 clean。
  • 契约面: 不碰 packages/spec/**,不碰 governed 路径。Clause-②: yes (widening):只来自 4 个新的 studio 键。fieldNameLabel 没有从包入口导出,不算发布面。TIER_DEFAULT 合同复核 PASS 6659590179,复核的就是这个 head。Metadata-protocol: none 与 diff 一致。
  • 抽查:
    • fieldNameLabel 和列表 objectGridGenerateColumns 的规则一致(首字母大写、下划线换成空格)。它只作为传给 fieldLabel() 的回退值,所以翻译仍优先,作者写的 label 不变。两条表单路径(生成字段和 fromObjectSchema)都改了。
    • SyncResultNote 只在同步之后挂载,是页面上唯一读路由的部分,所以页面的其它测试文件不需要 router。链接用路由 Link,指向当前路径里的应用段,没有应用段时落到 Setup。
    • 一个都没建成时对话框照旧关闭;被拒的表无论哪种情况都只报一次错误提示。
  • 门禁 check-runs: e911351e 上 55 个 run:44 success,11 skipped,0 失败。
  • 测试: 新增两个测试文件共 7 个用例。期望值从 Studio 词表读取,不在测试里重打;含 zh 用例和“作者写了 label”的对照。补丁轮只移动了两处文档注释的位置,fieldNameLabel 函数体逐字节不变。卡线程报告:派生门禁全绿,dev 启动实测(外部 SQLite 表同步)的前后截图在 PR 正文里。
  • 接受的偏差:
    • 派发令写的是 10 种语言,但 studio 命名空间按其头部裁定只有 en 和 zh,其它语言回退到 en。PR 跟随命名空间的规则,4 个键只加 en/zh。
    • 步骤文案说“授权之前只有管理员能读到记录”,依据是卡片作者的实测(普通成员 403),本 PR 没有以成员身份重测。
  • 范围外去向: 服务端一半(对象草稿的字段 label、同步对象所在的包以及 ADR-0146 下能否导出)在 Datasource table sync: the generated object draft gives its fields no label, so forms show raw column names; where the synced object lives (package, export) is unstated #30469。实测看到的「您没有创建Spare Parts的权限」提示归入 A read-only external object offers New and Import, then refuses with a permission message that blames the wrong thing #30334 item 1。
  • 落地条款: Part of #30328,不关卡。本席位按普通队列在这个 head 上落地:relay pr_ready + automerge_enable。MERGED 后在 After syncing a table from a datasource, nothing tells the administrator what to do next, and form labels are raw column names #30328 发落地评论,摘 pm:dispatched,剩余部分 Release 回队列(指向 Datasource table sync: the generated object draft gives its fields no label, so forms show raw column names; where the synced object lives (package, export) is unstated #30469)。

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.

1 participant