Repository navigation
Commit 389de4a
refactor(ui)!: retire plugin-designer's dead collaboration code, VersionHistory and the useConfirmDialog entry export (#29529)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb4JjPNQfBQxo6jSSRhqXFe8)_
Part of #25921. This is the `@object-ui/plugin-designer` batch named in
landing note 6579769954 ("New since this batch"), under claim 6583164004
and amendment 6583226546. The card stays open. Every other item it lists
is untouched: `CommentSearchResult`, the providers/upload fold,
`clearSharedDiscoveryCache` and the other packages' barrel batches.
Clause-②: no (narrowing)
Metadata-protocol: none
## 维护者速读
- 改了什么:删除 `@object-ui/plugin-designer` 中 #29388 之后已成死代码的协作实现:整个
`CollaborationProvider.tsx`,以及页面、数据模型、流程、报表四个设计器里永远为 null 的
`useCollaboration()` 分支和工具栏上的“N users / Connected”标记。删除无人渲染的
`VersionHistory` 组件及其测试。包入口不再导出 `VersionHistory` 和
`useConfirmDialog`。`useConfirmDialog` 模块保留,因为七个设计器内部都在用。
- 为什么改:普查(#28385 方法,`origin/main` `128681f4`,hotcrm
`d4ffe99`)显示,这些名字在包外只有一个测试文件的历史注释提到,hotcrm 为零。`CollaborationProvider`
在全仓无人挂载,所以协作分支在运行时从不执行。
- 风险与回滚:Console 和其它 `@object-ui/*` 包都不导入这两个名字,不受影响。外部 npm
用户若导入会在升级时编译报错,changeset 写明了改法。设计器行为不变。回滚即 revert 本 PR。
-
先看:`ui/packages/plugin-designer/src/index.tsx`、`ui/packages/plugin-designer/src/ReportDesigner.tsx`(删得最多的设计器)、`.changeset/25921-plugin-designer-dead-collaboration-version-history.md`。
- 两分钟验证:`git grep -n -w -e CollaborationProvider -e useCollaboration -e
VersionHistory -- ui/packages/plugin-designer
':!**/CHANGELOG.md'`,预期无输出(退出码 1)。
- 需要你做的:无,席位落地(入队前欠一次契约复审档复审,由席位转总监)。
## What changes
- **Dead collaboration code.** `src/CollaborationProvider.tsx` is
deleted: the provider, `useCollaboration`, `ConnectionStatusIndicator`
and their types. `CollaborationProvider` left the entry in #29388 and
nothing mounts it anywhere, so `useCollaboration()` always returned
`null`. In `PageDesigner` and `ReportDesigner`, the `broadcastOp`
callback, its call sites and the `broadcastOp` entries in the hook
dependency lists go. `DataModelDesigner` and `ProcessDesigner` lose
their `collaboration?.sendOperation(...)` calls and the `collaboration`
dependency entries. The always-hidden "N users" status chip (DataModel,
Process) and the "Connected" chip (Report, with its local
`LABELS.collaborationConnected`) go too, as does the now-unused `Users`
icon import in `DataModelDesigner`. `AppCreationWizard` and
`ObjectManager` had no collaboration branch.
- **`VersionHistory`.** `src/components/VersionHistory.tsx` and its test
`VersionHistory.displayLocale-9909.test.tsx` are deleted, along with its
two `components/index.ts` lines and the entry line. Nothing in the
package rendered it. The `VersionHistory` case leaves
`ariaLabelNames.zh-12145.test.tsx`: the zh wait now anchors on the
minimap image. The undo, redo and minimap names are still asserted
against both packs.
- **`useConfirmDialog`.** Only the entry line goes.
`hooks/useConfirmDialog.ts` and its `hooks/index.ts` line stay, because
`AppCreationWizard`, `DataModelDesigner`, `FieldDesigner`,
`ObjectManager`, `PageDesigner`, `ProcessDesigner` and `ReportDesigner`
import it. `hooks/index.ts` is a sub-barrel nothing imports, the same
state #29388 left it in.
- `README.md` stops teaching both names. `package.json`'s description
drops "plus collaborative editing". One comment line in
`useDesignerTranslation.ts` stops naming `VersionHistory`'s region.
- One `!` changeset (`patch`, `**BREAKING**` banner, both declaration
lines, the ADR-0087 `not-required (runtime-export-retired …)` marker
naming both operands, and a FROM → TO "no replacement" line per name).
## Why
The #28385 census was re-run before any edit at `origin/main` `128681f4`
(hotcrm `d4ffe99`). For each name, `git grep -l -w -F` ran over the
whole tree minus `ui/packages/plugin-designer/**`, `**/CHANGELOG.md`,
the lockfiles, `.changeset/**` and `ui/.changeset/**` (A). The brief's
cut (`ui packages apps examples content`, tests excluded) is B, test
files only is T and hotcrm is H. IN counts the in-package non-test
files.
| name | on the entry before | A | B | T | H | IN | result |
|:--|:--|--:|--:|--:|--:|--:|:--|
| `ObjectGantt` (control) | gantt | 189 | 53 | 134 | 0 | 0 | control
hits |
| `SchemaRenderer` (control) | react | 1168 | 299 | 841 | 3 | 0 |
control hits |
| `CreateAppPage` (kept control) | yes | 49 | 4 | 45 | 0 | 3 | stays |
| `useConfirmDialog` | yes | 1 | 0 | 1 | 0 | 11 | leaves the entry;
module stays |
| `VersionHistory` | yes | 1 | 0 | 1 | 0 | 5 | leaves the entry; module
deleted |
| `VersionHistoryProps` | no | 0 | 0 | 0 | 0 | 2 | deleted with the
module |
| `VersionHistoryEntry` | no | 1 | 0 | 1 | 0 | 2 | deleted with the
module |
| `DesignerConfirmDialogState` | no | 1 | 0 | 1 | 0 | 2 | stays (module
stays) |
| `CollaborationProvider` | no (left in #29388) | 0 | 0 | 0 | 0 | 5 |
deleted |
| `CollaborationProviderProps` | no | 0 | 0 | 0 | 0 | 1 | deleted |
| `CollaborationContextValue` | no | 0 | 0 | 0 | 0 | 1 | deleted |
| `useCollaboration` | no | 0 | 0 | 0 | 0 | 5 | deleted |
| `ConnectionStatusIndicator` | no | 0 | 0 | 0 | 0 | 1 | deleted |
The single A/T hit for `useConfirmDialog`, `VersionHistory`,
`VersionHistoryEntry` and `DesignerConfirmDialogState` is one file,
`ui/scripts/__tests__/one-authority-per-exported-name-6273.test.ts`. Its
historical comments ("`ConfirmDialogState` sat here", "`VersionEntry`
sat here") name the module paths. Under the claim, that comment does not
keep a name. Keep rule 3: no kept entry export's declared signature
names any retired type. Each appears only in its own module and its
sub-barrel.
After the change, at the merged head `d7514fc8`, the same `git grep`
over the whole tree (CHANGELOGs and changesets excluded) finds zero
files for `CollaborationProvider`, `CollaborationProviderProps`,
`CollaborationContextValue`, `useCollaboration`,
`ConnectionStatusIndicator` and `VersionHistoryProps`. `VersionHistory`,
`VersionHistoryEntry` and `useConfirmDialog` outside the package appear
only in that test comment. `useConfirmDialog` is absent from
`src/index.tsx` and `README.md` (`git grep` exit 1). Control:
`SchemaRenderer` 1207 files.
## Tests
- Code head `fb1192c3`; `d7514fc8` merges 10 `origin/main` commits, none
under `ui/packages/plugin-designer` (branch delta re-read: the same 14
files, +52 / -573).
- `pnpm --filter @object-ui/plugin-designer run type-check` (`tsc
--noEmit && tsc -p tsconfig.test.json`): `VERDICT command-exit 0` on
`fb1192c3` and again on `d7514fc8`.
- `pnpm --dir ui exec vitest run --maxWorkers=2
packages/plugin-designer/`: Test Files 49 passed (49), Tests 456 passed
(456), `VERDICT command-exit 0` on both heads.
- `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/` (includes
`check-readme-exports`) on `fb1192c3`: Test Files 169 passed, 2 skipped
(171); Tests 4921 passed, 2 skipped; `VERDICT command-exit 0`.
- `eslint` on the eight changed source and test files: 0 errors, 18
warnings, all on lines this diff does not touch.
- No ablation: this diff only deletes code, removes export lines and
edits README text, so no tested behaviour changed. The zero-hit census
above is the proof.
## Acceptance notes
- `designer.versionHistory` is now unread. Its only reader was
`VersionHistory`. Per the claim it stays in the ten locale packs and in
`DESIGNER_DEFAULT_TRANSLATIONS`, the table the en-pack mirror gate
compares. It is left for the dead-key item.
- The historical comments in
`ui/scripts/__tests__/one-authority-per-exported-name-6273.test.ts`
still name `packages/plugin-designer/src/components/VersionHistory.tsx`,
a path this PR deletes. They are a "sat here" record of an older rename,
outside this claim's surface, and left as they are.
- `@object-ui/types`' `CollaborationConfig`, `CollaborationPresence` and
`CollaborationOperation` lose this package as a reader.
`@object-ui/collaboration` still imports all three, so they stay.
- The importers of this package (`@object-ui/app-shell`'s lazy designer
pages, the Console) were not type-checked locally. The census shows
neither imports either retired name (B = 0), and CI's `Type Check UI`
compiles them.
- A `CONTRACT_REVIEW_TIER` review is owed before the queue (an entry
narrowing). The seat routes it to the director.
## Verification
<details><summary>Derived gates: 46/46 run, 0 NOT-MEASURED</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `fb1192c3` gave 46 commands. `--ran`
reports "46 derived famil(ies) accounted for — 46 run, 0 NOT-MEASURED".
Every command exited 0. Among them: `check-adr-0087-registration --base
origin/main` and `--self-test`, `check-changeset-no-major --base
origin/main`, `check-empty-changeset`, `check-sdui-manifest` and its
`--self-test`, `check:published-files`, `check:undeclared-dep-imports`,
`check:nul-bytes`, `check:query-options-erasure` (293 s),
`check-comment-mask-corpus` (20193 files, 0 disagree),
`check:type-check-debt` (locked, 0 raw tsc errors) and `vitest run
scripts/`.
At `d7514fc8` the derived list is identical.
`check-adr-0087-registration`, `check-changeset-no-major`,
`check-empty-changeset`, `check-sdui-manifest`, `check:changeset-fixed`,
`check:nul-bytes`, `check:cross-package-test-inputs`,
`check:published-files`, `check:undeclared-dep-imports` and
`check:test-source-alias` were re-run there, all exit 0.
Outside the derived set: `check-platform-checklist --changed-from
origin/main` exit 0 (0 anchored files). `dispatch-gates --tier`: no
path-derived mandate, 625 changed lines (under the 3000 threshold), no
governed path.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind. (no names
added)
- [x] 3. No formatter ran; `eslint` on the changed files exits 0
(warnings only, all pre-existing). The repo-wide `pnpm lint` is CI's
run.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jR9JS6qCZyzC5esvUr)_
<!-- signed: domain:ui#3 · zhuangjianguo ·
session_01QsR2jV4dWohojjbTJTQq5m -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4b8cbe2 commit 389de4a
15 files changed
Lines changed: 54 additions & 575 deletions
File tree
- .changeset
- ui/packages
- i18n/src/__tests__
- plugin-designer
- src
- __tests__
- components
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
256 | | - | |
| 255 | + | |
257 | 256 | | |
258 | 257 | | |
259 | 258 | | |
| |||
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | 302 | | |
307 | 303 | | |
308 | 304 | | |
| |||
343 | 339 | | |
344 | 340 | | |
345 | 341 | | |
346 | | - | |
347 | | - | |
| 342 | + | |
348 | 343 | | |
349 | 344 | | |
350 | 345 | | |
| |||
367 | 362 | | |
368 | 363 | | |
369 | 364 | | |
370 | | - | |
371 | 365 | | |
372 | | - | |
| 366 | + | |
373 | 367 | | |
374 | 368 | | |
375 | 369 | | |
| |||
788 | 782 | | |
789 | 783 | | |
790 | 784 | | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | 785 | | |
800 | 786 | | |
801 | 787 | | |
| |||
0 commit comments