Skip to content

Studio 重构(2-1):通用详情换新头部,六个侧边抽屉改成页签(详情、预览、相关、被引用、历史、源码),出一套设计器也能用的页签组件 #36901

Description

@os-support-ai

repo:objectstack#3 · os-support-ai · session_01WGufzufqmKuir7GiTdwGd3Z

③ topic child · Source: topic #36890 (decisions 4, 8, 10). Part of #36890.

今天(读代码确认,主干 0819cab)

  • MA/ResourceEditPage.tsx:3897-4045 有分层、审查、被引用、相关、历史、审计六个 Sheet,开关在 :2892-2990。openSheet 已镜像到 ?tab=(:1611-1668)。
  • 组件:LayeredDiff、ReferencesPanel、HistoryPanel、AuditPanel、JsonSourceEditor 在 AS/views/item-tools/;审查 MA/DraftReviewPanel.tsx、相关 MA/RelatedPanel.tsx。
  • 设计器页头是另一套 item-tools/StudioItemTools.tsx(分层、被引用、历史、审计、源码),挂在 SDS:4612, 7659, 10034。
  • 「相关」只对登记了锚点的类型有(:1590-1592);历史和审计只给 canReadTrail 的人(:2969-2990)。
  • 「预览」就是编辑画布:登记了预览的类型进页面就进入编辑(:1918-1935),画布拥有部分顶层键(:362-368),操作按钮让给画布工具栏(:3017-3025, 3172)。MA/previews/index.ts 24 条登记(去掉别名和归设置管的 datasource 是 21 种)。
  • 第三条编辑路径:邮件模板、翻译和只读包上的数据集打开的是 SD/StudioBundleItemEditor.tsx(SD/metadataArea.ts:117, 127,SD/StudioMetadataArea.tsx:167-182)。
  • 独立历史路由 /:type/:name/history(StudioMetadataArea.tsx:255);嵌入模式 embedded(:1591, 1613)不显示页签。
  • ?review=1 是 MCP、CLI 和控制台草稿审阅链接的落点(packages/runtime/src/domains/mcp-authoring.ts:1294)。

要做的

  1. ResourceEditPage 和 StudioBundleItemEditor 都用 0-2 的头部组合件;‹ › 用 1-1a 的有序名字列表。
  2. 六个抽屉改页签(决定 8):详情、预览(有画布的类型)、相关(有锚点的类型)、被引用、历史(合并审计,按 canReadTrail 显示)、源码(合并分层对比,只读用户也能看分层)。审查改成头部状态标签,保留 ?review=1。页签写进地址(沿用 ?tab=),独立历史路由并进「历史」页签并留重定向。
  3. 有画布的类型:定默认页签、详情表单和画布是否共用一份草稿和一次保存(决定 4),PR 里写明。
  4. 把页签做成两边共用的组件,3-1、3-2、3-3 接入,不各做一遍。
  5. 保留 embedded 分支、画布拥有的键、诊断和冲突保护(:1060):在原文件里改结构,不重写。
  6. 可以先做头部和页签骨架一个 PR,再把预览类型一个 PR。

验收

  • 普通类型(如钩子)、有画布的类型(如邮件模板)、StudioBundleItemEditor 类型(如翻译)各走一次:头部、页签、地址、刷新、‹ ›。
  • ?review=1 和旧 /history 地址仍能打开对应页签。
  • 引用详情页的测试(137 个文件,直接断言抽屉的个位数)通过。

Blocked-by: #36892
Blocked-by: #36896

Grading: area:ux · Feature · metadata detail (six tools hidden in side sheets) · builders, every item · evidence: read from code. Topic child ⇒ p2.
Dedupe: ResourceEditPage sheets tabs (no open card).
Reader: seat repo:objectstack#3, one os-dev card. Size L. Metadata-protocol: none. Wave 1–2 (detail line).

Activity

  1. added
    enhancement
    priority:p2
    pm:blocked
    on Nov 24, 2026
  2. added
    domain:ui
    on Nov 24, 2026
  3. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR

    Claim: PM loop round 1
    Session: session_01WGufziBCAytAzzCu3iPBFR
    Account: os-support-ai
    Branch: claude/issue-36901-detail-header-tabs
    Worktree: objectstack-issue-36901
    Domain: domain:ui
    Seat: repo:objectstack#3
    Area: ux-E
    File surface: ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx and its tests, ui/packages/app-shell/src/views/studio-design/StudioBundleItemEditor.tsx, the history route in studio-design/StudioMetadataArea.tsx (redirect only), ui/packages/app-shell/src/views/item-tools/** (the shared tab component, wrapping the existing panels), metadata-admin/DraftReviewPanel.tsx / RelatedPanel.tsx if their mount changes, new files for the shared tab strip, Studio strings in ui/packages/i18n/**, the e2e specs that drive the six sheets, and a changeset. ⛔ Not StudioDesignSurface.tsx: designers wire the tabs in #36903 / #36904 / #36905 (stop on breach; explain in the report)
    Container & model: L, mode:subagent, model: default — dispatch-gates.mjs --tier: "Model tier — no path-derived mandate", effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds, line numbers moved (read on origin/main 69c3dc4: ResourceEditPage.tsx 4,247 lines, openSheet mirrored to ?tab= at :1611-1668; the Sheet mounts still present; StudioBundleItemEditor.tsx 729 lines; item-tools panels LayeredDiff, ReferencesPanel, AuditPanel, JsonSourceEditor, StudioItemTools present; ?review=1 produced at packages/runtime/src/domains/mcp-authoring.ts:1294)
    Pre-claim lane: repo:objectstack seat 3 area ux-E (epic #36890; L children pre-cleared by the seat 2026-11-24 08:22Z); every path under ui/**, domain:ui, area:ux
    Pre-claim deps: Blocked-by: #36892 merged (PR #36924, 00dd362); Blocked-by: #36896 merged (PR #36939, bac4864, 11:16Z) ⇒ pm:blocked removed
    Prior rulings read: check-prior-rulings --card 36901 on ResourceEditPage / StudioBundleItemEditor / StudioItemTools: 21 surface hit lines (code comments citing earlier rulings on the conflict guard, canvas-owned keys and canReadTrail; the card keeps all three, item 5); tree terms 28 hits, none on sheets vs tabs; thread: none. Governing: #36890 decisions 4, 8, 10, 12 (maintainer 「全部按建议」), ADR-0146 D1 as amended by PR #36921 (56d723f)
    Serial constraints cleared: no open PR touches ResourceEditPage.tsx, StudioBundleItemEditor.tsx, item-tools/**, DraftReviewPanel.tsx, RelatedPanel.tsx or StudioMetadataArea.tsx (open PRs read 2026-11-24 11:2xZ); same-day churn on the surface: 3f568c1 (#36884), 4c93f88. SDS is not edited ⇒ no SDS slot used.
    Size: L. The card allows two PRs (header + tab skeleton, then the canvas types); the 3,000-line Tier H line counts across both, so the dev stops and reports before passing it.

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 24, 2026
  5. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
    os-dev-report

    {
      "issue": 36901,
      "status": "done",
      "branch": "claude/issue-36901-detail-header-tabs",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36977",
      "pr_numbers": [
        36977
      ],
      "head_sha": "be293d754",
      "session": "session_01WGufziBCAytAzzCu3iPBFR",
      "dev_effort": "Dev-effort: high",
      "rounds": "Rounds: 1",
      "premise_still_valid": true,
      "summary": "Studio's generic item page and the area's form editor (email template, translation) now draw StudioDetailHeader through a new ResourceDetailHeader (x to the list with list context and scope, prev/next over useListOrderedNames keeping the open tab, both through confirmUnsavedLeave). The six side sheets are tabs from ONE shared component, item-tools/ItemToolTabs.tsx (strip, ?tab= address with legacy layers/audit values, References/History(+Audit)/Source(+layered diff) panels), ready for #36903/#36904/#36905. The review is a header status chip and ?review=1 still opens it; the area's TYPE/NAME/history address redirects to ?tab=history, keeping the standalone page for own-EditPage types (permission matrix) and pillar-designer items. Decision 4: a canvas type opens on Preview; Details and the canvas edit one draft with one Save, so tab switches keep edits and are not guarded. Decision 15: no marker added (the page is Studio's own address).",
      "decision_4": "Canvas type opens on Preview; Details shows the whole-item form (canvas-owned keys hidden as before); both edit one draft, one Save (header button, Cmd-S, autosave) saves it on any tab; tab switches keep the buffer and do not prompt; ItemToolTabStrip has confirmSwitch for hosts whose tabs drop a buffer.",
      "decision_15": "Not added: x always returns to Studio's list on Studio's own address; the marker governs pages opened inside an app.",
      "tests": "At be293d754, under the verify lock: affected set 156 files `Test Files 156 passed (156)`, `Tests 1407 passed (1407)`; `pnpm --dir ui exec vitest run scripts/` `Test Files 172 passed | 2 skipped (174)`, `Tests 5126 passed | 2 skipped (5128)`; `pnpm --filter @object-ui/app-shell run type-check` (src + tsconfig.test.json) exit 0 (lock VERDICT command-exit 0). New suites: ItemToolTabs.test.tsx, ResourceDetailHeader.test.tsx, ResourceEditPage.detailTabs-36901.test.tsx (plain/canvas default tab, one draft across tabs, ?review=1 chip + CONTROL, N2 Esc under canvas fullscreen); updated tabDeepLink-12496, routes-28561 (redirect + two CONTROLs), bundle customize-28569 (shared buffer + x). Ablation N2 at 4de0ca7f0 via ablation-replace.mjs: first attempt (replacement 'closeOnEscape') refused as a no-op by the tool, ran nothing; second: anchor 'closeOnEscape={!isFullscreen}' 1->0, blob 0aa6c362->ad96efcc, N2 case red (1 failed | 4 passed), restored blob == HEAD, git diff HEAD empty; suite imports src, no dist hop. Browser walk on the showcase (private port, Chromium): hook header/tabs/address/next keeps tab/x to list, old /history address opens History tab, email template form editor tabs, page canvas type opens on Preview, 0 page errors; translation NOT MEASURED in browser (showcase ships none).",
      "gates": "dispatch-gates --commands: 39 families run, each exit 0 (captured before any pipe); check:test-source-alias exit 1 on first pass (new/edited suites reached a dynamic @objectstack/lint / editor import inside a case clock) -> fixed in be293d754 -> exit 0; check:type-check-debt first rerun exit 3 (lock queue, no slot set) -> rerun exit 0. --ran: '39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN'. ui: check:i18n-keys 0, check:i18n-drift 0, check:i18n-dead-keys 0, check:new-line-citations 0 new exit 0. CI on #36977 at be293d754: 22 check-runs, 5 completed/skipped, 17 in_progress at report time (in_progress is the honest value). PR draft, mergeable true, mergeable_state blocked (not dirty).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "line_budget": "card total 2,198 changed lines (+1701 / -497, 21 files, vs origin/main merge base) in ONE PR #36977, under the 3,000 Tier H threshold; no second PR.",
      "files_changed": [
        ".changeset/36901-detail-header-tabs.md",
        "ui/packages/app-shell/src/views/item-tools/ItemToolTabs.tsx (new)",
        "ui/packages/app-shell/src/views/item-tools/ItemToolTabs.test.tsx (new)",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceDetailHeader.tsx (new)",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceDetailHeader.test.tsx (new)",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.detailTabs-36901.test.tsx (new)",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tabDeepLink-12496.test.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.layersUnsaved-11799.test.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.referencesColumns-25916.test.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.referencesErrorState.test.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/metadataAreaHost.gates-28561.test.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/trailDoorsGate-12475.test.tsx",
        "ui/packages/app-shell/src/views/metadata-admin/walledCatalogReadOnly-12183.test.tsx",
        "ui/packages/app-shell/src/views/studio-design/StudioBundleItemEditor.tsx",
        "ui/packages/app-shell/src/views/studio-design/StudioBundleItemEditor.customize-28569.test.tsx",
        "ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.itemTools-28239.test.tsx",
        "ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.tsx",
        "ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.routes-28561.test.tsx",
        "ui/packages/i18n/src/namespaces/studio/en.ts",
        "ui/packages/i18n/src/namespaces/studio/zh.ts"
      ],
      "deviations": [
        "Tab switches on the generic page are not routed through confirmUnsavedLeave (one shared buffer, nothing lost; decision 4); x and prev/next are. The shared strip offers confirmSwitch for hosts that need it.",
        "Form editor has no Preview tab (its preview is a live rendering beside the form).",
        "Embedded mode keeps PageShell with no tabs; only the review chip and actions remain there.",
        "Files outside the claim's literal File surface: ResourceDetailHeader.tsx (new, beside the page) and six test files this change turned red (metadataAreaHost.gates-28561, trailDoorsGate-12475, walledCatalogReadOnly-12183, StudioBundleItemEditor.customize-28569, StudioDesignSurface.itemTools-28239 (test only; StudioDesignSurface.tsx untouched), StudioMetadataArea.routes-28561). Also removed the now-dead string engine.edit.related (en, zh).",
        "The area's /history redirect keeps the standalone history page for pillar-designer items (flow, object...) as well as own-EditPage types, since those items have no tab row until #36903-#36905; the dispatch named only the redirect.",
        "No e2e spec drove the six sheets; studio-customize-journey.spec.ts references studio-bundle-editor-more only as a fallback and was left untouched (that test id no longer exists; the override chip is in the always-visible header actions).",
        "The harness reminder asked for a model-named Co-Authored-By trailer; commits use the model-free pair the dispatch and os-dev.md require. The PR body ends with the dispatch's footer and signed line; the session link is in Verification.",
        "CI convergence not awaited (os-dev.md: report at local verification end); 17 check-runs in_progress at report time."
      ],
      "api_writes": "2 — fleet-write relay: 1 pr_create action (POST /repos/objectstack-ai/objectstack/pulls draft + POST /repos/objectstack-ai/objectstack/issues/36977/assignees), plus this os-dev-report comment via post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/36901/comments). git push is not a REST write.",
      "mcp_calls": "0",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #36903/#36904/#36905 · the area's TYPE/NAME/history address for a pillar-designer item still shows the standalone history page until those cards mount ItemToolTabs; noted, not filed",
        "carrier: none · e2e studio-customize-journey.spec.ts keeps a fallback on the retired studio-bundle-editor-more test id (dead branch, not a defect); noted, not filed"
      ]
    }

    Generated by Claude Code

  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR

    Close-out: PR #36977 merged as c75453e (2026-11-24 13:52Z) and closed this card. pm:dispatched removed. Follow-ons: #36902 is claimed (7133542157). The designer cards #36903 / #36905 (ux-E) and #36904 (ux-A) mount item-tools/ItemToolTabs and remove the designer-item exemption in AreaHistoryRedirect.

  7. removed
    pm:dispatched
    on Nov 24, 2026
  8. added 2 commits that reference this issue on Dec 1, 2026
    c75453e
    886e970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions