Skip to content

fix(app-shell): the publish sheet names a batch of hooks or translations in words, not the raw type code (#29902) - #30361

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

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG

Fixes #29902

Clause-②: yes (widening) — two new count families in the public @object-ui/i18n packs: preview.changes.typeCount.hook, preview.changes.typeCount.translation.
Metadata-protocol: none

维护者速读

  • 改了什么:Studio 发布面板(待发布变更)的汇总行和分组标题,现在把一批钩子、翻译显示成「3 hooks」「钩子 3」「翻译 2」,不再是原始类型码「3 hook」「hook 3」。
  • 为什么改:钩子在对象的 Hooks 标签页、翻译在「全部元数据」表单编辑器里由 Studio 自己创作,作者每次发布都看到未翻译、未变复数的类型码,中文界面里还夹着英文。
  • 风险与回滚:只加两行计数文案和 10 个语言包的新键,其他类型和未知类型的显示不变;回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/preview/DraftChangesPanel.tsx(TYPE_COUNT 末尾两行)、ui/packages/i18n/src/locales/zh.ts(typeCount.hook / typeCount.translation)。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/app-shell/src/preview/__tests__/DraftChangesPanel.groupHeading-13221.test.tsx,预期全绿,其中含「3 hooks」「钩子 3」「翻译 2」三条新断言。
  • 需要你做的:无,席位落地。

What changes

  • TYPE_COUNT in DraftChangesPanel.tsx gains a hook and a translation row, so the summary line and the per-type group heading read the pack's count family instead of the raw {{n}} {{type}} fallback. The fallback stays for types with no row (objectui#13147 note above the table).
  • Every one of the ten packs under ui/packages/i18n/src/locales/ gains both families, with each CLDR slot its language selects (es/fr/pt _many, ru _few/_many, ar _zero/_two/_few/_many), mirroring the dataset rows. zh-CN reads 「钩子 N」 (the platform nav's own word for hooks, nav_hooks) and 「翻译 N」.
  • One changeset: @object-ui/app-shell and @object-ui/i18n, patch.

Which types get a row: the enumeration

The publish door batches every draft the package holds, whatever its type (publishPackageDrafts in packages/metadata-protocol/src/protocol.ts reads repo.listDrafts({ packageId }), no type filter). A draft can exist only for a type the registry lets a runtime create or overlay: allowRuntimeCreate or supportsOverlay true in DEFAULT_METADATA_TYPE_REGISTRY (packages/spec/src/kernel/metadata-plugin.zod.ts). Those types, and who in Studio authors them:

Type Studio authors it? Row before
object, view, page, dashboard, report, app, flow, permission, action, email_template, object_extension, dataset yes (pillars, object panels, nav, bundle editor) yes
hook yes: studio-design/ObjectHooksPanel.tsx saves hook drafts no, added
translation yes: studio-design/StudioBundleItemEditor.tsx, listed in AREA_FORM_EDITOR_TYPES (metadataArea.ts) no, added
seed, mapping, external_catalog, doc, book, position, tool, skill no Studio editor of its own (only the generic metadata pages) no, unchanged (raw fallback)

picklist, named on the card, has both flags false: no draft of it can exist, so the publish door never batches one and no row is added. (agent keeps its existing row.)

Acceptance notes

  • File surface deviation, agreed with the seat before the edit: the claim named the en and zh-CN packs; all ten packs are touched because ui/packages/i18n/src/__tests__/all-locales-key-parity.test.ts requires every pack to define every en key (and the per-language plural slots). The dataset row set the same precedent.

Verification

Head cf373b6e (after merging origin/main once; the merge touched none of the changed files).

Targeted tests (6 files, 79 tests)

cd ui && pnpm exec vitest run on DraftChangesPanel.summaryPlural-13147.test.tsx, DraftChangesPanel.groupHeading-13221.test.tsx, and the i18n all-locales-key-parity, en-zh-key-parity, count-families-11445, plural-categories-11432 tests: Test Files 6 passed (6), Tests 79 passed (79).

Ablation (one, on the tested behaviour)

node scripts/ablation-replace.mjs deleted the hook: row (anchor 1 → 0, blob 4b7c507f → 9cc8f165): Tests 3 failed | 11 passed (14), the three hook assertions red. Restored: blob back to 4b7c507f, git diff HEAD empty.

Type-check

pnpm exec turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n --concurrency=2 under the verify lock: Tasks: 69 successful, 69 total (app-shell runs tsc --noEmit and tsc -p tsconfig.test.json).

Derived gates (35)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 35 families; all 35 ran and exited 0, including node scripts/check-sdui-manifest.mjs, pnpm check:type-check-debt and pnpm --dir ui exec vitest run scripts/ (170 files passed). --ran reconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. Repo-wide families are CI's.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling labels Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG

Known red, not this PR's · Lint UI (job 127123295877). The failing step is @objectstack/spec check:liveness: query/searchFields → packages/objectql/src/engine.ts cites a file that no longer names the key. engine.ts names searchFields 4 times at 8589756a and 0 times at f672e0dc (PR #30341 moved the private docblocks into hand modules). This diff touches only ui/packages/app-shell and ui/packages/i18n. The fix belongs on main (repoint the packages/spec/liveness/query.json citation); the owning server seat has been told. This PR merges origin/main once that fix lands, then the seat re-reads CI.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG

维护者速读

  • 改了什么:Studio 发布面板(待发布变更)的汇总行和分组标题,把一批钩子、翻译显示成「3 hooks」「钩子 3」「翻译 2」,不再是原始类型码「3 hook」「hook 3」。
  • 为什么改:钩子和翻译都由 Studio 自己创作,作者每次发布都看到未翻译、未变复数的类型码,中文界面里夹着英文(Studio publish sheet: a batch of hooks reads "3 items · 3 hook" (zh-CN "hook 3"), because hook has no count row and falls back to the raw type name #29902)。
  • 风险与回滚:只加两行计数映射和 10 个语言包的新键,其他类型和未知类型的显示不变;回滚即撤本 PR。
  • 先看:DraftChangesPanel.tsx 的 TYPE_COUNT 末尾两行,zh.ts 的 typeCount.hook / typeCount.translation。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/app-shell/src/preview/__tests__/DraftChangesPanel.groupHeading-13221.test.tsx,预期全绿。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。

席位核对 — ACCEPT · head 65f9e1b

  • 形态:14 文件 +144/−0(面板 5 行、两份测试、十个语言包、changeset)。check-governed-merges --pr 30361:NOT governed,144 行 ≤ 3000。Fixes #29902。
  • 契约复审(TIER_DEFAULT,席位自审):Clause-② yes (widening)。@object-ui/i18n 新增 typeCount.hook、typeCount.translation 两个计数族,十包按各语言 CLDR 复数槽补齐(与已有 dataset 行同形),只增不改;无新包导出。Metadata-protocol none。
  • 前提实测:类型枚举表在 PR 正文:草稿只可能存在于 allowRuntimeCreate 或 supportsOverlay 的类型,Studio 自创作而缺行的只有 hook 和 translation;卡上点名的 picklist 两个标志都为 false,不会出现在发布批次,不加行。消融删 hook 行 3 红;合 main 后 head 65f9e1b 上改动相关 6 文件 79/79。
  • 门禁 check-runs:head 上 55 个,44 success、11 skipped(Test Core、Build Core、Build Docs、Dogfood、Temporal、opt-in 冒烟等 server/core/opt-in 项,ui-only diff 的预期跳过),无红。
  • 接受的偏差:文件面从 en/zh 扩到十个语言包,因为 all-locales-key-parity 要求每包都有每个 en 键,改前已与席位商定。
  • 范围外去向:无。
  • 落地条款:中继 pr_ready + automerge_enable;合并后清 pm:dispatched,在 Studio publish sheet: a batch of hooks reads "3 items · 3 hook" (zh-CN "hook 3"), because hook has no count row and falls back to the raw type name #29902 发落地评论。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 10:16
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 7945a3b Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ynybuk branch November 5, 2026 10:43
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio publish sheet: a batch of hooks reads "3 items · 3 hook" (zh-CN "hook 3"), because hook has no count row and falls back to the raw type name

1 participant