Repository navigation
Commit 85ea12f
feat(spec)!: a view no longer declares itself personal — scope 'personal' and sharing.type retire (#29447)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9FHuKppFm22FnTZqw5cbJzG)_
Fixes #29037
Clause-②: no (narrowing)
Metadata-protocol: narrowed
## 维护者速读
- 改了什么:视图不能再自称"个人视图"。`scope: 'personal'` 和列表视图的 `sharing.type`
都被拒收并给出改法;控制台列表工具栏不再显示"个人视图 / 共享视图"标签,只保留"由谁锁定"。
- 为什么改:这两个声明从来没有限制过谁能看到视图,标成个人的视图其实所有能读这个对象的人都看得到,标签在说假话(#28971 裁决
C:个人视图将来是用户自有记录,不复用这两个键)。
- 风险与回滚:BREAKING 的 spec minor(只收窄)。已存的行和组装产物在读取时自动转换,旧版本写入的默认值
`collaborative` 照收并丢弃,所以现有视图不用改就能加载;回滚就是 revert 本 PR。
- 先看:`packages/spec/src/ui/view.zod.ts`(两处退役与改法文案)和
`packages/spec/src/conversions/registry.ts` 的
`personalViewDeclarationsRemoved` 转换。
- 两分钟验证:`pnpm --filter @objectstack/spec exec vitest run --project repo
src/ui/view-personal-declarations-retirement.test.ts`,看 `personal`
两处被拒、`collaborative` 被丢弃、转换后的行能通过。
- 需要你做的:看 open questions 里 `collaborative` 残留是照收丢弃还是一起拒收(默认按 #12840
惯例照收丢弃)。
## What changes
Per ADR-0049 enforce-or-remove and ADR-0087, the two inert `personal`
declarations retire.
- **`view.scope: 'personal'`** is refused by `enumWithRetiredValues`
with a prescription at every door that reads a view item's `scope`:
`ViewItemSchema`, the wire schema, the `ViewMetadataSchema` record and
overlay arms, and `AssembledViewArtifactSchema`. `package` and `shared`
are unchanged.
- **`view.list.sharing.type`** retires as a whole key with a
`retiredKey` tombstone, not just its `personal` value. Once `personal`
goes, `collaborative` is the only value left, and the only reader was
the console badge. A measured `git grep` over packages/ and ui/ finds no
server, runtime or service reader. `lockedBy` stays.
- The emitted default `type: 'collaborative'`, which a released
toolchain wrote into every parsed `sharing` block, is accepted and
stripped through `acceptRetiredDefaultResidue` (house rule #12840).
`type: 'personal'` is refused.
- **D2 conversion** `view-personal-declarations-removed` (identifier
`personalViewDeclarationsRemoved`, `retiredFromLoadPath: true`,
`retiredAfter: '18.2.0'`) serves stored-row rehydration, assembled
artifacts and `os migrate meta`. It strips `scope: 'personal'` from
`views` / `viewItems` rows, and `sharing.type` from list payloads, list
view item configs, flattened list overlays and `objects[].listViews.*`.
**Route:** it deletes the declaration and does not invent `shared`,
because nothing a reader sees changes.
- **D3 entry** `ui-view-personal-declarations-retired` carries the part
a migration cannot decide (keep the view as everyone-visible, delete it,
or wait for user-owned personal views). One ADR-0087 marker sits in the
changeset. There is also a `RETIRED_KEYS_BY_MAJOR` entry
`ui/ViewSharing:type` and a STEP18 rationale fragment.
- The docblocks that called per-user views a "parked direction" now
point at #28971 letter C and the ADR notes in PR #29321.
- **Console (in surface, the target-2 reading):**
- `ui/packages/plugin-list/src/ListView.tsx`: the personal/shared badge
is gone, and a view with `sharing.lockedBy` still shows "Locked by …"
(`data-testid="sharing-locked-by"`).
- `ui/packages/core/src/utils/normalize-list-view.ts`: drops the legacy
`sharing: { visibility, enabled }` pair instead of folding it onto the
retired `type`.
- `list.sharingPersonal` / `list.sharingCollaborative` are removed from
all 10 locales.
- **Docs:** `content/docs/ui/audience-based-interfaces.mdx` now says
per-user list preferences instead of personal views. The liveness row
`view.json#list.sharing` is re-cited to the lock reader.
- **Regenerated, riding this PR:** `authorable-surface/ui.json`,
`authorable-defaults/ui.json`, and
`content/docs/references/{api/protocol,data/object,ui/view}.mdx`.
## Forced test edits
These are existing tests that pinned the retired values, and each one
changes only its fixture:
- `packages/spec/src/ui/view.test.ts`: the `ViewSharingSchema` describe
was rewritten (an empty block parses to `{}`, and the lock is accepted).
Three list-view literals change from `sharing.type` to
`sharing.lockedBy`.
- `packages/spec/src/ui/view-item-owner-hidden-retirement.test.ts`: the
bystander row's `scope: 'personal'` changes to `'shared'`. The
owner/hidden conversion fixture in `conversions/registry.ts` gets the
same edit.
- `packages/spec/src/ui/view-overlay-viewkind-arm.test.ts`: `{ sharing:
{ lockedBy: 'admin' } }`.
-
`packages/metadata-protocol/src/protocol.graft-folded-form-sections.test.ts`:
`{ sharing: { lockedBy: 'admin' } }`.
- `ui/packages/plugin-list/src/__tests__/ListView.test.tsx`: the sharing
tests were rewritten around `sharing-locked-by`.
-
`ui/packages/plugin-list/src/__tests__/ListViewBlock.inertKeys-13074.test.tsx`
and `ListViewBlock.specInputs-13047.test.tsx`: they mount `{ sharing: {
lockedBy: 'admin' } }` and assert `sharing-locked-by`.
- `ui/packages/core/src/utils/__tests__/normalize-list-view.test.ts`:
the legacy pair is dropped, and no `type` is written.
-
`ui/packages/plugin-view/src/__tests__/ObjectView.namedViewProtocolKeys-8980.test.tsx`:
`lockedBy` values.
- `ui/packages/types/src/__tests__/p1-spec-alignment.test.ts`: `{
lockedBy }` only.
- `ui/apps/console/src/__tests__/registry-inputs-spec-parity.test.ts`:
the `list-view.sharing` reason prose.
New test file:
`packages/spec/src/ui/view-personal-declarations-retirement.test.ts`. It
covers every door, `defineStack` 422, the type-level pins, the D2
conversion and the D3 entry, plus a tree-scoped absence walk.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmTHDhPHuivpyvN8gfF)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 91f6a0b commit 85ea12f
39 files changed
Lines changed: 975 additions & 292 deletions
File tree
- .changeset
- content/docs
- references
- api
- data
- ui
- ui
- packages
- metadata-protocol/src
- spec
- authorable-defaults
- authorable-surface
- liveness
- src
- conversions
- migrations
- entries
- retired-keys
- semantic
- ui
- ui
- apps/console/src/__tests__
- packages
- core/src/utils
- __tests__
- i18n/src/locales
- plugin-list/src
- __tests__
- plugin-view/src/__tests__
- types/src/__tests__
| 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 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1877 | 1877 | | |
1878 | 1878 | | |
1879 | 1879 | | |
1880 | | - | |
| 1880 | + | |
1881 | 1881 | | |
1882 | 1882 | | |
1883 | 1883 | | |
| |||
1956 | 1956 | | |
1957 | 1957 | | |
1958 | 1958 | | |
1959 | | - | |
| 1959 | + | |
1960 | 1960 | | |
1961 | 1961 | | |
1962 | 1962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
0 commit comments