Skip to content

Studio 重构(0-2):全屏详情的头部组合件——用 StudioItemHeader 的插槽放 ×、来源包、‹ › 加序号、⋯ 和主按钮 #36892

Description

@os-support-ai

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

③ topic child · Source: topic #36890 (maintainer epic; rulings quoted there). Part of #36890.

为什么

所有类型的全屏详情要同一个头部:左上 × 回列表,类型 + 标签 + API 名称,来源包和状态标签,右上 ‹ › 加「序号 / 总数」,⋯ 更多,主按钮。维护者:「对象弹出之后不用再下拉了吧?关闭回到列表重新选就行。」「也不需要在应用打开的按钮。」「上一个下一个可以保留」。

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

  • SD/StudioItemHeader.tsx(783 行)已经是「图标 + 标签 + API 名称 + 标签 + 状态 + 操作 + 页签行 + ⋯ 折叠菜单」,带窄宽度让位规则(文件头注释列了八次修正),有 leading、actions、tabs、foldMenu 插槽(:591-634)。
  • 通用详情页今天用的是 MA/PageShell.tsx(387 行)。

(SD/ = ui/packages/app-shell/src/views/studio-design/,MA/ = …/views/metadata-admin/。)

要做的

  1. 新文件里做一个薄的组合件,用 StudioItemHeader 的插槽组合出上面的头部。不改 StudioItemHeader.tsx 本身(Studio「界面」整栏作废:顶部导航去掉「界面」,原来在里面改的东西各有去处;前置的运行界面入口全部落地后再摘 #36502 认领了整个 SD/**)。
  2. 定下 ‹ › 的数据接口:组合件接收「当前列表的有序名字」和当前名字,算出序号、上一个、下一个;来源由 1-1a 提供(决定 10:筛选和排序带在详情地址里,没有上下文按名称排序)。
  3. × 和 ‹ › 走离开拦截(AS/chrome/unsavedEdits.ts 的现有接缝)。
  4. 不放切换下拉,不放「在应用里打开」。
  5. 单测:序号计算、首尾禁用、窄宽度折叠沿用 StudioItemHeader 的规则;键盘:Esc 触发 ×,‹ › 可用键盘到达。

不做的

  • 不接入任何页面(2-1、3-1、3-2、3-3 接)。

验收

  • 组合件有单测和故事/测试页覆盖宽、窄两种宽度。
  • 不改 StudioItemHeader.tsx,不新增产品命名的 widget 或 hook 之外的公共接口。

Grading: area:ux · Feature · Studio shell (one detail header for every type) · builders, every item they open · evidence: read from code. Maintainer-sourced topic child ⇒ p2.
Dedupe: covered by #36890's queries.
Reader: seat repo:objectstack#3, one os-dev card. Size S. Metadata-protocol: none. Wave 0 (can start now).

Activity

  1. added
    enhancement
    on Nov 24, 2026
  2. added
    priority:p2
    pm:queue
    on Nov 24, 2026
  3. added
    domain:ui
    on Nov 24, 2026
  4. 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-36892-studio-detail-header
    Worktree: objectstack-issue-36892
    Domain: domain:ui
    Seat: repo:objectstack#3
    Area: ux-E
    File surface: one NEW header composite file (plus its test file and a story/test page) under ui/packages/app-shell/src/views/studio-design/ or a new sibling folder, the Studio strings it needs in ui/packages/i18n/**, and a changeset; reads (does not edit) StudioItemHeader.tsx and ui/packages/app-shell/src/chrome/unsavedEdits.ts (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default — dispatch-gates.mjs --tier: "Model tier — no path-derived mandate", effort: medium (small console-only card: one surface, no spec/protocol/ADR, not Tier H)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds (read on origin/main e0050ba: StudioItemHeader.tsx 783 lines with actions / tabs / leading / foldMenu props (:612-626); metadata-admin/PageShell.tsx 387 lines; ui/packages/app-shell/src/chrome/unsavedEdits.ts exists)
    Pre-claim lane: repo:objectstack seat 3 area ux-E (epic #36890); every path is under ui/packages/app-shell/src/ (Studio), domain:ui, area:ux
    Pre-claim deps: no Blocked-by: line; wave 0 of #36890
    Prior rulings read: check-prior-rulings --card 36892 --paths StudioItemHeader.tsx,unsavedEdits.ts: surface grep 0 ruling / 0 ⛔ → no ruling; terms studio,studioitemheader → 28 tree hits, none on a detail header's controls; thread: none. Product shape from #36890 (maintainer: no switcher dropdown, no "open in app", keep ‹ ›; decisions 7, 10, 12)
    Serial constraints cleared: StudioItemHeader.tsx is NOT edited (#36502 / PR #36884 holds SD/** and adds StudioItemHeader.statusPlace-12524.test.tsx; this card adds a new file only); no open PR touches chrome/unsavedEdits.ts; StudioDesignSurface.tsx is not touched (no seat slot needed)

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

    @objectstack-fleet
    Contributor

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

    {
      "issue": 36892,
      "status": "done",
      "branch": "claude/issue-36892-studio-detail-header",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36924",
      "pr_number": 36924,
      "head_sha": "7a4b4a3482f91cd7330b0338a4d0187c75f77bea",
      "remote_branch": "origin/claude/issue-36892-studio-detail-header @ 7a4b4a3482f91cd7330b0338a4d0187c75f77bea",
      "session": "session_01WGufziBCAytAzzCu3iPBFR",
      "Dev-effort": "medium",
      "Rounds": 1,
      "premise_still_valid": true,
      "summary": "Added StudioDetailHeader, a thin composite over StudioItemHeader's slots: x (back to list) in leading, type and source-package chips as identity chips, the status chip, and in actions the prev/next pager with 'index / total', a primary-button slot and a ... menu (page items plus StudioItemHeaderFoldedItems). The prev/next interface is a plain prop (sequence {names, current} + onOpenItem); the exported pure detailSequence computes index/total/previous/next with no wrap and no position for a name outside the list. x, Esc and prev/next all go through confirmUnsavedLeave (browser Back not intercepted); Esc defers to Radix layers (defaultPrevented), text fields and modifiers. Narrow widths reuse StudioItemHeader's fold unchanged (chips to ..., then the position text via data-studio-fold-label, title cut last). Placed in a new sibling folder views/studio-detail/ (allowed by the claim) so nothing is added under studio-design/**; StudioItemHeader.tsx, StudioDesignSurface.tsx and unsavedEdits.ts untouched; wired into no page. en+zh strings engine.studio.detailHeader.* added to the studio namespace.",
      "tests": "head 7a4b4a348: vitest (lock, --root ../..) packages/app-shell/src/views/studio-detail/ + packages/i18n/src/namespaces/studio/ + packages/i18n/src/__tests__/ -> 'Test Files 110 passed (110) / Tests 2038 passed | 13 skipped', VERDICT command-exit 0; StudioDetailHeader.test.tsx alone 24/24 (index math, first/last disabled, leave guard Cancel/OK/none, Esc paths incl. open menu and text field, tab order, stubbed narrow fold 900/560/380 and resize both ways). Playwright test page e2e/studio-detail-header-width.spec.ts run locally via a scratch chromium-only config (deleted after): 3 passed; readings 1024px nothing folded, all boxes inside row; 360px chips folded, fold=labels, controls inside row, documentOverflowX 0. No ablation: new code only, no changed tested behaviour.",
      "gates": "local: pnpm --filter @object-ui/app-shell run type-check exit 0 (src + tsconfig.test.json); pnpm --dir ui type-check:e2e exit 0; ui check:i18n-keys 0, check:i18n-drift 0, check:i18n-dead-keys 0; eslint --no-inline-config new files 0 errors 1 warning (react-refresh/only-export-components on exported detailSequence). dispatch-gates --commands derived 38 families: 37 exit 0 on tree d1fa7d45; 'pnpm --dir ui exec vitest run scripts/' exit 1 (e2e-type-check.test.ts 'imports no workspace package' -- my test page imported @object-ui/components), fixed in 7a4b4a348 (import by source path), that file re-run 15/15 green; full scripts/ suite otherwise 5126 passed. --ran reconciliation exit 0: 38/38 accounted (exit codes kept in scratch log, not in the --ran record). node scripts/pm/overlap-check.mjs on final head: VERDICT clean exit 0. CI: PR check-runs at report time 22 total, 5 completed, 17 in_progress, 0 failures; mergeable_state blocked (draft/checks pending), not dirty.",
      "dogfood_battery": "n/a -- no '!' in the PR title and no (narrowing) arm",
      "line_budget": "+1068/-0 over 6 files (component 305, unit test 424, test page 313, en/zh 8+8, changeset 10); far under 3000, no governed path",
      "files_changed": [
        "ui/packages/app-shell/src/views/studio-detail/StudioDetailHeader.tsx",
        "ui/packages/app-shell/src/views/studio-detail/StudioDetailHeader.test.tsx",
        "ui/e2e/studio-detail-header-width.spec.ts",
        "ui/packages/i18n/src/namespaces/studio/en.ts",
        "ui/packages/i18n/src/namespaces/studio/zh.ts",
        ".changeset/36892-studio-detail-header.md"
      ],
      "deviations": [
        "The first WIP push (9243239f) went out in the same command after overlap-check answered PREREQUISITE NOT MET (shallow history); I deepened (fetch --deepen=1500) and re-ran: clean against main and the 3 PRs sharing the studio en/zh files (#36888, #36884, #36784). Every later push followed a clean verdict.",
        "Test page lives at ui/e2e/ (a Playwright geometry spec) since the repo has no Storybook; the claim's file surface says 'a story/test page' without a path."
      ],
      "mcp_calls": "0",
      "api_writes": "2 -- fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/36924/assignees os-support-ai), post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/36892/comments); git push not counted",
      "open_questions": [
        {
          "question": "Clause-2 for new keys in the studio i18n namespace: the claim says 'no' and I copied it; a sibling changeset (34463-composer-oversize-notice) declared 'yes (widening)' for new locale-pack keys published by @object-ui/i18n.",
          "options": ["A keep 'no' -- the studio namespace is the designer's internal catalogue, not a contract surface", "B change PR body and changeset to 'yes (widening)'"],
          "recommendation": "A, because the claim records it and the keys add no authorable or API surface; the seat confirms at L1"
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  7. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

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

    Close-out · 2026-11-24T09:59Z · PR #36924 merged as 00dd362 (L1 ACCEPT 7127659414, landing 7127687940 + correction 7127705279). Card closed by Fixes; pm:dispatched removed. StudioDetailHeader (ui/packages/app-shell/src/views/studio-detail/) is ready for the wiring cards #36901 / #36903 / #36904 / #36905. Carry-forward from L1 N2: its Esc listener is document-wide and skips defaultPrevented events, so a wiring card that mounts a non-Radix overlay checks that Esc closes the overlay first.

  8. removed
    pm:dispatched
    on Nov 24, 2026
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