Skip to content

@object-ui/core 里第二个 mergeViewsIntoObjects:仓内零消费者,且丢掉容器的默认 list、用裸键而非组装器身份 #3775

Description

@yinlianghui

做 #3770 时清扫「规则的消费半径」发现的,观察类(dormant code,今天没有用户会撞上),按 PD #10 立单记录,不在该单范围内。

事实

仓里有两个 mergeViewsIntoObjects:

  1. packages/app-shell/src/providers/MetadataProvider.tsx —— 真正在用的那个。app-shell 用已退休的 || 'list' 方言给默认列表视图命名,与组装器身份 default 不一致 —— 默认列表的译文键在 objectui 永远命不中 #3770 之后它对容器调 expandViewContainer,视图身份一律 {object}.{key}(含默认 list 的隐式 {object}.default),并继承组装器的折叠 / 改名去重。
  2. packages/core/src/utils/merge-views-into-objects.ts —— 由 packages/core/src/index.ts 公开导出,但全仓零消费者(grep mergeViewsIntoObjects:只有 app-shell 自己的实现与测试,data-objectstack 仅在注释里提了一句「mirroring MetadataProvider.mergeViewsIntoObjects」)。

第 2 个的行为与第 1 个已经不是一回事:

  • 只读 view.listViews,完全忽略容器的默认 list —— 经它合并的对象拿不到主列表视图;
  • 键用作者写的裸键(all),不是组装器身份({object}.all),因此下游按 view.name || view.id 去解析 _views 译文键时,行为与 app-shell 那条路径不一致;
  • 对象名从 listView.data.object 反推,而 app-shell 那条还接受 view.name 与 form.data.object。

ROADMAP.md:1428 还挂着一条未完成项:「Move mergeViewsIntoObjects from composeStacks to runtime/provider layer」—— 这个 core 版本正是那次搬迁留下的中间态。

为什么记成观察类而不是缺陷

它没有仓内调用方,所以今天没有任何用户路径会命中上面三条差异;但它是 @object-ui/core 的公开导出,外部消费者拿到的是一个与真实渲染路径已经分叉的实现,而分叉点恰好是 #3770 刚统一掉的那个(视图身份)。留着不管的风险是下一个 agent 把它当成「那个 merge」去读或去改。

方向留给分诊:要么删(公开导出,需按 objectui 的破坏性变更约定走 changeset,注意 AGENTS.md 的「不要声明 major」),要么让它内部委托到同一段组装器逻辑。

相关

Activity

  1. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    Contributor

    Finding-triage ruling: Hold (why still held): the second mergeViewsIntoObjects in core has zero in-repo consumers and diverges from the live app-shell merge, but removing a public export is a changeset-discipline change, not a drive-by; the record's chief value is stopping the next agent from mistaking it for the live merge. Restart: the next dead-code sweep or the next core public-surface changeset (ROADMAP.md:1428 item still unchecked).

    Authorization: maintainer directive (this session) —「对于issue中的findings 执行一次集中分诊,并更新issue 的状态。」Centralized pass under that directive; finding grading is normally the triage seat's single channel. Round: objectstack#4949 finding-triage, 2026-08-10.
    Session: 01JaVVMrSxt7Tgi1uwEuDtH7


    Generated by Claude Code

  2. claude commented on Aug 10, 2026

    @claude
    Contributor

    Findings triage (re-verify @ origin/main da81093): HOLD — the second copy (packages/core/src/utils/merge-views-into-objects.ts) still exists, is still publicly exported (core/src/index.ts:34), and still has zero in-repo consumers (the only new grep hit since filing, clientValidation.ts:76, is a comment). Divergence from the app-shell path stands. Exit is delete-with-changeset vs delegate — a public-API call, held for a ruling. finding stands.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  3. claude commented on Aug 11, 2026

    @claude
    Contributor

    Findings cadence (triage seat): HOLD — re-verified on origin/main @ e1ade8f: the second mergeViewsIntoObjects is still exported from @object-ui/core (packages/core/src/utils/merge-views-into-objects.ts:20) with zero in-repo consumers (only a prose mention in data-objectstack), still diverging from the app-shell path on default-list handling and view identity. Keep-vs-retire is an enforce-or-remove-shaped call on a public export; holds until graded with that question in front of whoever owns the core surface.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  4. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings triage (cadence re-verify @ origin/main 5e2e9fa): HOLD as finding. The second mergeViewsIntoObjects still exists at packages/core/src/utils/merge-views-into-objects.ts and still has zero importers outside packages/core (repo-wide grep; counter-probe: the same pattern finds the live app-shell implementation in MetadataProvider.tsx and its merge tests). Dormant duplicate with the recorded defects (drops container default list, bare-key identity); promote as a deletion candidate in the next core dead-export sweep — deletion needs the usual tombstone/changeset discipline, not a rider.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  5. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings triage (cadence re-check): HOLD as finding — premise frozen.

    • Re-verified on origin/main @ b954120: packages/core/src/utils/merge-views-into-objects.ts still exists, and the repo-wide mergeViewsIntoObjects hit list is unchanged in kind — app-shell's own implementation + its tests, the core copy, and prose mentions (data-objectstack/src/index.ts, clientValidation.ts); still zero real importers of the core export.
    • Dormancy contract intact: no in-repo caller, divergence (no default list, bare keys) unreachable today. Delete-vs-delegate direction still undecided — stays with the card.
    • Rotation note: premise now frozen across 3+ checks; candidate for back-of-rotation if unchanged next cycle.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  6. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings cadence (triage seat): HOLD — re-verified @ origin/main 6044d13: the second mergeViewsIntoObjects copy is still exported from packages/core/src/utils/merge-views-into-objects.ts:20, still with zero in-repo consumers (all live call sites resolve to the app-shell MetadataProvider implementation), still dropping the container default list and using bare keys rather than assembler identity. Dead-surface deletion candidate; no behaviour hit today. finding stands. Restart unchanged: fold into the next dead-surface sweep batch (the #3931 sweep shape is the precedent) or the next @object-ui/core utils touch.

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  7. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings triage: promoted — finding → pm:queue as a member of sweep #4328 (dead-surface deletions batch 3). Not individually dispatchable while the sweep is open; the sweep PR closes it via Fixes.

    Premise re-verified on origin/main @ b16be40: the second copy still exists at packages/core/src/utils/merge-views-into-objects.ts:20, re-exported via packages/core/src/index.ts:34, with zero in-repo consumers; the live copy is app-shell's MetadataProvider.mergeViewsIntoObjects (MetadataProvider.tsx:222, consumed at :697).

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions