Repository navigation
Commit 6902acb
refactor(app-shell): move the Data, Automations and Access pillars out of StudioDesignSurface.tsx (move-only) (#36956)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBTuMGhLAZx29zwDrayDGZZF)_
Fixes #36893
Part of #36890
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:用户无感,Studio 设计界面的行为与外观不变,只是代码换了文件存放。
- 为什么做:属于「Studio
重构」专题;把八千行的设计界面大文件按数据、自动化、访问三个分区拆开,让后面左侧菜单和三个设计器的改动可以并行,不再排队改同一个文件。
- 出错会怎样:最坏是 Studio 某个分区打不开或报错,所有在 Studio
里设计应用的管理员都会立刻看到;改动是纯搬移,可以整体直接撤回。
- 要你做什么:审阅并亲手合并这个草稿(改动行数超过三千,按规则需要你本人合并)。
## What changes
Move-only split of
`ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx`
(SDS), the whole card in one PR: all three pillars. SDS goes from 8,010
lines (at base `62692b7f8`) to 1,715.
| New module | Moved from SDS at `62692b7f8` | What it holds |
|---|---|---|
| `DataPillar.tsx` | lines 1973-4899 (2,927 lines) |
`renderStudioGridList` (the records-grid slot), `ObjDraftSend`,
`DataPillar` |
| `AutomationsPillar.tsx` | lines 4904-6978 (2,075 lines) |
`readPublishedFlowNames`, `AutomationsPillar` |
| `AccessPillar.tsx` | lines 1947-1971 (25) and 6980-8008 (1,029) |
`StudioNameLabel`, `NewSimilarStrip`, `NEW_SIMILAR_ARRIVAL_STATE`,
`readNewSimilarArrival`, `AccessPillar` |
- **Move only.** Each moved block is byte-identical to its text at the
base; the check is below. Each new file is a header comment, its
imports, and the moved blocks, nothing else. No `export` was added or
removed: the three pillars and `renderStudioGridList` were already
exported, and the other helpers stay private to their module.
- **Helpers.** Every helper that moved is used only by the pillar it
moved with: `StudioNameLabel` only by `AccessPillar`, `ObjDraftSend` and
`renderStudioGridList` only by `DataPillar`, `readPublishedFlowNames`
only by `AutomationsPillar`. No helper used by two pillars or by the
shell existed in this text, so nothing went to a shared module.
- **No cycle.** The new modules import nothing from SDS. SDS imports the
three pillars and re-exports them, plus `renderStudioGridList` for
`StudioDesignSurface.gridRefresh.test.tsx`, so every import path stays
the same. The test files that import the pillars are not edited.
- **SDS diff = deletions + re-exports.** It removes the blocks and the
import names only they used, trims five single-line imports, and adds
three import lines for the new modules and three re-export lines with
comments. The `FlowStatusDot` re-export pair shows as moved only because
the text around it was deleted. The import names in each file come from
the TypeScript checker's own noUnusedLocals result: 0 unused at base, 0
in each of the four files at head.
- **By-path readers** (ruling 6597555122 item 3), all three updated in
this PR:
- `homeRecoveryRedirectsFollowDeclaration-7373.test.ts`: the Studio
site's `alsoReads` gains the three modules.
- `ui/scripts/__tests__/spec-symbol-ledger-app-shell-7265.test.ts`:
`SITES` gains the three modules.
- `clickableNonControlCensus-13461.test.ts`: six rows are re-keyed from
SDS to the module their site moved into. Data has the two canvas
backgrounds, the rail scrim and the form-preview click; Automations and
Access each have their rail scrim. The keys and reasons are unchanged.
- One root changeset, `.changeset/36893-sds-pillar-split.md`
(`@object-ui/app-shell` patch), carrying both declaration lines.
- History on the branch: slice 1 (Automations, Access) was committed
first. Then `origin/main` was merged in after PR 36888 landed. The
single conflicting line was in the `StudioCustomizeControls` import:
`withoutReplacedPlacements` from main was kept, and `type
CustomizeBlock` was dropped, because its only reader moved out with
`AutomationsPillar`. The Data pillar move came after that merge,
measured against the merged text.
**Read first** (by risk):
1. SDS, the import block and the three re-export lines at the end of the
file. This is where a missing re-export would break an importer.
2. `clickableNonControlCensus-13461.test.ts`, the six re-keyed rows.
3. `DataPillar.tsx`, its import block. It is the largest pruned import
list.
## Tests
<details><summary>Verbatim check: all four blocks against base
62692b7</summary>
```bash
B=62692b7f8; D=ui/packages/app-shell/src/views/studio-design
for spec in 'AccessPillar 1947 1971' 'DataPillar 1973 4899' 'AutomationsPillar 4904 6978' 'AccessPillar 6980 8008'; do
set -- $spec
git show $B:$D/StudioDesignSurface.tsx | sed -n "$2,$3p" > /tmp/blk
node -e 'const fs=require("fs"),c=require("crypto");const b=fs.readFileSync("/tmp/blk","utf8");const f=fs.readFileSync(process.argv[1],"utf8");const i=f.indexOf(b);console.log(process.argv[1].split("/").pop()+": base lines "+process.argv[2]+" ("+(b.split("\n").length-1)+" lines, sha256 "+c.createHash("sha256").update(b).digest("hex").slice(0,16)+"): "+(i===-1?"MISSING":(f.indexOf(b,i+1)===-1?"verbatim, once, from line "+f.slice(0,i).split("\n").length:"DUPLICATE")))' $D/$1.tsx $2-$3
done
```
Output at head `c77091a61`:
```text
AccessPillar.tsx: base lines 1947-1971 (25 lines, sha256 6992ca733d12063a): verbatim, once, from line 61
DataPillar.tsx: base lines 1973-4899 (2927 lines, sha256 310655239c9c9faf): verbatim, once, from line 202
AutomationsPillar.tsx: base lines 4904-6978 (2075 lines, sha256 b917d07fef64e35a): verbatim, once, from line 162
AccessPillar.tsx: base lines 6980-8008 (1029 lines, sha256 aa6b436a3bcacc05): verbatim, once, from line 87
```
The complementary check: with the moved blocks removed, each new file
has 0 lines left that are not header or import lines (Access 0,
Automations 0, Data 0). The Automations and Access blocks are also
byte-identical to their text at `3f568c1a4`, where slice 1 was first cut
(same sha256 values), so the field-layout PR changed none of that text.
</details>
<details><summary>Local verification at head c77091a, under
os-verify-lock (one chain joined with &&, VERDICT command-exit
0)</summary>
- `pnpm --filter '@object-ui/app-shell^...' build` (dependency closure,
rebuilt after the merge): exit 0
- `pnpm --filter @object-ui/app-shell type-check` (both `tsc --noEmit`
and `tsc -p tsconfig.test.json`): exit 0
- `ui`: `pnpm run type-check:scripts`: exit 0
- eslint on the four studio-design files and the three readers: 0
errors, 47 warnings. The react-hooks warnings are 46 at base on SDS and
46 at head across the four files (8 + 16 + 14 + 8), rule for rule. The
one extra is `react-refresh/only-export-components` on SDS's re-export
of `renderStudioGridList`; see Acceptance notes.
- vitest, the whole `views/studio-design/` directory plus every test
outside it that names a pillar or reads SDS by path (7373, 7265, census
13461, the two `PermissionMatrixEditor` pins,
`ResourceEditPage.celGate`, `ObjectFieldInspector.celGate`,
`builtinDesigners.lateArrival-11939`): **Test Files 300 passed (300),
Tests 2153 passed (2153)**
- Narrowed, as declared: the full UI suite runs in CI (`Test UI`).
</details>
<details><summary>Derived gate families (dispatch-gates
--commands)</summary>
The 38 derived commands ran on slice 1's head `7a19c2b90`, all exit 0,
and `--ran` reconciled 38 derived, 38 run, 0 NOT-MEASURED. The re-run at
`c77091a61` is recorded in the os-dev report on the card.
`check-platform-checklist --changed-from origin/main`: no anchored file
in the change set, nothing judged.
</details>
## Acceptance notes
- **Tier H by size**: 6,516 additions + 6,316 deletions = 12,832 changed
lines. Draft, waiting for the maintainer. No AI seat readies, queues or
arms it.
- `renderStudioGridList` moved with its own `eslint-disable-next-line
react-refresh/only-export-components` line, which still applies in
`DataPillar.tsx`. SDS's re-export of it now draws that rule's warning
once (warn, not error, so no gate fails). Adding a matching directive to
SDS would be a new line rather than a move, so this PR leaves it out. It
is a one-line follow-up if wanted.
- Open PR 36784 (paused) conflicts in SDS. It already conflicts with
`origin/main` without this branch (merge-tree exit 1), so this PR does
not cause that conflict.
- Prose that still names SDS for text that has moved, outside this
card's file surface, noted and not filed: source citations in
`docs/qa/platform-checklist/areas/{automation,studio-authoring,access-security}.json`
that name SDS for pillar behaviour; the producer prose in
`packages/spec/liveness/permission.json` (the Access pillar mounts the
permission page); and the `StudioDesignSurface.tsx:2575` line citation
in `ui/packages/plugin-view/src/ObjectView.tsx`. None is read by a gate
(the checklist gate found no anchored file).
## Verification
Two-minute check: run the verbatim-check script above from the repo root
on this branch. Expect four lines, each ending `verbatim, once, from
line N`. A `MISSING` or `DUPLICATE` line means the move is not verbatim.
Session: https://claude.ai/code/session_01WGufziBCAytAzzCu3iPBFR
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziBCAytAzzCu3iPBFR -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1cda7ea commit 6902acb
8 files changed
Lines changed: 6516 additions & 6316 deletions
File tree
- .changeset
- ui
- packages
- app-shell/src
- __tests__
- views/studio-design
- components/src/__tests__
- scripts/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
0 commit comments