Skip to content

专题:元数据的声明式动作(软件包和各类元数据的按钮用声明挂上,插件和 AI 也能加,不再写死在界面里)(暂停) #37408

Backlog

Description

@objectstack-fleet

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

③ maintainer direct order · Source: maintainer, 2026-11-26, seat repo:objectstack#4 session. ④ coordination parent: not dispatched itself; children are split and filed when the topic is picked up. Priority p3 as ordered. ⛔ Not a claim.

维护者速读

  • 要解决什么:业务对象的按钮是声明出来的(actions),元数据这边大多写死在界面代码里。插件或客户想给软件包、或者给某类元数据加一个动作(例如「同步到 Git」「导出成模板」),现在只能改平台代码。
  • 现状:机制其实已经有一半。元数据类型可以声明类型级按钮,和业务对象用同一套按钮定义;插件也能追加。但只有「数据源 › 测试连接」一处在用,界面也只接了「调接口」这一种按钮。软件包「⋯」菜单和每个详情页的新建、编辑、删除都写死在界面里。软件包本身不是元数据类型,挂不上按钮。
  • 大方向(开工时再出决策卡定细节):① 元数据按钮支持的种类补齐到和业务对象一致(至少跑流程、打开表单);② 给软件包一个挂按钮的位置,把内置动作逐步改成声明,显示和置灰规则也用声明表达。
  • 优先级 p3:目前没有具体客户或插件提出要自定义元数据动作,先立专题占位,不派发。
  • 要你做什么:现在无。开工前先出一张决策卡给你定范围。

Maintainer's words (2026-11-26)

  • 「还有,元数据有类似数据的 action 概念吗?这些动作现在都是写死的吗」
  • 「立一个新的专题 p3」

Readings (at ff6f9768d29)

  • The declaration exists. MetadataTypeRegistryEntry.actions (packages/spec/src/kernel/metadata-plugin.zod.ts:395) reuses the business-object ActionSchema verbatim. A plugin layers more actions onto any type with registerMetadataTypeActions() (packages/spec/src/kernel/metadata-type-schemas.ts:412), and getMetadataTypeActions merges the two layers.
  • The renderer exists. ui/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.tsx draws these actions in the record header and the list toolbar.
  • One consumer. The only caller is the datasource "Test connection" action (packages/services/service-datasource/src/datasource-admin-plugin.ts:348).
  • One action type. Only type: 'api' is wired (MetadataTypeActions.tsx:171-174). Any other type shows "is not supported here yet".
  • Package actions are hard-coded. The package ⋯ menu actions (edit details, export, duplicate, revert, adopt, publish, import) live in ui/packages/app-shell/src/views/metadata-admin/packageActions.tsx, and so do their visibility and disabled rules. The built-in new, edit and delete on every metadata detail page are UI code too.
  • No slot for packages. A package is not a metadata type, so it has no registry entry and cannot carry declarative actions.

Direction (to be settled by a decision card when the topic starts)

  1. Close the declared ≠ enforced gap first. ActionSchema lets an author declare flow, modal and other types on a metadata type, and the runtime refuses them with a toast. Under ADR-0049 enforce-or-remove, either wire the other types in MetadataTypeActions.tsx or narrow what a metadata type may declare to the wired set.
  2. Give packages an action slot. The decision card must pick where it lives: a registry entry for the package type, or a dedicated package action list in spec.
  3. Migrate the built-ins. Move the hard-coded package actions onto the declaration, together with their visibility and disabled rules: read-only packages, revert confirmation, permission greying (Studio「⋯」软件包菜单:加「新建软件包」,没有设置权限的人「在设置中管理…」置灰并说明原因 #37400).

Open questions for the decision card:

  • Pull. Is there a named plugin or customer action that needs this? Without one, the four-axis frame recommends step 1 only.
  • Whether built-in actions migrate, or only third-party actions use the declaration.
  • How permission rules are expressed: reuse the object action visible/disabled expressions, or use a package-specific predicate set.
  • Whether AI authoring (skills) teaches metadata-type actions, and the eval case that pins it.

Children

None filed yet. The seat splits them when the topic is picked up, with a decision card first.

Related

Activity

  1. added
    pm:epic
    area:studio
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:ux · priority:p3 · pm:epic; rationale: a topic placeholder the maintainer ordered at p3 (declarative actions for metadata). Epics take no type. area:studio is not one of the eight North Star areas. Studio authoring surfaces are area:ux, so the area moves there.

    The grade the maintainer set (p3) stays. Not dispatched. Its children are filed after the scoping decision card.

  3. added and removed
    area:studio
    on Nov 26, 2026
  4. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Paused · #37408 · 2026-11-28T01:42Z. The maintainer, verbatim: 「#37408 元数据的声明式动作 继续暂停」. pm:on-hold is added and the title marked (暂停). No cards are linked; #36495 and #36496 stay where they are.

  5. added
    pm:on-hold
    on Nov 28, 2026
  6. changed the title [-]专题:元数据的声明式动作(软件包和各类元数据的按钮用声明挂上,插件和 AI 也能加,不再写死在界面里)[/-] [+]专题:元数据的声明式动作(软件包和各类元数据的按钮用声明挂上,插件和 AI 也能加,不再写死在界面里)(暂停)[/+] on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxpm:epicpm:on-holdpriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions