Skip to content

feat(console): one Studio detail header composite (×, package, ‹ › with position, ⋯, primary) - #36924

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36892-studio-detail-header
Nov 24, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36892-studio-detail-header

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

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

Fixes #36892
Part of #36890
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:这次只做出 Studio 全屏详情共用的头部零件,还没有放进任何页面。
  • 属于「Studio 重构」大卡,替后面四张接入卡(对象、流程、通用详情等全屏详情页)先定下头部和「上一个/下一个」的接口。
  • 出错也碰不到用户,因为没有页面用它;可以直接撤回。
  • 无。

What changes

  • New StudioDetailHeader (ui/packages/app-shell/src/views/studio-detail/StudioDetailHeader.tsx): a thin composite over StudioItemHeader's slots. × (back to the list) in leading; the type and the source package as identity chips after the label and api name; the status as the header's status chip; in actions, ‹ › with "index / total", the page's primary button (a slot), and ⋯ (the page's own menu items, with the folded chips above them via StudioItemHeaderFoldedItems). No switcher dropdown, no "open in app" (epic decision 7).
  • The ‹ › data interface is a plain prop: sequence={{ names, current }} plus onOpenItem(name). detailSequence(names, current) (exported, pure) computes the 1-based index, total, previous and next; the ends do not wrap; a name the list does not hold has no position and both steps are off. The order itself comes later from the list card (decision 10: filter and sort in the detail address, by name without list context).
  • × , Esc and ‹ › all go through the existing leave-guard seam confirmUnsavedLeave in chrome/unsavedEdits.ts; browser Back is not intercepted (decision 12). Esc is ignored when a menu or dialog already handled it (Radix marks it defaultPrevented), when it is aimed at a text field, or with a modifier; closeOnEscape={false} turns it off.
  • Narrow widths reuse StudioItemHeader's rules unchanged: the identity chips (api name, type, package) fold into ⋯ first; the position text carries data-studio-fold-label / STUDIO_FOLD_LABEL so it leaves the row at the second stage while ‹ › stay; the title is cut last. The composite does no measuring of its own.
  • Strings: engine.studio.detailHeader.* (close, previous, next, position, notInList, package, more) in the studio namespace, en + zh.
  • Not wired into any page (later cards do that). StudioItemHeader.tsx, StudioDesignSurface.tsx and unsavedEdits.ts are read, not edited. Placement: a new sibling folder views/studio-detail/ rather than studio-design/, so this PR adds nothing under the studio-design/** surface another open card holds.

Tests

  • StudioDetailHeader.test.tsx (24 tests): index math (middle, first, last, lone, outside the list, empty list); first/last disabled; ‹ › open the neighbours; the leave guard on × and › (Cancel keeps the page, OK leaves, nothing unsaved means no prompt); Esc triggers × (through the guard), not from a text field, not while ⋯ is open (that Esc closes the menu, the next one closes the page), not with closeOnEscape off or a modifier; ×, ‹, › are native buttons in tab order; the narrow-row fold at stubbed widths (wide 900 px nothing folds; 560 px chips fold into ⋯; 380 px the position label folds too; it follows resizes both ways; without menu items the header draws its own ⋯ only while folded).
  • Test page ui/e2e/studio-detail-header-width.spec.ts: the real component and real Tailwind in Chromium at a 1024 px row (everything whole, nothing folded, every box inside the row) and a 360 px row (chips folded into ⋯, position text out, both fold stages taken, ×, ‹, ›, ⋯ inside the row, no overflow), plus keyboard: Tab from ‹ reaches ›, Enter steps, Esc triggers ×.
Readings (head 7a4b4a3)
  • vitest run 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 (lock VERDICT command-exit 0).
  • Playwright (local scratch config, chromium only, no webServer): 3 passed. Readings: 1024 px {"title":{"width":205.88,"clipped":false},"inRow":{"type":true,"package":true,"apiName":true},"positionShown":true,"fold":null,"childrenInsideRow":true,"controlsInsideRow":true,"documentOverflowX":0}; 360 px {"title":{"width":43.92,"clipped":true},"inRow":{"type":false,"package":false,"apiName":false},"positionShown":false,"fold":"labels","childrenInsideRow":true,"controlsInsideRow":true,"documentOverflowX":0}.
  • pnpm --filter @object-ui/app-shell run type-check: exit 0 (both programs, the test one included). pnpm --dir ui type-check:e2e: exit 0.
  • ui i18n: check:i18n-keys exit 0, check:i18n-drift exit 0, check:i18n-dead-keys exit 0 (no detailHeader key reported).
  • eslint (--no-inline-config) on the new files: 0 errors, 1 warning (react-refresh/only-export-components for the exported pure detailSequence, the same shape StudioItemHeader.tsx already has).
  • Derived gate families (dispatch-gates.mjs --commands, 38): all exit 0 on the final tree except pnpm --dir ui exec vitest run scripts/, which failed once on e2e-type-check.test.ts "imports no workspace package" (the test page imported @object-ui/components); fixed in 7a4b4a3 by importing it by source path, and that file re-run green (15/15). --ran reconciliation: 38 of 38 accounted.

Acceptance notes

  • The test page is a Playwright spec (the repo has no Storybook); it measures geometry, so it follows e2e/studio-item-header-title-width.spec.ts's bundling.
  • Esc is not advertised in the keyboard-shortcuts dialog: the composite is mounted nowhere yet, and advertising belongs beside the handler once a page mounts it (the wiring cards).
  • The changeset declares Clause-②: no as the claim says; a sibling i18n-only changeset declared yes (widening) for added keys, so the seat may want to confirm which reading applies to new keys in the studio namespace.
  • At a 360 px row the title is cut (about 44 px in this container's fallback font) after both fold stages: that is StudioItemHeader's existing last step, not new behaviour.

Verification

Files to read first: StudioDetailHeader.tsx (the Esc listener and the ⋯ / foldMenu choice are the risk hunks), then StudioDetailHeader.test.tsx's narrow-width block.

Two-minute check: pnpm --filter @object-ui/app-shell exec vitest run --root ../.. packages/app-shell/src/views/studio-detail/ and expect 24 passed.

Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR

🤖 Generated with Claude Code

@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对 — ACCEPT · repo:objectstack#3 · head 7a4b4a3 · 2026-11-24T09:36Z

L1: ACCEPT
Head-sha: 7a4b4a3482f91cd7330b0338a4d0187c75f77bea
Reviewer: L1-b (seat 3, area ux-E). Contract review: not owed. No path face (record-recognisers --paths decides none), and Clause-②: no stands (see the open question below).

Read

Checklist

  • Shape. Draft, base main, Fixes #36892, plus Part of #36890, which is not a closing keyword.
  • Scope. A new header file and its test in a new sibling folder views/studio-detail/ (the claim allows "a new sibling folder"), the studio strings in ui/packages/i18n/**, a changeset, and the test page at ui/e2e/studio-detail-header-width.spec.ts. The claim says "a story/test page" without a path, the repo has no Storybook, and the dev names this as a deviation. StudioItemHeader.tsx, StudioDesignSurface.tsx and unsavedEdits.ts are not in the diff.
  • Changeset. @object-ui/i18n patch for the new keys, the only published package moved. @object-ui/app-shell is private and inert (N1). Read sentence by sentence: each sentence is true of the diff, including "no page shows it yet".
  • Against the card and the epic.
    • × in leading; type and package chips; status chip; in actions, ‹ › with "index / total", a primary slot and ⋯. No switcher and no "open in app" (decision 7).
    • detailSequence(names, current) is pure: 1-based index, no wrap, no position for a name outside the list. The order comes from the list card (decision 10).
    • ×, Esc and ‹ › all go through confirmUnsavedLeave; browser Back is not intercepted (decision 12).
    • The Esc listener on document skips defaultPrevented events (Radix layers mark the Esc they consume), typing targets and modified keys, and closeOnEscape={false} turns it off. The latest close is read through a ref, so the listener is not re-bound on every render.
    • Narrow widths reuse StudioItemHeader's fold through STUDIO_FOLD_LABEL and StudioItemHeaderFoldedItems, with no measuring of its own.
  • Strings. All seven engine.studio.detailHeader.* keys carry en and zh. The zh reads naturally (「关闭并返回列表」「第 {index} 项,共 {total} 项」「来自包 {package}」).
  • Tests. 24 unit tests covering index math, ends disabled, the leave guard on Cancel / OK / nothing unsaved, the Esc paths, tab order and the fold at stubbed widths. The Playwright page measures a 1024 px and a 360 px row in real Chromium, with JSON readings in the body. The local reading was green (110 files / 2038 tests). Test UI and Build & E2E UI are success on the head. No ablation is owed: this is new code only.
  • Card acceptance. (1) Unit tests plus a test page covering wide and narrow: met. (2) StudioItemHeader.tsx not changed, and no public surface beyond the product-named widget: met. detailSequence and its type are file exports inside the private app-shell, not a package export.

Open question from the dev (Clause-② for new studio namespace keys)

Option A, keep Clause-②: no, is acceptable here. The house record is split: on studio/en.ts in the last two weeks, 3f568c1 and 21881ed declared no and ff0d1f1 declared yes (widening). The studio namespace is the designer's own catalogue and adds no authorable or API surface. yes (widening) would also have been accepted, and it would have owed a TIER_DEFAULT declaration read. If the seat wants one reading for all areas, that belongs in the order file, not in this PR.

Findings

No must-fix, no should-fix.

  • N1 (nit). The changeset does not name @object-ui/app-shell. The package is private, so the line is inert, but areas name it by convention (for example fix(spec): the dashboard settings hints read in business terms #36883). Leave it.
  • N2 (nit). The Esc listener is document-wide. A future page that mounts a non-Radix overlay which does not preventDefault its own Esc would also close the item. That belongs to the wiring cards (2-1, 3-1 to 3-3), which also own advertising Esc in the shortcuts dialog, as the body says.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing · 2026-11-24T09:37Z · ACCEPT 7127659414 at head 7a4b4a3

reading value
check-governed-merges.mjs --pr 36924 NOT governed · +1068/−0 (1068 ≤ 3000; card total 1068, one PR)
landing-k.mjs --pr 36924 CAN'T ANSWER (UI-only head, no Test Core planner ran in run 45363000815); K read via merge-base instead: base 151e812, main ahead by 5 (to 4f19091), none touching ui/packages/app-shell/src/views/studio-detail/, ui/packages/i18n/src/namespaces/studio/ or ui/e2e/studio-detail-header-width.spec.ts ⇒ K = 5 < 15
contract review none owed: Clause-②: no (L1 accepted option A on the studio-namespace keys), Metadata-protocol: none, no path face (L1 7127659414)
checks at 7a4b4a3 45 success, 13 expected skip, 0 failed, 0 pending; mergeable clean

Open findings: nits only (L1 N1 changeset naming the private app-shell; N2 the document-wide Esc listener, for the wiring cards #36901/#36903/#36904/#36905 to watch with non-Radix overlays). N2 goes to the seat's report. State: ready + auto-merge (Tier S). On MERGED, #36892 closes by Fixes; area ux-E removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 24, 2026 09:38
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 24, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing correction to 7127687940 (the K row): the main commits ahead of base 151e812 DO touch ui/packages/i18n/src/namespaces/studio/en.ts and zh.ts (3f568c1), which this PR also edits. K stays 5 < 15. GitHub reads the PR mergeable/clean against current main, and the merge queue re-runs the full farm on the merged tree, so the landing stands; the "none touching" wording was wrong.

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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants