Skip to content

refactor(app-shell): split StudioDesignSurface.tsx by responsibility - #37719

Merged
os-zhuang merged 12 commits into
mainfrom
claude/issue-37553-split-studio-design-surface
Nov 27, 2026
Merged

os-zhuang merged 12 commits into
mainfrom
claude/issue-37553-split-studio-design-surface

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#5 · os-bill · session_01Utp6CbL6Nn3scsU8yvLyU4
Fixes #37553
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:没有变化,Studio 的每个页面、按钮、文案和地址都和合并前一样;这是工程内部的拆文件,用户无感。
  • 为什么做:属于 App Studio 改版第一阶段的收尾,Studio 主框架这个一千五百多行的大文件被拆成八个按职责划分的小文件,第二阶段改界面时几张卡不必再排队改同一个文件。
  • 出错会怎样:如果拆的时候漏接了某条线,Studio 的发布、保存、右侧栏或页面切换会出问题;整个改动只是搬代码,可以直接撤回。
  • 要你做什么:本次改动超过三千行(搬移的代码两头都算),按规则合并前需要你批准一次。

What changes

ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx goes from 1,550 lines (at e491fce2c7) to 383. It keeps its exports, its props and its default export, and now only composes: it calls the hooks below in the order their lines stood, then draws the frame with the page inside it.

Module Lines Owns
studioSurfaceScope.ts 338 The scope: the route segment read as a package, ~org or ~all; the package-list facts (writable, name, missing, a read-only base's facts and its .custom pair); the base's customization; the package's apps
studioSurfaceSave.ts 75 The save-entry plumbing: the dirty-pillar, held-edit and Save-bar bits, the one departure question, the tab-close prompt, the unsaved-edits registration
studioSurfaceDrafts.tsx 203 The drafts state: the Pending changes sheet and its ?changes=review door, the publish and draft-save nonces, the pending ledger behind the badges and the Pending tab, the refusals a publish keeps on its entries
studioSurfacePublish.ts 338 The publish every door runs (batch door, or flow by flow in ~org), its toasts and the backfill receipt
studioSurfaceRightSlot.tsx 225 The right slot and the assistant: the host gate, open and mode state, the shortcut, the title row's assistant control, the slot element with the copilot
studioSurfaceNavigation.tsx 164 The retired-Interfaces landing latch, the host side of ?surface=, the menu re-entry, the command palette's Studio scope
StudioSurfaceFrame.tsx 270 The frame: the providers, the two columns (the menu mount with its top rows, the pillars host), the strips, the slot mount, the review sheet, the palette. Stateless; the page is children
StudioSurfacePage.tsx 215 The page beside the menu: the All metadata area, 概览 Overview with its Pending tab, the sharing overview, the not-found states. Stateless

Every module is under 400 lines.

How it was cut. Eight move commits, one per module, each a verbatim move of a contiguous block into a hook or a component with the body calling it where the block stood. No rename. Two follow-up commits, kept apart from the moves: one lists five useState setters in the dependency arrays of the moved callbacks that now receive them across a module boundary (onPackageChanged, onPackageRenamed, onDraftSaved, requestSurface, doPublish), and one adds a map of the split to the surface's header comment.

What stays the same, and why it holds.

  • Hook and effect order. The hooks are called in the order their lines stood, so every effect, subscription and fetch starts in the same order as before. The one reordering is among a useRef and five useCallback / useMemo calls (the publish now follows the ledger's callbacks), which run no effect.
  • The rendered tree. StudioSurfaceFrame and StudioSurfacePage hold no hooks and no state. They add two component layers with constant types, so nothing remounts, and every keyed element (key={packageId}, key={scopeSegment}) keeps its key under the same parent. The DOM is the same.
  • The dependency-array commit. A useState setter's identity never changes, so adding one to a dependency list re-creates no callback. Without it, react-hooks/exhaustive-deps adds five new warnings, because it cannot see that a setter passed from another module is stable. With it, the files carry the warnings the original carried.

Tests. No test file is edited, added or deleted. No test is added or deleted. Two source-reading tests gain list entries only (patch round, below); no assertion changes. No vi.mock needed re-pointing: the new modules import the same module paths the surface imported, so every path mock still applies, and nothing mocked the surface itself.

Read first (riskiest first)

  1. studioSurfacePublish.ts, useStudioPublishAction: the 220-line publish moved whole. The risk is the parameter list, since every state setter and value it closed over is now passed in.
  2. StudioDesignSurface.tsx, the body of StudioDesignSurfaceBody: the hook call order is what keeps the effect order. Compare it with the order of the blocks in the base file.
  3. StudioSurfaceFrame.tsx: the JSX is verbatim. The page went to {children}, the right slot to {rightSlot}.

Tests

All of these ran at head 6a7446c9a4, the final commit, through the shared verification lock.

  • The full app-shell suite, green. pnpm --filter @object-ui/app-shell test --maxWorkers=2 ran 2,456 files passed, 1 skipped (2,457) and 23,816 tests passed, 9 skipped. The skips were already there: no test file is touched this run, at 6a7446c9a4, was before the patch round, and no test file had been touched yet.
  • The type-check, green. pnpm --filter @object-ui/app-shell type-check is both programs, tsc --noEmit and tsc -p tsconfig.test.json. I also checked that the program sees the new modules: a stray prop added to StudioSurfaceFrame.tsx was reported as TS2339, and the file was then restored from HEAD.
  • Lint. eslint on the nine files gives 0 errors and 8 warnings with --no-inline-config: 2 exhaustive-deps, 1 only-export-components and 5 set-state-in-effect. Those are the same kinds and counts the base file gives over the same code. With inline config on, 0 errors: no eslint-disable went stale.
Suite and type-check verdict lines
 Test Files  2456 passed | 1 skipped (2457)
      Tests  23816 passed | 9 skipped (23825)
   Duration  4086.36s (transform 134.06s, setup 1366.79s, import 4388.78s, tests 1699.02s, environment 323.02s)
os-verify-lock: VERDICT command-exit 0 · held the lock 4088s (1h08m08s) · waited 0s
> NODE_OPTIONS=--max-old-space-size=4096 tsc --noEmit && NODE_OPTIONS=--max-old-space-size=8192 tsc -p tsconfig.test.json
os-verify-lock: VERDICT command-exit 0 · held the lock 111s (1m51s) · waited 0s
Derived gate families (dispatch-gates, 21 derived, 21 run, all exit 0)
node scripts/check-closing-keyword-parity.mjs (+ --self-test) :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-sdui-manifest.mjs (+ --self-test) :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:adr-anchors · check:dispatcher-error-vocabulary · check:driver-memory-census · check:gitlink-declared :: exit 0
pnpm check:nul-bytes · check:published-files · check:refd-timer-probe · check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared · check:skill-identifier-liveness · check:test-source-alias :: exit 0
pnpm check:tier-file-adoption · check:undeclared-dep-imports · check:watch-hint-literal :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0  (Test Files 172 passed | 2 skipped (174); Tests 5130 passed | 2 skipped)
dispatch-gates --ran: 21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED (a DERIVED zero)
node scripts/check-platform-checklist.mjs --changed-from origin/main :: exit 0 (no anchored file in the change set)

Console E2E: not run locally. It needs a built Console, and the live specs also need a running backend, which is more than this shared container carries next to the suite. CI's Build & E2E UI and Live E2E UI jobs give the verdict. The specs that drive this surface are ui/e2e/live/studio-editor.spec.ts, studio-object-designer.spec.ts, studio-customize-journey.spec.ts and studio-detail-save-at-once.spec.ts. The three ui/e2e/studio-*.spec.ts specs read other files (StudioItemHeader.tsx, StudioMenu.tsx, StudioDetailHeader.tsx), and this change does not touch them.

Acceptance notes

  • The change is over the 3,000-line mark (+2,028 / −1,367 = 3,395, the move counted on both sides). AGENTS.md multi-agent discipline §7 (c) applies: it lands on an authorized approval or by the maintainer's merge.

  • Two source-reading tests have file lists that the moved bodies are not on. I left both alone because they are outside this card's file fence. homeRecoveryRedirectsFollowDeclaration-7373.test.ts (alsoReads for the Studio site) and ui/scripts/__tests__/spec-symbol-ledger-app-shell-7265.test.ts (SITES) each read StudioDesignSurface.tsx plus the modules earlier move-only splits cut out of it. The second file's header records the ruling that "a moved body stays in the reading list". Both stay green, because the moved code holds no launcher literal and no spec-named declaration. But until the eight new paths are added, neither test reads the moved code. That is two list additions with no change to any assertion, for whoever owns those files.

  • The base file had a stale comment on its imports (objectui#11773, objectstack#26858) above an import that no longer matched it. It stays where it was.

  • A comment block on the import of the draft-envelope reader moved with that import into studioSurfacePublish.ts.

  • Patch round (claim amendment 7205603061, which widened the fence to two source-reading tests for list additions only). Commit 9828b29963 adds the eight new studio-design/ module paths to alsoReads for the Studio site in homeRecoveryRedirectsFollowDeclaration-7373.test.ts, and to SITES in ui/scripts/__tests__/spec-symbol-ledger-app-shell-7265.test.ts. That is +16 / −0, and no assertion changed. Both tests pass (2 files, 49 tests).

    • Ablation via scripts/ablation-replace.mjs, with each restore checked against HEAD. A launcher literal injected into studioSurfaceNavigation.tsx turns the Studio site's "does not hard-code the launcher path" case red; with that path also dropped from alsoReads, the file is green (15/15). A local type AppLike injected into studioSurfacePublish.ts turns its rule-1 case red; with that path dropped from SITES, the file is green (33/33). Each list entry is what brings the moved code under the scan.
    • origin/main was merged once (fd1a2e0900). There was no conflict and nothing under studio-design/ changed.

Verification

Two-minute check: git diff e491fce2c7 HEAD --color-moved=zebra -- ui/packages/app-shell/src/views/studio-design/ shows almost every removed line coming back as a moved line. The lines that do not are imports, the export keyword on two helpers, the five dependency arrays, and the four wrapper lines where a JSX expression became a return or a const.

How much of the split is a verbatim move

A script compared every line of the base file (trimmed) with the nine files after the split. Every original line outside the import blocks reappears verbatim, with seven exceptions, each on purpose:

  • publishRefusalKey and NO_PUBLISH_REFUSALS gain export.
  • Three dependency arrays gain a setter (the commit kept apart from the moves). Two more did too, but their old spelling, }, []);, occurs elsewhere in the file, so the script cannot flag it.
  • The keyed-pillars JSX comment lost its braces when it became a block comment above return.
  • {allScope ? ( became return allScope ? (.
  • {slotHost && ( became const rightSlot = slotHost && (.

Of the 2,211 lines after the split, 1,612 match an original line. The rest are imports, module headers, hook signatures, return objects, and the props the frame and the page receive.


Generated by Claude Code

…udioSurfaceScope.ts

Move-only: the route segment's scope, the package-list facts, the base's
customization and the package's apps leave StudioDesignSurface.tsx
verbatim inside four hooks the body calls in the same order.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
… studioSurfaceSave.ts

Move-only: the unsaved-work state, the departure question, the tab-close
prompt and the unsaved-edits registration leave StudioDesignSurface.tsx
verbatim inside one hook called where they stood.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…SurfaceDrafts.tsx

Move-only: the Pending changes sheet and its ?changes= door, the publish
and draft-save nonces, the pending-drafts ledger behind the badges and
the kept publish refusals leave StudioDesignSurface.tsx verbatim inside
two hooks called where the first of their lines stood.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…cePublish.ts

Move-only: the backfill receipt's formatter and the one publish every
door runs leave StudioDesignSurface.tsx verbatim inside one hook called
where the publish stood.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…rfaceRightSlot.tsx

Move-only: the slot's host gate, its open and mode state, the shortcut,
the title row's assistant control and the slot element with its copilot
leave StudioDesignSurface.tsx verbatim inside one hook called where the
slot state stood; the frame mounts the element where it was drawn.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…rfaceNavigation.tsx

Move-only: the retired-Interfaces landing notice's latch, the host side
of the ?surface= channel, the menu re-entry and the command palette's
Studio scope leave StudioDesignSurface.tsx verbatim inside two hooks
called where they stood.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…rfacePage.tsx

Move-only: the route switch the pillars host draws (the All metadata
area, Overview with its Pending tab, the sharing overview and the
not-found states) leaves StudioDesignSurface.tsx verbatim, re-indented,
as a stateless component the host mounts where the switch stood.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…Frame.tsx

Move-only: the providers, the two columns with the menu mount and the
pillars host, the strips, the right slot's mount, the review sheet and
the command palette leave StudioDesignSurface.tsx verbatim as a
stateless component; the page is its children.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
…dependencies

The split hands five useState setters across a module boundary, where
react-hooks/exhaustive-deps can no longer see they are stable. Naming
them keeps the lint at the original file's warnings; a setter's
identity never changes, so no callback is re-created.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 26, 2026
…g lists

The split moved the surface's code into eight sibling modules; the two
source-reading tests that read the surface and the modules earlier
move-only splits cut out of it now read these eight too. List
additions only, no assertion changed.

Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbL6Nn3scsU8yvLyU4

Final green head for L1/L2 (2026-11-27T00:04Z): fd1a2e0900597a676e7b1116b00362d2444ecef2. CI on this head: 52 check-runs, 38 success, 14 skipped (opt-in, path or event selectors), 0 failed, no re-run. The os-dev reports are 7205586297 (build) and 7206092271 (patch round) on #37553.

Area notes:

  1. Pure refactor. StudioDesignSurface.tsx goes from 1,550 lines to 383 and keeps its exports, props and default export. The rest moves into eight sibling modules, each under 400 lines; the table is in the body. The code moves in eight move-only commits, then two follow-ups: five stable useState setters join moved dependency arrays, which keeps the eslint warnings equal to the base file's, and the surface's header comment maps the split. Hooks are called in their original order.
  2. Tests. No test file is touched except the two source-reading lists, which take list additions only under claim amendment 7205603061; both are ablated load-bearing. No vi.mock needed re-pointing. The full app-shell suite ran locally at 6a7446c9a4 (2456 files passed, 1 skipped). On the merge head: studio-design plus the list tests (288 files, 2413 tests), type-check, and CI Test UI, Build & E2E UI and Live E2E UI all succeeded.
  3. Size: +2,044 / −1,367, which is over 3,000 lines (AGENTS.md §7(c)). Seat L2 first, then the maintainer's merge. The PR stays a draft until then.
  4. Out of scope, not filed: a stale import comment (objectui#11773, objectstack#26858) carried over from the base file.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head fd1a2e0 · 2026-11-27T00:05Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: fd1a2e0900597a676e7b1116b00362d2444ecef2
Local-runs: none

Read: card #37553 with all 5 comments (triage, claim, two os-dev reports, and claim amendment 7205603061), PR #37719 (its body and its 11-file list), the net diff origin/main...pr-37719-a, and the check-runs on the head. The base text is git show f722411edd:ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx, 1,550 lines. Nothing under studio-design/ differs between that base and e491fce2c7, the base the dev cut from, or between it and current origin/main.

Check-runs on the head: none failed. All eleven required contexts succeeded except Build Core, which is skipped, its normal shape on this PR event. Test UI passed: the plan started 10 of the 16 slots, and every slot it started succeeded. Check Changeset was skipped because the PR carries the skip-changeset label.

① Derived judgments

  • Accept sets: none moved. Right. The diff touches no spec, schema, route, validator or server code. It is UI composition inside @object-ui/app-shell plus two test reading lists.

  • The moved code is unchanged. Right. I diffed each of the nine files against the base text with a block-sequence diff. Every non-import base line comes back verbatim, except for these changes:

    • export was added to publishRefusalKey and NO_PUBLISH_REFUSALS, which moved to studioSurfaceDrafts.tsx so that studioSurfacePublish.ts can import them.
    • Five dependency arrays gained raw useState setters (commit ed100ee): onPackageChanged, onPackageRenamed, onDraftSaved, requestSurface and doPublish. A setter's identity is stable, so no callback or memo changes identity.
    • The keyed-page JSX comment became a block comment, and {allScope ? ( became return allScope ? (.
    • {slotHost && ( became const rightSlot = slotHost && (, rendered as {rightSlot} in the same place.
    • The page's place in the pillars host is now {children}.
    • The rest is new: hook signatures, return objects, the frame and page prop lists, and module headers.

    The set of imported module specifiers is the same before and after, plus the eight new sibling modules, so no side-effect import was lost.

  • Hook and effect order is preserved. Right. These are the effects and layout effects in call order. Every one keeps its base order:

    1. The landing-state latch (2 effects).
    2. The package-list fetch.
    3. beforeunload, then useRegisterUnsavedEdits.
    4. ?changes=.
    5. The customization read.
    6. usePendingDrafts, then the refresh effect, then the refreshPendingRef layout effect.
    7. The openAccessRef assignment.
    8. The package-app resolve and its subscription.
    9. useIsMobile, then the setSlotOpenRef layout effect, then the ⌘. listener.
    10. The palette-mounted read, then useStudioAccentOnBody.

    One thing moved: a useRef (openAccessRef) and the doPublish callback now follow the ledger's four callbacks and memos. None of these runs an effect, so nothing observable changes. No hook is called conditionally, and no module returns early before a hook.

  • Context providers and the rendered tree are unchanged. Right. StudioSurfaceFrame.tsx and StudioSurfacePage.tsx call no hooks, so no hook now reads context from below a provider it used to sit above. The provider nesting, from StudioMenuDataProvider down to the CommandPaletteProvider wrap, is the base JSX verbatim. The two new component layers have constant types. Every keyed element (key={packageId}, key={scopeSegment}) is still reconciled as the single root under the same host, so nothing remounts that did not remount before. rightSlot is built during the body's render and reads the same window.innerWidth, slotOpen and isMobile values in the same pass.

  • The published surface is unchanged. Right. The export lines of StudioDesignSurface.tsx match the base exactly: StudioDesignSurface, StudioDesignSurfaceProps (text identical), the default export, and the re-exports StudioHeldNotice, StudioReadOnlyLink, StudioBaseCustomization, StudioRefusalStrip, NewFlowTrigger, AutomationsPillar, DataPillar and renderStudioGridList. The package index still re-exports only StudioDesignSurface. The new modules and their exports are not on the index, and @object-ui/app-shell is private: true.

  • The module split is coherent. Right. There is no import cycle. StudioDesignSurface.tsx imports all eight modules. Of those, only studioSurfacePublish.ts makes a value import from a sibling (studioSurfaceDrafts.tsx). The frame and the page import the hook modules with import type only. No module imports StudioDesignSurface.tsx. Every file is under 400 lines, the largest being 338.

② Semver level

skip-changeset is right. The diff publishes no behaviour, prop, export or copy change from any package. @object-ui/app-shell is private, and the console bundle it ships in sees an identical surface.

Clause-②: no

The PR body and the claim both declare it, along with Metadata-protocol: none, and both are correct: no accept set and nothing a metadata author can write moved.

③ Boundary flags

  • Dev open question 1 (the two reading lists): answered. The seat took option A and widened the fence (amendment 7205603061). Commit 9828b29 is +16/−0 and only appends the eight new paths: to alsoReads in homeRecoveryRedirectsFollowDeclaration-7373.test.ts and to SITES in spec-symbol-ledger-app-shell-7265.test.ts. No assertion, regex, control or ceiling changed, so nothing is weakened. The launcher-literal scan and the rule-1 scan now read the moved code. The positive useHomePath() match is not made easier, because none of the new files contains it.
  • Dev open question 2 (PR body text): answered. The patch-round paragraph is in the body's Acceptance notes as asked. See N1 for the older lines it now contradicts.
  • Test files beyond the two lists: none. The diff changes no other test file. The folder-walking guards (noRetiredSetupLink-28578, noSetupMetadataLink-28578, studioAddress.guard) already read the new files, because they walk studio-design/.
  • AGENTS.md §7(c), the size flag: holds. The change is 2,044 + 1,367 = 3,411 changed lines. It lands only on an authorized APPROVED review and then the owning seat, or by the maintainer's merge. This record does not replace that. The PR is also still a draft.
  • Out-of-scope note (stale import comment): stands as filed. The objectui#11773 / objectstack#26858 comment was already stale in the base and is left in place.
  • SQL push-down: no finding. The diff adds no id materialisation and no in-app join. The client-side filters (isOrgScopeDraft) and the per-draft publishDraft loop in the package-less scope are base code moved verbatim, over a REST client, with no SQL layer in reach.
  • Findings:
    • N1 (nit): the PR body says "No test file is edited, added or deleted" twice (What changes → Tests, and Tests), and an Acceptance note leaves the two reading lists "for whoever owns those files". Commit 9828b29 later edited both lists. The seat should strike these lines at its next body edit.
    • N2 (nit): two moved comments still point "above" or "below" across what is now a module boundary. In studioSurfacePublish.ts, openAccessRef is "set once the router's navigate is in hand below", but it is set in StudioDesignSurface.tsx. In StudioDesignSurface.tsx, "the nonce's effect above" now lives in studioSurfaceDrafts.tsx.
    • N3 (nit): docs/qa/platform-checklist/areas/studio-authoring.json steps[3] still cites StudioDesignSurface.tsx for the publish toast's Open Access action, which is now in studioSurfacePublish.ts. It is a plain path, not a #symbol anchor, so check-platform-checklist does not judge it. It is outside this claim's fence. Re-point it in a follow-up, as revision 12 did for [maintainer] refactor(app-shell): split StudioDesignSurface.tsx (12,882 lines) along its component seams, one move-only slice per PR #29988.

Implemented-by: claude/issue-37553-split-studio-design-surface
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

席位意见:ACCEPT。干净的纯重构,只剩 3 个 nit。

席位核对

Head-sha: fd1a2e0900597a676e7b1116b00362d2444ecef2
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: draft against main. 11 files, +2044/−1367 (3411 changed lines, over the 3000 human-merge line). No governed path. Not security-touching. skip-changeset, Clause-②: no, Metadata-protocol: none: right. @object-ui/app-shell is private, and its index still re-exports only StudioDesignSurface, with unchanged props and default export.

  2. Premise: a block-sequence diff against the base file finds every non-import line verbatim, apart from these shell changes:

    • two added exports;
    • raw useState setters added to five dependency arrays (their identity never changes);
    • three wrapper rewrites.

    Effects and layout effects keep their order. No hook is conditional, the provider nesting is verbatim, and there are no import cycles. The two fence-widened tests only add the eight paths to their lists, and no other test changed.

  3. Gates: contract record 7206275783 (TIER_DEFAULT, declaration face) reads PASS, with no must-fix or should-fix. CI on this head: 38 success, 14 skipped, 0 failed.

  4. Accepted deviations:

    • N1: the PR body still says that no test file is edited. Strike those lines at the next body edit; it does not move the head.
    • N2: two moved comments still say "above" or "below" across what is now a module boundary.
  5. Out of scope and where it went: N3. The studio-authoring.json checklist step still cites the old file for the publish toast's Open Access action. The area files a follow-up card under App Studio 改版(1-6):拆分 StudioDesignSurface.tsx——外框、发布/草稿、保存、右侧栏各成模块,纯重构不改行为 #37553, together with N2.

  6. Landing terms: lands like Tier H, by the size limb. The seat adds pm:awaiting-merge and requests the governed approvers. The maintainer's approval decides; after approval, the seat or the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Approval requested (size limb: 3411 changed lines > 3000; not governed by path; not security-touching). Seat ACCEPT: comment 7206286955. Contract review PASS at TIER_DEFAULT: comment 7206275783, Head-sha fd1a2e0900597a676e7b1116b00362d2444ecef2. After approval the seat or area lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 27, 2026 00:54
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 5473242 Nov 27, 2026
66 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-37553-split-studio-design-surface branch November 27, 2026 01:33
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
<!-- claude-projects-attribution: {"github_login":"hotlong"} -->
_Requested by **Jack** · [project
thread](https://claude.ai/code/project/chan_01EF41AQooqveF2DGD8nqPzS?thread=cmsg_01EF41AQooqveF2DGD8nqPzSMJK8dtC6Pva5SVajbS4V1a)_

Fixes objectstack-ai#37682

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: updated here

## 维护者速读

- 用户看到的变化:控制台的问答聊天(侧边停靠和全页)和 Studio
照常可用;搭建应用那一套聊天界面(方案卡、变更卡、搭建结果、交接卡、诊断抽屉、草稿条、表格导入条、Studio
副驾驶面板)不再出现,旧的搭建地址会落到问答聊天。
- 为什么:搭建能力已经整体退役,这是退役专题里第一步,只删前端,不拆分组件、不改审批和提问卡。
- 出问题会怎样:最坏是问答聊天里某个按钮或文案缺失,或旧地址跳转不对;数据和元数据不受影响,回滚这一个合并即可。
- 需要你做的:不用做什么,席位做完合同级审查后排队合并。

## What changes

The build agent's chat frontend is deleted. Ask chat (dock and
`/ai/ask`) and Studio keep working; `/ai/build/…` addresses still
redirect to the ask chat.

- `@object-ui/plugin-chatbot`: the build-only cards (proposed plan,
proposed changes, build result and publish line, builder handoff,
designing-plan wait), their detectors, the build-progress mapping and
the 59 props that fed them.
- `@object-ui/app-shell`: the Build Doctor drawer, the pending-drafts
bar, the spreadsheet import bar, the maker start chips and empty state,
Studio's copilot panel and topbar entry, and the build branches in
`AiChatPage`, `ChatDock` and `ConversationsSidebar`.
- `@object-ui/i18n`: the 280 released keys only that UI read, and the
zh-Hant generator's `GATE_ONLY_KEYS`, which had nothing left to leave
out.

`publishHealthFromResponse` / `PublishHealth` stay: the preview's
Publish all reads them.

Both changesets say the removal is breaking (`!` in the summary line, a
**BREAKING** banner and `Clause-②: no (narrowing)`). The
`plugin-chatbot` README, which ships in the tarball, and
`content/docs/frontend/plugins/plugin-chatbot.mdx` no longer describe
the removed props and fields. The ADR-0087 marker is
`runtime-export-retired` for the package exports and
`no-migration-prescription` for the keys; `check-adr-0087-registration`
passes.

### Removed published exports, by package

**`@object-ui/plugin-chatbot`** (root entry)

- Functions: `detectDraftResult`, `detectProposedPlan`,
`detectProposedChanges`, `detectBuilderHandoff`,
`detectBuiltAppPackage`, `detectAuthoringVerdict`,
`detectReplayOutcome`, `buildProgressFromDraftReview`
- Types: `DraftReview`, `ProposedPlan`, `ProposedChanges`,
`BuilderHandoff`, `ReplayOutcome`, `PublishOutcome`
- Members of `ChatbotEnhancedToolInvocation` (and `SeamToolInvocation`):
`draftReview`, `proposedPlan`, `proposedChanges`, `builderHandoff`,
`replayOutcome`
- Members of `ChatbotEnhancedMessage` (and `SeamChatMessage`):
`buildProgress`, `blueprintProgress`
- Members of `ChatbotLabels`: `designingPlanLabel`, `designingPlanHints`
- Props of `FloatingChatbotProps` and `ChatbotEnhancedProps` (59 each,
the same set):
- Handlers: `onBuildMaterialized`, `onBuildResult`, `onDesignBuiltApp`,
`onDiscardDrafts`, `onDraftArtifacts`, `onOpenBuilder`,
`onOpenBuiltApp`, `onPlanApprovalPendingChange`, `onPreviewDraft`,
`onPreviewDraftApp`, `onPublishDrafts`, `onReviewDraft`,
`onReviewDrafts`
- Labels and messages: `builderHandoffOpenLabel`,
`builderHandoffSupersededTitle`, `builderHandoffTitleLabel`,
`changesAppliedLabel`, `changesApplyingLabel`, `changesConfirmedLabel`,
`changesConfirmHintLabel`, `changesConfirmLabel`,
`changesConfirmMessage`, `changesDraftedLabel`, `changesFailedLabel`,
`changesTitleLabel`, `changeVerbLabels`, `designBuiltAppLabel`,
`nextStepsLabel`, `openBuiltAppLabel`, `planAdjustLabel`,
`planAnswerMessage`, `planApproveDefaultsMessage`,
`planApproveHintLabel`, `planApproveLabel`, `planApproveMessage`,
`planAssumptionsLabel`, `planBuildingLabel`, `planBuildNewAppMessage`,
`planBuiltLabel`, `planDeferredLabel`, `planExtendExistingMessage`,
`planExtendLabel`, `planQuestionsLabel`, `planReadyLabel`,
`planTitleLabel`, `previewDraftLabel`, `publishDraftsLabel`,
`publishedLabel`, `resolveAppLabel`, `resolveFieldLabel`,
`resolveFieldTypeLabel`, `resolveObjectLabel`, `toolReviewLabel`,
`verifiedLabel`
- Behaviour: `autoPublishDrafts`, `fetchPendingDraftCount`,
`getArtifactAction`, `publishFromShellBar`, `subscribeMetadataRefresh`

**`@object-ui/plugin-chatbot/core`**

- Type: `PublishOutcome`

**`@object-ui/app-shell`**

- `ConversationsSidebar` prop `includeAskConversations` (the sidebar
lists the active agent's conversations)

**`@object-ui/i18n`**

- 280 translation keys released in `@object-ui/i18n@18.6.0`: 271
language-pack keys (209 from all eleven locales, 6 `console.ai.*Message`
keys from en and zh-Hans, the rest with their plural siblings) and 9
`engine.studio.copilot.*` / slot keys of the Studio namespace. The full
list is in `.changeset/37682-i18n-retire-build-chat-keys.md`.

## Tests

- Deleted the tests of the removed cards, bars, drawer, copilot panel
and detectors, and the i18n tests that only pinned removed keys
(`outbound-agent-messages`, the three maker scope tests, the zh-Hant
gate test).
- Kept and retargeted: `useChatConversation` cache sanitising now uses a
plain tool invocation; the `AiChatPage` runtime-message seam test uses
the ask agent and a pending approval; `ChatDock` request-context pins
that a build agent in the catalog binds no package; the ChatDock menu
test pins Share and Expand with no build doctor.
- Count pins adjusted where keys left (console namespace, de quote
pairing, count families, column-identity ratchet).

## Acceptance notes

Four leftovers are deliberately not in this PR. They are not build UI,
and removing them reaches past this card's surface. The seat decides
which ones to file:

1. **Builder-handoff plumbing**: `chatDockTarget.ts`
(`BuilderHandoffState`, `ChatDockHandoff`, `ambientAppPackage`),
`chatDockControl`, the handoff in `useConsoleChatDock`, and
`AiAddressRedirect`'s handoff branch. Nothing sets a handoff any more.
2. **The plan-approval bus and the launcher marker**: the plan-approval
channel on `assistantBus`, `usePlanApprovalPending`, and the pending
marker on `AssistantTopBarButton`. Nothing raises plan approval any
more.
3. **The surfaceAgent maker helpers**: the maker helpers in
`hooks/surfaceAgent.ts`, and `useChatConversation`'s `rekeyScope` and
legacy options that only served them.
4. **showDebug is always false**: `ChatDockConversation` always sends
`showDebug: false` now that the Build Doctor drawer is gone, and
`chatDockTarget`'s `showDebug` field has no reader.

One more build entry outside this diff:
`ui/apps/console/src/pages/system/AppManagementPage.tsx:691` still draws
an ungated "Edit with AI" button that opens `{ agent: 'build', packageId
}`. It behaved the same on main once build closed, so it is not this
diff's regression; the seat files it.

Smaller stale text, also left: a historical comment in
`ui/scripts/check-eager-closure-budget.mjs` naming the deleted bars, the
pending `ui/.changeset/12724-plan-card-posture.md` that describes the
deleted plan card, and comments in the preview's `usePublishAllDrafts`.

## Verification

Read first: `ui/packages/plugin-chatbot/src/index.tsx` (the export
list), `ui/packages/app-shell/src/console/ai/AiChatPage.tsx` (the
ask-only path that stays), and the two changesets.

Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/layout/__tests__/ChatDock.requestContext-30043.test.tsx
packages/app-shell/src/console/ai/__tests__/AiChatPage.runtimeMessageSeam.test.tsx`
(the dock binds no package for a build agent; the full page keeps its
approval seam).

Main was merged in after objectstack-ai#37579 landed (Studio's top-left rows). Nine
Studio tests conflicted. Main's new tests that assert the copilot and
its AI assistant button were dropped with it; the rest keep main's
assertions, and the right slot's toggle stays the title row's only
control.

Two dispatch-gate fixes this change needed:

- `check-test-source-alias`: 17 tests that reach `AiChatPage` now load
`@object-ui/plugin-grid` at module top. The deleted spreadsheet import
bar used to load it during collection; without it, the page's own
`import('@object-ui/plugin-grid')` would be paid inside a clocked case.
- `check-hand-rolled-comment-mask`: the DEBT entry for
`console-namespace-3546.test.tsx` is deleted, because the code that
carried it went with the build keys. `check-vi-mock-specifiers`: the
`noTopBar-37456` suite's mock of the deleted `StudioAiCopilot` is
dropped.

<details><summary>Local readings</summary>

- `pnpm console:build`: 81 of 81 tasks succeeded.
- `tsc` in app-shell, both `tsconfig.json` and `tsconfig.test.json`:
exit 0 on the merged head.
- eslint `--quiet` over the 128 changed `.ts`/`.tsx` files: 0 errors.
- Affected suites before the merge: 707 files, 6156 tests passed.
- After the merge, `packages/app-shell/src/views/studio-design` plus
`packages/i18n`: 386 files, 4184 tests (4170 passed, 13 skipped, and 1
failure fixed and re-run green).
- `pnpm --dir ui exec vitest run scripts/`: 174 files (171 passed, 2
skipped, 1 failed: the vi.mock gate above, fixed, and its file re-run
green with 57 tests).
- dispatch-gates: all 42 derived commands ran before the merge. Three
failed and were fixed (ADR-0087 marker, test-source-alias, the scripts
suite). On the merged head, `check-adr-0087-registration --base
origin/main`, `check:test-source-alias`, `check:i18n-keys`,
`check:i18n-drift` and the scripts suite were re-run and exit 0.
`check-platform-checklist --changed-from origin/main` and
`check:new-line-citations` also exit 0.
- `check-i18n-dead-keys`: no new dead key, and 16 fewer than base.
- The full ui suite with `--maxWorkers=3` was still running at push
time. Its first attempt, run alongside `console:build`, was killed for
memory. CI's sharded run is the verdict; the local result goes in the
card report.
- Dogfood battery (`pnpm --filter @objectstack/dogfood test` under
`os-verify-lock`, closure built first) on head `18cec5f4`: running; the
reading goes in the card report.
- After objectstack-ai#37706 landed, main was merged again: the de-quote-pairing pin
is 129 (135 minus this PR's six spans).
- `overlap-check`: main merges cleanly. Two textual conflicts with open
PRs outside epic cloud#5027:
- objectstack-ai#37706 in `de-quote-pairing-3876.test.ts`: a count pin, 133 → 127 here
and 133 → 135 there.
  - objectstack-ai#37719 in `StudioDesignSurface.tsx`: a move-only split of the file.

  Whichever PR lands second takes the other's change.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Q4EjjMnLQVLzcho6g8WAL3)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Q4EjjMnLQVLzcho6g8WAL3

<!-- signed: epic:objectstack-ai#5024#1 · hotlong · session_01Q4EjjMnLQVLzcho6g8WAL3
-->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xl skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Studio 改版(1-6):拆分 StudioDesignSurface.tsx——外框、发布/草稿、保存、右侧栏各成模块,纯重构不改行为

3 participants