You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 595844b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(spec)!: retire columnState from the stored view row (#36435)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbEYD1ZuaAG4V9kU4vhfiGcp)_
repo:objectstack#7 · zhuangjianguo · session_01QsR2jT24Rn8qK81aEFebXj
Fixes#36403
Clause-②: no (narrowing) — `columnState` stops being an accepted key on
a view item record and on a flattened view overlay; no published export
is removed
Metadata-protocol: narrowed
Skills-docs: none — skills/** never names columnState (git grep at the
head)
## 维护者速读
-
用户能看到什么变化:大多数列表用户无感;列宽早已只记在浏览器里、列顺序随「保存」存进视图本身。只有一种情况看得出来:某个视图上存着旧的列布局(列顺序、列宽),而读者自己的浏览器里没有记,升级前他看到这份旧布局,升级后看到视图本来的列顺序和列宽。这是维护者在
#35955 的裁定(旧布局不迁移),已在本卡重述(7079029398),升级说明里写明。再保存带这个字段的视图会被明确拒绝并告诉怎么改。
-
为什么做:这是「列表改动先是草稿、列宽只记在浏览器里」那张卡剩下的规范一半;这个字段已经没有地方写入,只剩旧数据里存着的布局还会被读出来套用,留着它,旧布局就会一直盖住视图本身的设置。
-
出错会怎样:旧数据里只存了列布局、别的什么都没有的个人覆盖行会变成无效行,需要删掉;其余视图读出时自动去掉该字段,照常显示和保存。撤回本次合并即可恢复。
- 要你做什么:无。
## What changes
`columnState` (the console grid's per-user column order and widths,
admitted as a runtime-only overlay key at commit d5552ca) retires from
the stored `view` row under ADR-0049 enforce-or-remove. Route: the
`view-overlay-owner-hidden-removed` precedent (seat ruling on the card
thread), as one family on both doors.
- **Schema** (`packages/spec/src/ui/view.zod.ts`):
`retiredKey(VIEW_COLUMN_STATE_RETIRED)` on `viewItemWireFields()` (view
item record, member 1 of the `view` union) and on
`flattenedViewOverlayFields()` (members 3 and 4).
`ViewColumnStateSchema` (module-private) is deleted.
`VIEW_CONSOLE_ROUND_TRIP_KEYS` loses `columnState` (six keys to five).
The authoring doors, which never declared the key, keep refusing it by
name: `VIEW_ITEM_SURFACE.guidance` now carries the retirement text, and
the list view body (`ListViewShapeSchema.guidance`) carries
`VIEW_LIST_COLUMN_STATE_RETIRED`, which names no migration command
because no conversion reaches a list view body.
- **ADR-0087**: D2 `view-column-state-removed`
(`conversions/entries/18/`, step 18, order 83, `retiredAfter:
'18.6.0'`): strips the key from a record (`viewKind` list/form with a
`config` object) and from a flattened overlay (no `config`, no container
slot), in `views` and `viewItems`; containers untouched.
`RETIRED_KEYS_BY_MAJOR[18]`: `ui/ViewItemWire:columnState`,
`ui/ViewMetadata:columnState` (declared, not judged, the `owner` /
`hidden` blind spot). D3 `view-column-state-retired` with the
identity-only residue in its acceptance criteria; a `STEP18_RATIONALE`
fragment.
- **Generated**: `content/docs/references/ui/view.mdx` (the two
`columnState` rows become `never` / `[REMOVED]`, the two nested-shape
tables go). `authorable-surface/`, `json-schema.manifest/`,
`api-surface/` are byte-identical: `ViewItemWire` is a discriminated
union with no top-level `properties` and `ui/ViewMetadata` is unemitted,
so no ratchet sees these rows (the same reading as the `owner` /
`hidden` retirement).
- **Pins**: new
`packages/spec/src/ui/view-column-state-retirement.test.ts` (tombstone
at each member and at the write door, the assembled channel, the
authoring doors, D2 on stored rows and both collections, idempotence,
load-path retirement, the residue, the registrations). Updated pins that
asserted the key round-trips: spec `view-metadata-schema`,
`view-console-round-trip-keys`, `view-overlay-viewkind-arm`,
`view-overlay-owner-hidden-retirement` (its CONTROL toggle),
`view-spelling-walk`, `strictness-ledger` (strip sites 2 → 1),
`metadata-form-zod-reconciliation` (ledger row dropped),
`retired-key-removal-version` (JOIN row);
`@objectstack/metadata-protocol` `protocol.graft-folded-form-sections`;
ui `data-objectstack` `listViews.roundTripKeys-11013` and `app-shell`
`ObjectView.viewConfigSaveEnvelope-10210`. The metadata-protocol and
app-shell files also gain a module-top `import '@objectstack/lint'`
(`check:test-source-alias`).
- **Strictness ledger**:
`docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md`
regenerated (`view.zod.ts` strip sites 2 → 1) and the ledger row's Class
cell goes from `mixed · 1 authorable, 1 wire` to `authorable`, with a
#36403 note.
- **Changeset**: `@objectstack/spec` minor, BREAKING banner with FROM →
TO, ADR-0087 marker `registered view-column-state-retired`.
**Not lossless for a reader (L2 M1).** Until this release the console
still applied a stored layout: a record's key rode `listViews()` through
`VIEW_ITEM_ROUND_TRIP_KEYS`, an overlay's survived
`narrowPersonalizationOverlay` through `VIEW_OVERLAY_OWNED_KEYS`, and
`objectViewListRenderer.tsx:787` seeded the grid from it for a reader
with no draft order and no widths in the browser. After the strip that
reader sees the view's own column order and widths. That is the ruled
outcome (the maintainer's #35955 body, items 5 and 6 and its acceptance;
restated on #36403 as comment 7079029398), so no stored `order` is moved
into `fieldOrder`. The D2 docblock and summary, the D3 `reason` and
acceptance criteria (a new first sentence: what an operator checks after
the upgrade), both prescriptions, the STEP18 fragment and the changeset
say so (`2fff67a6`).
No console source changes: `@object-ui/data-objectstack`'s
`VIEW_ITEM_ROUND_TRIP_KEYS` and `@object-ui/app-shell`'s
`VIEW_ROW_STATE_KEYS` are derived from `VIEW_CONSOLE_ROUND_TRIP_KEYS`
and narrow with it.
## Tests
At head `2fff67a6` (text-only delta over `94e3b6a8`: docblocks, the two
prescription strings, the D2 `summary`, the D3 `reason` /
`acceptanceCriteria`, the STEP18 fragment, the changeset, and the
regenerated `view.mdx`; no logic, schema shape or test changes):
`@objectstack/spec` `src/ui src/conversions src/migrations src/shared`
`Test Files 252`, 1 failed on a local gitignored `spec-changes.json` my
`gen:spec-changes` run had written (the conversion-conflict absence pin
reads it; file removed, test `Tests 6 passed (6)`); then
`src/ui/view-column-state-retirement.test.ts src/migrations
src/conversions/view-spelling-walk.test.ts src/shared` `Test Files 47
passed (47)`, `Tests 1264 passed (1264)`; `@objectstack/cli`
`migrate-meta-engine-guidance` `Tests 3 passed (3)` after a spec build;
`check:generated`, `check:upgrade-guide`, `check:spec-changes`,
`check:docs`, `check:doc-authoring`, `check:strictness-ledger`,
`check:liveness`, `check:nul-bytes`, `check-adr-0087-registration --base
origin/main`, `check-changeset-no-major --base origin/main`: all exit 0;
overlap-check clean.
The rest at head `94e3b6a8` unless named; commands ran through
`scripts/pm/os-verify-lock.sh` (verdict line `command-exit 0`).
- `@objectstack/spec` targeted (`src/ui src/conversions src/migrations
src/shared src/system/metadata-form-zod-reconciliation.test.ts
scripts/strictness-ledger.test.ts`): `Test Files 254 passed (254)`,
`Tests 8682 passed (8682)` at `4467e71c`; re-run of
`src/ui/view-column-state-retirement.test.ts src/migrations` at head:
`Test Files 6 passed (6)`, `Tests 214 passed (214)` (the only later spec
edit is the D3 entry's prose).
- `@objectstack/metadata-protocol`
(`protocol.graft-folded-form-sections`, `protocol.save-union-issues`,
`metadata-diagnostics.union-issues`): `Test Files 3 passed (3)`, `Tests
98 passed (98)`.
- `@objectstack/cli` `test/migrate-meta-engine-guidance.test.ts`: `Tests
3 passed (3)` (it first caught a tracker id in the D3 guidance, fixed in
`94e3b6a8`).
- ui: `packages/data-objectstack/` whole package `Test Files 125
passed`, 1 failed before the pin edit, then the edited file green; the
26 app-shell / plugin-list / plugin-grid / plugin-detail / react /
components test files that name `columnState`,
`VIEW_CONSOLE_ROUND_TRIP_KEYS`, `buildViewConfigSaveBody` or
`sanitizeViewOverride`, plus the edited roundTripKeys file: `Test Files
27`, 1 failed (the envelope pin) then green after the edit; at head the
envelope file `Tests 4 passed (4)`.
- Full app-shell, full spec and every other importer of
`@objectstack/spec`: CI (`Test Core`, `Test UI`) at `94e3b6a8`.
<details><summary>Derived gate list (dispatch-gates --commands, 124
commands)</summary>
123 commands derived at `4467e71c` ran; 116 exit 0 on the first pass.
The seven others:
- `check:strictness-ledger` and `check:generated` (the same drift): red,
real — `view.zod.ts` strip sites 2 → 1; counts regenerated and the
ledger row's Class cell updated in `fd4fcaf5`; green at head.
- `check:test-source-alias`: red, real — the two edited test files reach
`import('@objectstack/lint')`; a module-top side-effect import added to
each; green at head.
- `@objectstack/cli` `migrate-meta-engine-guidance`,
`check:skill-examples`, `check:dual-build-cjs-loads`: PREREQUISITE NOT
MET (no built dist); after building the closure, `check:skill-examples`
and `check:dual-build-cjs-loads` exit 0 and the cli test was the real
red named above.
- `check-plugin-teardown-shape.mjs --self-test`: exit 3, cannot read its
positive-control commit in this shallow clone — NOT MEASURED locally, CI
runs it.
Re-run at head `94e3b6a8`, all exit 0: `check:durability-log-level` (new
at head), `check:generated`, `check:strictness-ledger`,
`check:api-surface`, `check:authorable-surface`, `check:spec-changes`,
`check:upgrade-guide`, `check:docs`, `check:variant-docs`,
`check:liveness`, `check:test-source-alias`, `check:doc-authoring`,
`check-adr-0087-registration --base origin/main`,
`check-changeset-no-major --base origin/main`, `check-empty-changeset
--base origin/main`, `check:nul-bytes`,
`check:cross-package-test-inputs`, `check-platform-checklist
--changed-from origin/main`.
</details>
- Full dogfood (owed: `!` title and a `(narrowing)` arm) at the current
head `2fff67a6`: `pnpm --filter @objectstack/dogfood test` under the
lock, `VERDICT command-exit 0`, `Test Files 485 passed | 3 skipped
(488)`, `Tests 4108 passed | 68 skipped (4176)`, no failures (the same
figures as the earlier run at `94e3b6a8`).
## Acceptance notes
- **Census at `main` 97b9d1e** (read-only, accepted by the seat): no
writer of the view-row key. The overlay writer retired with
objectui#12504; since #35955 a column drag goes to the list draft
(`listDraftStore.ts`) and widths to the browser layout store. Residual
readers of rows at rest:
`ui/packages/app-shell/src/views/objectViewListRenderer.tsx:787`
(`(viewDef as any).columnState ?? (listSchema as any).columnState`
fallback rung) and `@object-ui/data-objectstack`'s
`VIEW_OVERLAY_OWNED_KEYS` (narrowing of old overlay rows). After this PR
every stored row is served without the key, so both read `undefined`.
The renderer rung is a dead fallback, filed with the rest of the `ui/`
residue (`VIEW_OVERLAY_OWNED_KEYS`' entry and its docblock,
`objectViewTabs.ts:502`) as #36445, blocked by this PR (#36370 is in the
renderer file). `ObjectGrid` / `ListView` / `RelatedList` `columnState`
props and `RecordPagePreferences.columnState` are runtime and
user-preference shapes, not the view key, and are untouched. HotCRM, the
gallery, docs.objectos.ai and `skills/**`: zero hits (hence
`Skills-docs: none`).
- **Liveness ledger**: no row owed. `liveness/view.json` walks
`ViewSchema` (the container) one level deep; the wire members are not in
its shape (the `owner` / `hidden` precedent had none either).
- **No tree-scoped absence pin**: the bare name `columnState` stays live
as the grid's runtime prop across `ui/packages`, so an absence pin on it
could not tell the retired key from the live prop; the tombstone keeps
the key in the walked shape, and `tsc` types it `never` on every
authoring site.
- **ADR-0005 line 388** names the key in a dated reading ("a reading at
`origin/main` `c9c182ed`; the record, not this list, is the authority").
`docs/adr/**` is governed and is left as written (seat ruling).
- **Residue**: a stored overlay row holding only identity plus
`columnState` (and no `_isOverride` marker) strips to identity only,
which the door refuses. Stated in the D2 docblock, the D3 acceptance
criteria and the changeset, and pinned.
## Verification
Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
src/ui/view-column-state-retirement.test.ts`; expect 15 tests green,
among them a stored overlay row with `columnState` rehydrating without
it and a fresh one refused with the `` `view.columnState` was removed in
@objectstack/spec 18.7.0 `` prescription.
Read first: `packages/spec/src/ui/view.zod.ts` (the two tombstone sites
and `VIEW_COLUMN_STATE_RETIRED`),
`packages/spec/src/conversions/entries/18/view-column-state-removed.ts`
(the record vs overlay discriminator),
`packages/spec/src/migrations/entries/semantic/18.view-column-state-retired.ts`.
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jT24Rn8qK81aEFebXj
<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jT24Rn8qK81aEFebXj -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(spec)!: retire `columnState` from the stored `view` row — column widths live in each reader's browser and a column order is saved into the view itself
6
+
7
+
Clause-②: no (narrowing) — `columnState` stops being an accepted key on a view item record and on a flattened view overlay; no published export is removed
**BREAKING** for a stored `view` row, a package view or a source that still carries `columnState`. The key held the console grid's per-user column order and widths on a shared view row (admitted as a runtime-only overlay key in 17.1.0). Since #35955 nothing writes it: a column drag goes to the list's draft and is saved into the view's own `columns` / `fieldOrder`, and column widths are kept in the reader's browser, per view. Until this release a stored layout was still applied: a reader with no column order or widths of their own in the browser saw the order and widths the row held. It is not carried forward (the maintainer's ruling on #35955, restated on #36403 in comment 7079029398: a stored layout is not migrated): from this release that reader sees the view's own columns, column order and widths. No stored order is moved into `fieldOrder`; to keep a layout for everyone, reorder the columns and Save to the view, or set `width` on the columns.
13
+
14
+
What moves (each line FROM → TO):
15
+
16
+
-`columnState` on a view item record (`ViewItemWireSchema`, member 1 of the `view` union the `PUT /api/v1/meta/view/:name` save validates) and on a flattened view overlay (`VIEW_METADATA_MEMBERS.listOverlay` / `formOverlay`): FROM `{ order?: string[]; widths?: Record<string, number> }` accepted and stored TO a `retiredKey()` tombstone — the save answers 422 `INVALID_METADATA` with the prescription at the key, and `tsc` types the key `never`.
17
+
-`VIEW_CONSOLE_ROUND_TRIP_KEYS` (`@objectstack/spec/ui`): FROM six keys TO five; `columnState` is gone, so the console derivations read off it (`@object-ui/data-objectstack`'s `listViews()` row keys, `@object-ui/app-shell`'s view-config save) stop carrying it without an edit.
18
+
-`columnState` on an authored view item or a list view body: still refused by name, now with the retirement text instead of the runtime-only note.
19
+
- a stored `view` row (every read replays the conversions before the row is served or badged), a package export or environment artifact (`viewItems`), and a source run through `os migrate meta --from 17`: the D2 conversion `view-column-state-removed` deletes the key from a view item record and from a flattened overlay; containers are untouched.
20
+
21
+
The fix: delete the key. To ship a default column order, list `columns` in that order (or set `fieldOrder`); to ship a default width, set `width` on the column. Run `os migrate meta --from 17` to list the mechanical edits for existing sources, and `os migrate meta --stored --apply` to rewrite stored rows.
22
+
23
+
One stored class is not brought back into the accept set: an overlay row that held nothing but its identity (`name` / `object` / `viewKind` / `label`) and `columnState` — what a column drag on a system view wrote before the overlay writer retired — is left identity-only, which the `view` door refuses ("only identity fields"). It is served badged invalid and `--apply` reports it `failed`. Delete such a row; it held only a column layout that is not carried forward. D3 entry: `view-column-state-retired`.
24
+
25
+
The retirement kit: `retiredKey()` tombstones in `ui/view.zod.ts`, D2 `view-column-state-removed` (step 18), `RETIRED_KEYS_BY_MAJOR[18]` rows `ui/ViewItemWire:columnState` and `ui/ViewMetadata:columnState`, D3 `view-column-state-retired`, the regenerated `view.mdx` reference, and the pin `ui/view-column-state-retirement.test.ts`.
Copy file name to clipboardExpand all lines: content/docs/references/ui/view.mdx
+2-16Lines changed: 2 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2338,7 +2338,7 @@ This schema accepts one of the following structures:
2338
2338
|**isPinned**|`boolean`| optional | Console round-trip: the view is pinned in the object's view switcher. Written by the console's pin toggle through the `view` metadata API and read back to draw the pinned group. Stored on the view's row, which has no per-user scope. Not authored. |
2339
2339
|**sortOrder**|`integer`| optional | Console round-trip: the view's position among the object's saved views in the switcher, 0-based and counted over saved views only (a code-defined view carries none). Written by the console's drag-reorder and read back to order the tabs. Not authored: `order` is the authored default position. |
2340
2340
|**visibility**|`Enum<'private' \| 'team' \| 'organization' \| 'public'>`| optional | Console round-trip: the group the switcher files this view's tab under (private, team, organization or public). Display grouping only, NOT access control: nothing restricts who can list or open the view by this value. No console control sets it; the console carries a stored value forward when it re-saves the row. Not authored. |
2341
-
|**columnState**|`{ order?: string[]; widths?: Record<string, number> }`| optional | Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored)|
2341
+
|**columnState**|`never`| optional |[REMOVED]`view.columnState` was removed in @objectstack/spec 18.7.0 (ADR-0049 enforce-or-remove) — it held one column order and set of widths on a shared view row; nothing writes it any more, and a stored layout is no longer applied, so every reader sees the view's own column order and widths. The console keeps column widths in each reader's browser and saves a column order into the view itself. Delete the key. To ship a column order, list `columns` in that order (or set `fieldOrder`); to ship a width, set `width` on the column. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.|
2342
2342
|**options**|`never`| optional | Refused: a view item record carries no top-level `options` bag. Its per-kind blocks live under `config` (`config.kanban`, `config.timeline`, …); the legacy `options.KIND` bag belongs to the flattened list overlay only. |
@@ -2408,13 +2408,6 @@ This schema accepts one of the following structures:
2408
2408
|**package**|`string`| ✅ | The base package id whose same-named item this item replaces whole (e.g. "com.acme.crm"). Only an item of the base's paired "`<base>`.custom" package declares an override. |
2409
2409
|**basedOn**|`string`| ✅ | Recorded, never a gate: the base package's `manifest.version` this override was taken from (e.g. "3.2.0"), not a history version of the item. Nothing is refused, merged or rebased on it; it tells a person re-basing the override where it started. One reader, as advice: a base's upgrade plan lists an override whose `basedOn` is not the installed base version as stale, beside each override whose base item the upgrade changes (ADR-0146 D2, as amended). |
|**order**|`string[]`| optional | Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored). |
2416
-
|**widths**|`Record<string, number>`| optional | Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored). |
2417
-
2418
2411
---
2419
2412
2420
2413
#### Option 2
@@ -2445,7 +2438,7 @@ This schema accepts one of the following structures:
2445
2438
|**isPinned**|`boolean`| optional | Console round-trip: the view is pinned in the object's view switcher. Written by the console's pin toggle through the `view` metadata API and read back to draw the pinned group. Stored on the view's row, which has no per-user scope. Not authored. |
2446
2439
|**sortOrder**|`integer`| optional | Console round-trip: the view's position among the object's saved views in the switcher, 0-based and counted over saved views only (a code-defined view carries none). Written by the console's drag-reorder and read back to order the tabs. Not authored: `order` is the authored default position. |
2447
2440
|**visibility**|`Enum<'private' \| 'team' \| 'organization' \| 'public'>`| optional | Console round-trip: the group the switcher files this view's tab under (private, team, organization or public). Display grouping only, NOT access control: nothing restricts who can list or open the view by this value. No console control sets it; the console carries a stored value forward when it re-saves the row. Not authored. |
2448
-
|**columnState**|`{ order?: string[]; widths?: Record<string, number> }`| optional | Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored)|
2441
+
|**columnState**|`never`| optional |[REMOVED]`view.columnState` was removed in @objectstack/spec 18.7.0 (ADR-0049 enforce-or-remove) — it held one column order and set of widths on a shared view row; nothing writes it any more, and a stored layout is no longer applied, so every reader sees the view's own column order and widths. The console keeps column widths in each reader's browser and saves a column order into the view itself. Delete the key. To ship a column order, list `columns` in that order (or set `fieldOrder`); to ship a width, set `width` on the column. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.|
2449
2442
|**options**|`never`| optional | Refused: a view item record carries no top-level `options` bag. Its per-kind blocks live under `config` (`config.kanban`, `config.timeline`, …); the legacy `options.KIND` bag belongs to the flattened list overlay only. |
@@ -2491,13 +2484,6 @@ This schema accepts one of the following structures:
2491
2484
|**package**|`string`| ✅ | The base package id whose same-named item this item replaces whole (e.g. "com.acme.crm"). Only an item of the base's paired "`<base>`.custom" package declares an override. |
2492
2485
|**basedOn**|`string`| ✅ | Recorded, never a gate: the base package's `manifest.version` this override was taken from (e.g. "3.2.0"), not a history version of the item. Nothing is refused, merged or rebased on it; it tells a person re-basing the override where it started. One reader, as advice: a base's upgrade plan lists an override whose `basedOn` is not the installed base version as stale, beside each override whose base item the upgrade changes (ADR-0146 D2, as amended). |
|**order**|`string[]`| optional | Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored). |
2499
-
|**widths**|`Record<string, number>`| optional | Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored). |
0 commit comments