Skip to content

feat(console): keep list column widths, row height and tab order in this browser only - #36133

Merged
objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-j9w929
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 10 commits into
mainfrom
claude/project-thread-j9w929

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #35955

What changes

On a Console object list, the column widths, the row height and the order of the view tabs are now kept in the reader's browser only. The Console no longer reads or writes the per-user list preference row sys_user_preference ui.list.<object>.

  • New ui/packages/app-shell/src/views/listLayoutStore.ts: one localStorage entry per signed-in reader and object, list-layout:<user id>:<object>, holding viewOrder and per view widths / rowHeight and nothing else. With nobody signed in there is no key: nothing is read or written. Built on useSyncExternalStore, so every reader of the same object sees a write at once.
  • The keys an earlier Console wrote list state under (list-state:*, the cache of the retired server row; list-filters:*; the bare viewOrder:*) are removed once per page load and never read. What they held is not carried over.
  • ListPreferencesProvider is deleted; ConsoleShell no longer creates or attaches the ui.list. family, and UserStateAdapters drops its list-state slot. The boot read of the reader's preferences now asks for the four keys and the ui.record. prefix only.
  • The list no longer waits for a preference read before it mounts (the object-view-list-preferences-pending placeholder is gone).
  • listFilterStorage.ts is deleted: writeListFilterState had no caller (F4 of the card).
  • The relay-shape types the list draft uses (ListViewPreference and friends) move into listDraftStore.ts.
  • RecordPreferencesProvider (ui.record.*) is untouched.
  • Docs: content/docs/ui/views.mdx says the layout stays in this browser. The platform checklist items records-forms.adhoc-filter-sort-builder (rev 14) and records-forms.grid-personalization (rev 10) are re-pointed; the latter now reads that widths and row height do not follow the reader to a fresh browser (Sales ruling D1 on 在列表上的改动都改成临时的(排序、筛选、分组、列的显示和顺序):立即生效但不保存,出现「放弃」和「保存」;列宽、行高、标签页顺序只记在浏览器里;退掉服务端的个人列表偏好 #35955).
  • Comment and README fixes in @object-ui/data-objectstack, @object-ui/react and @objectstack/platform-objects that named the retired key.

Not in this pull request:

Why

Card #35955 (epic #35547): a list change is a draft, and what never becomes a draft (widths, row height, tab order) is arranging only, so it stays in the reader's browser and never reaches another user, device or browser.

Verification

  • The 13 changed or rewritten test files pass: 177 tests (pnpm --dir ui exec vitest run …). They include listLayoutStore.slot-35955.test.tsx (sanitize, patch, localStorage-only writes with no request, cross-instance sync, entry removal, no entry while signed out, retired-key sweep), ObjectView.userListState-12418.test.tsx (40 cases on the real page, writes recorded at the storage door), signOutPurge.test.tsx and consoleUserPreferenceBudget.test.tsx (one read, no ui.list. prefix, no ui.list.* write).
  • @object-ui/app-shell type-check (tsc --noEmit and tsc -p tsconfig.test.json) passes.
  • ESLint on the changed files: 0 errors.
  • node scripts/check-platform-checklist.mjs: OK.
  • The full @object-ui/app-shell suite runs in CI (Test UI).

Tests rewritten because the provider they drove is gone:

  • ListPreferencesProvider.slot-12418.test.ts → views/listLayoutStore.slot-35955.test.tsx.
  • ObjectView.userListState-12418: the provider and family harness is replaced by a seeded localStorage entry. "Waits for the read" cases are gone. The 500 ms debounce case is replaced by "re-stating a width just written sends no second write". The provider-less CONTROL block now pins the retired-key sweep.
  • ObjectView.personalViews-29635 (Opening a personal view sometimes writes the default view's filter and sort into the address bar, and a reload or a shared link then applies them #30034): the default view's state is a held draft, so the second read is gone. The "reverse order" case becomes "the personal views read landing at once".
  • signOutPurge: the server-save-before-sign-out case is gone, since there is no server save. The sign-out sweep cases now cover list-layout:*.
  • consoleUserPreferenceBudget, ObjectView.listPersonalized-28950, ObjectView.listUrlState-11860, ObjectView.ufViewSwitch-11992, ObjectView.emptyColumnsNoProjection-10694, objectViewViewCrud.draftBarChange-35932 and ObjectView.overlayPatchOnly: the harness or source pin is updated.

Overlap: merges cleanly with main. It textually overlaps #36123 (PR2 of the same card) and #36128. Whichever of PR2 and this one lands later merges main.

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUkr3W7rNEqPk3J858

This pull request keeps the browser side only. The cleanup command follows once it merges.

Claude-Session: https://claude.ai/code/session_01L6bhgUkr3W7rNEqPk3J858
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 3 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 5e8e24302dca5cf4dbda2b97dca4c732c022e7b6 → packageMentionDocs.

…-j9w929-wt

# Conflicts:
#	ui/packages/app-shell/src/views/objectViewListRenderer.tsx
…-j9w929-wt

# Conflicts:
#	docs/qa/platform-checklist/areas/records-forms.json
#	ui/packages/app-shell/src/views/ObjectView.tsx
#	ui/packages/app-shell/src/views/listDraftStore.ts
#	ui/packages/app-shell/src/views/objectViewListRenderer.tsx
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT (L1-b)

Head-sha: 75e68ba · read 2026-11-22T00:42Z · first full read (no prior L1-b record on this PR) · L1 is final on this head (Clause-② no, no L2 per seat)

维护者速读

这是 #35955 第三步的浏览器部分:列表的列宽、行高和视图页签顺序以后只记在当前浏览器里(按登录用户和对象分开),不再存到服务器的个人偏好里。用户会看到的变化:列表打开不再等服务器读偏好,直接显示;换一台电脑或换一个浏览器,列表按视图自己的列宽、行高和页签顺序打开(这是 Sales 在 #35955 上定的 D1);退出登录照旧清掉这些记忆(保留同一人记忆是后续卡 #36110)。升级代价:老版本存过的列宽、行高、页签顺序不迁移,大家会回到视图默认,需要重新拖一次;浏览器里旧的 list-state:*、list-filters:*、viewOrder:* 在第一次打开列表时删除。服务器上旧的偏好行这次不删,只是不再读,由后续的命令 PR(os migrate list-preferences)处理。没有元数据键、值或默认值变化。

Must-fix

None.

Should-fix

None.

Nits (no change needed to land)

  • N1 ui/packages/app-shell/src/views/listLayoutStore.ts:297: clearRetiredListStateKeysOnce() runs in the hook's render body, so the sweep is a side effect of render. It is guarded by a module flag, idempotent and only removes keys nothing reads, so StrictMode double render and concurrent rendering are harmless. Moving it into a one-time effect or module init would be tidier, not needed.
  • N2 Changeset "Upgrade note": "The server rows stay where they are, unread" is true for this PR. When the command PR lands, its own changeset should say the operator command is how those rows are removed; nothing to change here.

Checked

  • l1-face CLEAN; CI on 75e68ba: 61 success, 9 skipped, 0 failing.
  • git merge-tree --write-tree --name-only origin/main 75e68ba5: clean; origin/main is af2361e, the merge base, so the PR diff read is exactly af2361e..75e68ba (35 files, +1124/−1824).
  • New store listLayoutStore.ts: key list-layout:<userId>:<object>, null with no user or no object (no anon key, per the 14:40Z ruling); values pass sanitize (widths positive numbers, spec rowHeight vocabulary, non-empty string view ids; every retired part such as sort, filters, column order, hidden/added columns dropped); writeListLayout removes an empty entry and notifies; reads through useSyncExternalStore with raw-text snapshots; no network. Slot test listLayoutStore.slot-35955.test.tsx pins each of these, including a fetch spy that is never called.
  • Retired-key sweep: list-state:, list-filters:, viewOrder: were written only by the Console's own removed ListPreferencesProvider and listFilterStorage; other keys (locale, another object's list-layout:) survive, pinned.
  • Every write site moved: objectViewListRenderer (column widths, density, reset of rowHeight), objectViewViewCrud (Manage Views drag → setViewOrder), ObjectView (view order sort key, draftPreferenceOf). listDraftPreference now reads ListViewLayout widths/rowHeight; shape types moved into listDraftStore.ts with personalViews.ts and objectViewListUrlState.ts re-pointed. The listPrefs.ready gate is gone from the renderer and the seed, so the list no longer renders a pending placeholder; the seed still waits on viewResolving.
  • ConsoleShell / UserStateAdapters: ListPreferencesProvider and the ui.list. family are no longer attached; the boot read keeps the four keys and the ui.record. prefix (consoleUserPreferenceBudget pin re-pointed to say ui.list. is never asked for). RecordPreferencesProvider unchanged in behaviour.
  • Walled posture pin consoleListStateWall-12418: sort and drag put no write of any kind on the wire, order lands in the layout entry; density likewise.
  • Sign-out: signOutPurge.test.tsx shows list-layout:* and the old keys are removed by Log out, matching the changeset and the 14:40Z ruling (same-person keep is Console sign-out keeps the list layout (column widths, row height, tab order) for the same person; a change of user still clears it #36110).
  • Repo-wide grep at head for ListPreferencesProvider|listFilterStorage|useObjectListPreferences|LIST_PREFERENCE_PREFIX|useAttachListStateFamily: no hit. Remaining ui.list. / list-state: hits are the docs and changeset history sentences, tests that seed the retired keys to prove they are swept or ignored, and the generic key-family adapter test in data-objectstack (adapter behaviour, not a Console caller).
  • Docs read sentence by sentence: content/docs/ui/views.mdx and the changeset agree with the code (browser-only, per user and object, nothing sent, another device opens the view's own, sign-out clears, no carry-over, old browser keys removed on first list); data-objectstack README and userState.ts examples now use ui.record..
  • Checklist records-forms.json, every clause of both touched items re-read:
    • adhoc filter/sort builder: rev 14 stays PR 2's entry, rev 15 is this PR's (steps[4], steps[5], acceptance[3] verify, source[1]); no clause left naming the retired row as a store or ListPreferencesProvider.
    • grid personalization: rev 9 → 10; steps[2], acceptance[1] verify, acceptance[4] clause/verify/evidence, source[2] re-pointed; the fresh-browser clause is flipped on purpose and the history says "Changed on purpose ... Sales ruling D1", which is the honest record (not presented as not-loosened).
  • Merge resolutions: ObjectView.sharedViewSave-35955.test.tsx seeds the reader's row height through listLayoutStorageKey('u1', OBJECT) and resets the layout store; PR 2's assertion that the saver's row height stays theirs is unchanged.

Owed

…-j9w929-wt

# Conflicts:
#	ui/packages/app-shell/src/views/listDraftStore.ts
#	ui/packages/app-shell/src/views/objectViewListRenderer.tsx
…n the shared-view footer case

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — merge-only ACCEPT (L1-b)

Head-sha: bb99349 · read 2026-11-22T01:36Z · prior record ACCEPT 7071736973 @75e68ba5 · delta = main merge 4a50bbb (main 5e8e243, #36212 footer calculations as a draft part) + test commit bb99349

维护者速读

这次只是把 #36212(底部统计进草稿)合进来,再修一个测试。合并时有三处冲突,处理方式都只是两边并存:草稿里有了底部统计,列宽、行高、页签顺序仍然只记在浏览器里。用户看到的行为和上次审过的一样,没有新增功能,也没有新的风险。

Must-fix

None.

Should-fix

None.

Nits

None.

Checked

Owed

  • Green CI on bb99349 (the seat reads it before landing).
  • PR3b (os migrate list-preferences) as its own PR after this merges.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-22T02:00Z · #35955 PR 3a, browser side: list column widths, row height and tab order are kept in this browser only, under one user-keyed list-layout: key (maintainer A+A, 7064104023 thread record); the server ui.list.<object> preference family is no longer read or written by the console. The sign-out clear is unchanged (#36110 follows). The operator command that removes stored ui.list.* rows (PR 3b) comes as its own PR after this one, with its own L2.

Reviews:

Gates on this head (bb99349c):

  • check-governed-merges --pr 36133 reads NOT governed (2,952 changed lines, under 3,000).
  • K = 1 first-parent commit since the merge base; no translations/ or skills/ path.
  • All check-runs on their latest runs are success (61) or skipped (9); mergeable clean.

The seat readies this PR and arms auto-merge in the same step. The PR carries Part of #35955; the card stays open for PR 3b.

Merged via the queue into main with commit a5a5312 Nov 22, 2026
71 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-j9w929 branch November 22, 2026 02:30
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…tup, prefill Set Manager, add Remove Manager (objectstack-ai#36162)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XP3RHGWUG7UH3fNa4tBa9UC)_
Fixes objectstack-ai#36017

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:平台管理员在 Setup → 用户 →
打开某个用户时,详情页新增「汇报关系」一栏显示其经理、「直接下属」列表显示向其汇报的人;「设置经理」对话框打开时预先填好当前经理;新增「移除经理」按钮可清空经理(仅在该用户确有经理时出现)。
- 为什么做:外部开发者反馈,管理员设置经理后在界面上找不到读回的地方,也无法把误设的经理移除;这影响审批路由与团队可见范围的维护。
-
出错会怎样:最坏情况是管理员看到的经理/下属显示不准,或移除失败并看到服务端的拒绝提示;写入仍只经过原有的管理员接口,所有拒绝规则不变,改动可整体撤回。
- 要你做什么:无

## What changes

An admin who set a user's manager could not read it back anywhere in
Setup (the value was stored correctly; the card measured it over the
data API). Four parts, each on an existing declared mechanism, no spec
key added:

1. **Details → Reporting Line** section names `manager_id`
(`packages/platform-objects/src/pages/sys-user.page.ts`). The field
stays `readonly: true` (ADR-0092 D4); it is shown, not edited. Named
"Reporting Line", not "Organization": the reporter mistook the
Organizations tab (membership) for the org structure, and a section
called "Organization" would repeat that. `primary_business_unit_id`
(same field group) is deliberately left out: it is plugin-sharing's
projection of `sys_business_unit_member.is_primary`, and the Business
Units tab already lists the source rows with their primary flag.
2. **Details → Direct Reports**: a `record:related_list` of `sys_user`
on `relationshipField: 'manager_id'` (parent value `id`, the props
default). It is read-only by construction: `sys_user` opens no create or
delete (`userActions: { edit: true }`, `apiMethods` without
create/delete), so the host offers neither New nor Remove. Labels in the
page's 11 locales.
3. **Set Manager opens on the current manager**: the `managerId` param
is now field-backed on `manager_id` with `defaultFromRow: true` (the
existing key; precedent `sys_team_member`'s `teamId`). Measured: the
console's resolver (`ui/packages/fields/src/resolveActionParams.ts`)
seeds from `field ?? name` and carries type, target and label but never
`readonly`, and `paramToField` builds the widget without it, so the
picker stays editable. The record header stamps its record as the row; a
list row is projected with every `defaultFromRow` seed field
(`@object-ui/core` `listViewPredicates`). Request body unchanged: `{
userId, managerId }`.
4. **Remove Manager** (`remove_user_manager`, new action): posts the
same endpoint with `bodyExtra: { managerId: null }` (the existing
static-body key, merged last at both doors). Same `requiredPermissions`
and the same standing term as Set Manager, then `has(record.manager_id)
&& record.manager_id != null`, so it is only offered while there is a
manager to remove (the Ban / Unban row-state pattern). `confirmText`, no
params, no `ai` block (an action after the ADR-0011 assessment stays
human-only). ⛔ No client-side copy of any endpoint refusal (ruling
record 6895645364 option A); the SCIM-held refusal applies to the clear
at the endpoint.

Decision batch objectstack-ai#127 item 1 is untouched: the manager is
`sys_user.manager_id` alone; nothing reads or derives a business unit
head.

## Tests

- `packages/platform-objects/src/pages/sys-user-details-tab.test.ts`:
the section list (Reporting Line added) and a new top-level describe:
the Details section holding `manager_id`, the Direct Reports list on
`sys_user` / `manager_id` / parent value `id` (read through
`RecordRelatedListProps`), labels in the tab's locales.
-
`packages/platform-objects/src/identity/sys-user-set-manager-action.test.ts`:
the param is field-backed + `defaultFromRow` (replacing the old INLINE
pin, whose read-only rationale was measured false), and a new describe
for `remove_user_manager`: `bodyExtra` equal to `{ managerId: null }`
with the key present, no params, `confirmText`, gate keys equal to Set
Manager's, the standing term first, the only record column read is
`manager_id`, offered/hidden verdicts through the CEL engine, no `ai`
block.
- `packages/runtime/src/platform-admin-action-gate.test.ts`: a new
describe driving the real declaration through the REST action door: an
admin's click is forwarded to `/api/v1/auth/admin/set-user-manager` with
`userId` and `managerId` present and null; a plain member is refused 403
and nothing is forwarded.

Ablation (one-shot, through `scripts/ablation-replace.mjs`, src-resolved
in both suites): deleting the `bodyExtra` line turned the runtime door
test and the platform-objects declaration test red; restore proven (blob
== HEAD, `git diff HEAD` empty).

## Acceptance notes

- The record page reads the manager through the console's own read path
(list route, `filter` by id, `populate=manager_id`), measured on a
booted showcase: the populated `manager_id` comes back as the manager's
record with `name`. The painted Console page was not observed in a
browser (Console build not run); the details renderer's lookup display
is pre-existing behaviour.
- `sys-user-set-manager-action.test.ts` previously pinned the param
INLINE because a field-backed param "may render read-only". Measured on
`ui/` at this tree: neither `resolveActionParams` nor `paramToField`
carries `readonly` onto a param. The comment and the pin are rewritten
with that reading.
- Open PR objectstack-ai#36133 also edits `sys-user.page.ts`; `overlap-check` reports
it merges cleanly with this branch.

## Verification

- Two-minute check: `pnpm --filter @objectstack/platform-objects exec
vitest run --maxWorkers=2 src/pages/sys-user-details-tab.test.ts
src/identity/sys-user-set-manager-action.test.ts` → 2 files, 25 tests
pass.
- Read first (by risk):
`packages/platform-objects/src/identity/sys-user.object.ts` (the
`remove_user_manager` block and the `set_user_manager` param),
`packages/platform-objects/src/pages/sys-user.page.ts` (the Details
tab), `packages/runtime/src/platform-admin-action-gate.test.ts`.

<details><summary>Local readings at head 30de59a</summary>

- `pnpm --filter @objectstack/platform-objects typecheck` + `pnpm
--filter @objectstack/runtime typecheck` (with their
`check:test-typecheck`): exit 0, under the verify lock (VERDICT
command-exit 0).
- `pnpm --filter @objectstack/platform-objects exec vitest run
--maxWorkers=2`: Test Files 125 passed (125), Tests 2126 passed (2126).
- `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2
src/platform-admin-action-gate.test.ts`: Test Files 1 passed (1), Tests
18 passed (18).
- `pnpm check:i18n`: all ten extract packages in sync after `node
scripts/check-i18n-bundles.mjs --write`; the ten translated locales
carry hand-written `remove_user_manager` strings (their source-hash
entries dropped by the next extract).
- Derived gate families (`dispatch-gates.mjs --commands`, 67 with the
changeset families): exit 0 except three NOT MEASURED, each a
prerequisite refusal (exit 3), not a finding:
`check-plugin-teardown-shape.mjs --self-test` (shallow clone cannot read
its pinned fixture commit), `check:dual-build-cjs-loads` (needs the
whole workspace built), `check:type-check-debt` (verify-lock queue
timeout). CI runs all three.
</details>

<details><summary>Booted showcase, server-side measurement (own port,
torn down)</summary>

- Set Manager through the action door with the field-backed param:
`{"success":true,"data":{"userId":"usr_showcase_auditor_demo","managerId":"…","setBy":"…"}}`.
- `GET
/api/v1/data/sys_user/usr_showcase_auditor_demo?expand=manager_id` and
the console's list read (`filter` id, `populate=manager_id`):
`manager_id` comes back as the manager's record, `name: "Dev Admin"`;
without expansion it is the bare id.
- Direct Reports read (`filter manager_id = admin id`): 2 rows; control
(`manager_id = Ada`): 0 rows.
- Served `sys_user` metadata keeps `bodyExtra: {"managerId": null}` and
the param's `field` + `defaultFromRow`; served `sys_user_detail` carries
Reporting Line, Direct Reports and `relationshipField: manager_id`.
- `POST /api/v1/actions/sys_user/remove_user_manager`:
`{"success":true,"data":{"userId":"usr_showcase_auditor_demo","managerId":null,…}}`;
afterwards `manager_id` reads `null` and the admin's reports drop to 1.
</details>

---

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… drawer; lookup cells draw an edit button (objectstack-ai#36015) (objectstack-ai#36128)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuLB1HMq57UcoRZFjpa8YhHZ)_

repo:objectstack#1 · os-sales · session_01L6bhgWkLah49N6UoD4CS3S

Fixes objectstack-ai#36015

The card's 11:13Z revision (maintainer: 「同意,改卡」): a single click on a
lookup chip opens that record in the side drawer, and a lookup cell has
a pencil button. objectstack-ai#36033 landed the rest of the card with `Refs objectstack-ai#36015`;
this PR is the lookup-cell part and closes the card.

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

- 列表里单击关联记录的小标签(比如联系人列表里的「客户」),右侧抽屉打开那条记录,列表不动。关掉抽屉后,滚动位置和选中的格子都还在。
- 点格子里小标签旁边的空白,只是选中这一格。一格里有几个标签,点哪个开哪个;选中后按 Ctrl+Enter / Cmd+Enter
在抽屉里开第一个;按住 Ctrl / Cmd 点,仍是新标签页整页打开。
-
关联格在鼠标移上去或已选中时,右边出现铅笔按钮,点了进入编辑(出现关联记录选择器),和双击、回车一样。没有编辑权限、字段只读、记录被锁时不出现。这个位置原来放「打开」图标,关联格不再画它。
- 人员的小标签(负责人、创建人,指向 `sys_user`
的关联)不变:单击只选中,选中后有「打开」图标,没有铅笔。邮箱、电话、网址、名称列都不变。手机上照旧整页打开。
-
抽屉的网址带上了记录和它的对象(`?recordId=…&recordObject=…`):刷新后抽屉还在,按后退关掉抽屉,和名称列「在侧边打开」一样。
-
风险:改到五个包(字段格子、表格、网格、列表、控制台抽屉);给宿主加了两个可选接口,不传时行为和以前完全一样;没有新文案键(铅笔用已有的「编辑」`table.edit`)。

## What changes

On a grid with the select-first cell model whose host opts in (today the
console's list page), a **reference cell** is a column of `lookup`,
`master_detail` or `tree` type whose `reference` is not `sys_user`.

**`@object-ui/fields`: `index.tsx`**

- `ReferencedRecordLink`'s anchor carries `data-record-object` and
`data-record-id`, the record the chip names. Nothing else changes in its
markup or its click.

**`@object-ui/components`: `context/gridCellSelection.tsx`, `index.ts`**

- `GridCellSelection` gains an optional `referenceCells?:
GridReferenceCells | null`. `GridReferenceCells` (exported as a type) is
`isReferenceColumn(columnKey)` (asked per column on every render, so it
answers from the column alone) and `openRecord(objectName, recordId)`.

**`@object-ui/components`: `renderers/complex/data-table.tsx`,
`dataTableCellSelection.ts`**

- New `recordChipAt` / `firstRecordChip`: the record a chip
(`a[data-record-link][data-record-object][data-record-id]`) at or around
the target names.
- In a reference cell, the select-first `onClickCapture` that objectstack-ai#36033
added still cancels a plain click on the chip and selects the cell, and
then calls `referenceCells.openRecord` for the chip clicked. A click
beside the chips only selects. Ctrl, Cmd, Shift and Alt clicks, a
non-primary button and a touch tap pass through to the link as before.
- A double-click on a reference chip does not also edit the cell (its
first click opened the record).
- Ctrl/Cmd+Enter on a selected reference cell opens its first chip
through `referenceCells.openRecord`; every other cell keeps objectstack-ai#36033's
behaviour.
- New `CellEditButton` in every reference cell while no editor is open:
a pencil at the cell's right edge, labelled with the existing
`table.edit` key, shown on cell hover (`group-hover/cell`) and while the
cell is selected. Its click calls `attemptEdit`, the same gate
double-click and Enter pass through. It is drawn only when
`readOnlyReasonOf(row, col)` is `null`; that is asked when the pointer
enters the cell and when the cell becomes selected, never per render
(the `describeCell` contract). It takes no focus. A reference cell does
not draw objectstack-ai#36033's `CellOpenButton`.

**`@object-ui/plugin-grid`: `ObjectGrid.tsx`**

- New runtime prop `openReferencedRecord?: (objectName, recordId) =>
void`. With `cellSelection` and this prop, the grid's
`GridCellSelection` carries `referenceCells`: `isReferenceColumn` reads
the column's field (`opensReferenceInPlace`: lookup / master_detail /
tree, reference not `sys_user`), `openRecord` is the prop.

**`@object-ui/plugin-list`: `ListView.tsx`**

- New host prop `openReferencedRecord`, handed to the grid only
(`object-grid` views), as `recordLinkAdornment` is.

**`@object-ui/app-shell`: `urlParams.ts`,
`views/objectViewRecordNavigation.ts`, `ObjectView.tsx`,
`objectViewListRenderer.tsx`, `objectViewRecordOverlay.tsx`,
`recordDrawerStack.tsx`**

- New reserved URL param `RECORD_DRAWER_OBJECT_PARAM` (`recordObject`),
listed in `RESERVED_URL_PARAMS`: the object of the drawer root's record
when it is not the listed object.
- `handleOpenReferencedRecord(objectName, recordId)`: the listed
object's record opens as the name cell's 「在侧边打开」 icon opens it
(`?recordId=` only); another object's sets `?recordId=` and
`?recordObject=` (a push, so Back closes it). A chip clicked while the
drawer is open swaps its root.
- `drawerRoot` is that record when `?recordObject=` names another object
the console knows and the server reads one record of
(`servesRecordRead`); it has no sibling set, so the drawer draws no ↑ ↓
counter. Unknown or unread object: no drawer.
- Closing the drawer, the name cell's icon and the page origin a phone
redirect builds drop `?recordObject=` with `?recordId=`.
- The drawer's ⤢ at a root of another object opens that object's page
(`expandedRecordPath`); the listed object's root keeps its list-relative
route and origin.
- On a phone a `?recordObject=` link answers with that record's own
page, as `?recordId=` does for the listed object.
- `RecordStackDrawer` takes `listObjectName`; the list marks the root's
row as active only when the root is a record of the listed object.
- `ObjectView` passes `handleOpenReferencedRecord` only when its list
has the drawer (`navOverlay.mode === 'drawer'`, not a phone), the same
condition as `openInPanel`. A list whose rows open nothing (`none`, a
list-only object) keeps objectstack-ai#36033's behaviour: the chip only selects.

**Field types this reaches:** `lookup`, `master_detail`, `tree` drawn
through `LookupCellRenderer` / `ReferencedRecordLink`, when the
referenced object is routable from the list (the chip is an anchor only
then). A `user` field (`UserCellRenderer`, avatars) draws no link and is
untouched.

**Readings (claim A–G):**

- **A.** Only grids whose host passes `openReferencedRecord` (the
console's object list). Every other host keeps objectstack-ai#36033's behaviour.
- **B.** Ctrl/Cmd+Enter on a lookup cell opens its first chip in the
drawer.
- **C.** Person cells (lookups to `sys_user`) draw no pencil and keep
objectstack-ai#36033's open button.
- **D.** A chip clicked with the drawer open swaps the drawer's root, as
the name cell's icon does.
- **E.** A lookup to the listed object itself opens the listed object's
drawer, with `?recordId=` alone.
- **F.** A chip with no link (unroutable, unread, restricted or
name-only) only selects; an editable cell still draws the pencil.
- **G.** The drawer's record and object live in the URL, as `?recordId=`
does (ui `AGENTS.md` objectstack-ai#8).

Docs: `content/docs/frontend/plugins/plugin-grid.mdx` § On an object's
list page (new bullet after the click bullet; the click bullet objectstack-ai#36033
wrote now leaves out the lookup chip a host opens in place). objectstack-ai#36033's
changeset is untouched; this PR's own changeset says it (Notes, below).

## Notes

- **objectstack-ai#36033's pending release note is left as it is**
(`.changeset/36015-list-cell-click-only-selects.md`, restored from the
base in `87d42cbd`; head `b59bf991`..`9c225b51` had added a sentence to
it as a declared correction, which kept `Check Changeset` red). This
PR's own note, `.changeset/36015-lookup-chip-opens-in-drawer.md`, now
says what it changes about that note instead: "This replaces, for lookup
chips on that page, the earlier change in this release where a plain
click on a lookup chip only selected its cell." The docs bullet in
`plugin-grid.mdx` keeps the L1-b N1 rewording.

## Tests

Added, each a top-level `describe` in the component's existing harness
file:

- `components/src/__tests__/data-table-select-first-35684.test.tsx`, "a
reference chip opens its record in place": a plain click on the chip
calls `openRecord` with the chip's record, cancels the default and
selects the cell, and a double-click on it opens no editor; a click
beside the chip only selects, Ctrl and Cmd clicks follow the link;
Ctrl+Enter opens the first chip through the host; the edit button is
hidden until the pointer enters the cell, then shown on hover and while
selected, opens the editor, and the cell draws no open button; a cell
the host says opens no editor draws no edit button; a column the host
does not name (a person) keeps the link behaviour and the open button;
control: with no `referenceCells` the chip only selects and no edit
button is drawn.
- `plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx`,
"a lookup chip opens its record in the host's place": through
`ObjectGrid` with a routing host, the account chip carries
`data-record-object` / `data-record-id` and a single click calls
`openReferencedRecord('crm_account', 'a7')` without following the link;
the lookup cell's edit button opens its editor and the `owner_id`
(lookup to `sys_user`) cell draws none; a person chip only selects;
control without the prop.
-
`app-shell/src/views/objectViewRecordNavigation.listRows-27524.test.tsx`,
"a lookup chip opens the record it names in the list's drawer": the URL
params for another object and for the listed object, `drawerRoot` for
another object (no siblings), for an unknown object (`null`) and for the
listed object (siblings kept), close drops both params, ⤢ opens the
other object's page.

- After L1-b's S1 (fixed in `9c225b51`: a double-click on a chip opened
its record twice, so the console's router pushed the same URL twice and
the first Back left the drawer open). The grid opens a chip on a click's
first press only (`e.detail > 1` opens nothing), and
`handleOpenReferencedRecord` returns when the URL already names that
record of that object, which also covers a fast repeat click. Each test
below fails without the fix:
- `data-table-select-first-35684.test.tsx`, "a double-click on the chip
opens its record once": click, click (`detail: 2`), dblclick;
`openRecord` is called once and no editor opens.
- `objectViewRecordNavigation.listRows-27524.test.tsx`, "the record the
drawer already shows is not pushed again": no `setSearchParams` for the
record already shown, of another object or of the listed one; the same
id under another object still opens.
- same file, "in a router: a chip opened twice (a double-click) leaves
one history entry, and one Back closes the drawer": a declarative
`MemoryRouter` (it pushes on every navigate, the same URL included);
after two opens the URL names the record, and one `navigate(-1)` returns
to `?view=all`.

No existing test was rewritten or dropped.

Local runs. First on main `8145424b` merged with objectstack-ai#36033's head
`cefd3e31`, a full `pnpm build`:

- `vitest run packages/components/`: 501 files passed.
`packages/fields/`: 316 passed. `packages/plugin-grid/`: 298 passed.
`packages/plugin-list/`: 181 passed.
- `packages/app-shell/` in full did not finish inside this container's
50-minute window; the parts this diff touches ran:
`src/views/ObjectView*`, `src/views/objectView*`,
`src/views/__tests__/recordDrawer*`, `src/views/__tests__/recordPane*`,
`src/urlParams*`, `src/__tests__/`: 128 files passed.
- After objectstack-ai#36033 merged, the change was replayed on main `dc10b3b4` as one
commit (conflicts only in `objectViewListRenderer.tsx`'s memo
dependencies and the two appended describes of
`ObjectGrid.cellSelection-35684.test.tsx`, both sides kept), then a full
`pnpm build` and `vitest run` of `components/src/__tests__/data-table*`,
`plugin-grid/src/__tests__/ObjectGrid.cellSelection*`,
`app-shell/src/views/objectViewRecordNavigation*`,
`app-shell/src/views/__tests__/recordDrawer*` and `fields/src/`: 348
files passed (2 skipped).
- `type-check` in `components`, `fields`, `plugin-grid`, `plugin-list`,
`app-shell`: exit 0 (on both bases).
- `eslint` on the changed files: 0 errors.
- `overlap-check` on the pushed head `b59bf991`: clean against
`origin/main` (`dc10b3b4`, objectstack-ai#36033 merged) and the four open PRs sharing
a file (objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024).
- `87d42cbd`: `main` `6c7c6db2` merged in (clean).
`check-empty-changeset` and `check-changeset-no-major`: pass.
`overlap-check`: clean against `main` and objectstack-ai#36123; objectstack-ai#36133 (draft)
conflicts only on the one-line `useMemo` dependency list in
`objectViewListRenderer.tsx`, which each PR extends by one name; the
second to land merges `main`.

## Verification (browser)

CRM and Todo examples (`--fresh`), Console via Vite on this tree,
Chromium, 1280 light and dark, 375 light and dark. Screenshots and the
journey log: project folder `build-seat1/36015/PR2/` (`after-*`,
`after-journey.log`). The before state is objectstack-ai#36033's after state
(`build-seat1/36015/after-*`): a chip only selected its cell.

| Step | After |
|:--|:--|
| Contacts, hover the Account cell | pencil at the cell's right edge |
| Click the Acme Corp chip | drawer opens Acme Corp
(`?recordId=…&recordObject=crm_account`), the list stays, the cell is
selected |
| Close the drawer | params gone, the Account cell still selected |
| Click beside the chip | cell selected, nothing opens |
| Click the pencil | the lookup editor opens in the cell |
| Ctrl+Enter on the selected Account cell | drawer opens Acme Corp |
| Click the email text | cell selected, no navigation, open button in
the cell |
| Click the name | the contact's record page |
| Todo tasks, hover the Assigned To cell (lookup to `sys_user`) | no
pencil |
| Click the Dev Admin chip | cell selected, page stays, open button on
hover |
| 375 | phone cards (no grid), unchanged |

## Acceptance notes

1. Click a lookup chip: the drawer opens that record, the list stays,
closing it keeps scroll and selection: yes (browser).
2. Click beside the chip: the cell is selected, nothing opens: yes.
3. Hover a lookup cell: a pencil; it opens the cell's editor (the lookup
picker); none on a read-only field: yes (browser for the pencil and the
editor; read-only unit-pinned).
4. Person chips (owner): single click only selects: yes (browser, Todo's
Assigned To, a lookup to `sys_user`).
5. Ctrl/Cmd-click a chip opens the record in a new tab: yes (the click
passes through to the anchor; unit-pinned).
6. Email, phone, URL, Ctrl/Cmd+Enter on them and the name column:
unchanged from objectstack-ai#36033: yes.
7. This body lists the field types reached and the tests: above (none
rewritten).

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

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

https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgWkLah49N6UoD4CS3S -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…es and publishes it; layout and row colour join the list draft (objectstack-ai#35955 PR 2) (objectstack-ai#36123)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuG6LywHEovAnGuZpiKQEc2W)_

repo:objectstack#1 · os-sales · session_01L6bhgWyeXh2Keywo6oK1Nn

Part of objectstack-ai#35955 (PR 2 of three: PR 1 objectstack-ai#36026 made a list change a draft;
PR 3 retires the server-side list preference and runs in parallel. The
card stays open.)

Clause-②: yes (widening) — five new `console.objectView.draft.*` keys in
every `@object-ui/i18n` locale pack (`saveToViewConfirmTitle`,
`saveToViewConfirm`, `saveToViewConfirmButton`, `savedForEveryone`,
`pendingDraft`); `@object-ui/plugin-list` `ListView` gains the optional
host prop `onRowColorChange` and two optional `viewDefaults` members,
`viewType` and `rowColor`; nothing removed or renamed
Metadata-protocol: none

## 维护者速读

- 共享视图上,能改这个视图的人(管理员,且视图所在的包接受保存)在「保存
▾」里也看到「保存到这个视图」:先问一次「所有用这个视图的人都会看到」,确认后存并立刻发布,提示「已保存,所有人可见」。选项菜单里的「保存」同一条路。
- 这个视图已有没发布的修改(谁存的都算)时什么都不写,提示先去视图设置里发布或放弃;不替任何人发布。保存人的行高、列宽不会写进共享视图。
- 显示面板的「布局」「行颜色」现在也是草稿:点开记录再回来还在,两条「保存」都会存进去,「放弃」还原成视图自己的。

## What changes

**Save to this view on a shared view** (`ObjectView.tsx`,
`objectViewViewCrud.tsx`, `runtime-metadata-persistence.ts`)

- Offered when `canSaveToSharedView`: not an environment list, not a
personal view, and the same test the footer calculation's pick uses
(`isAdmin && !activeViewPackageRefusesSaves && isSavedViewId(savedViews,
id)`), so a read-only package's view and the fallback tab never get it.
A personal view keeps its own save. The phone / narrow `Save ▾` is the
same component; the options menu's Save calls the same handler.
- It asks once through `confirmHandler` (`saveToViewConfirmTitle` /
`saveToViewConfirm` naming the view / `saveToViewConfirmButton`, cancel
`console.objectView.cancel`).
- The body is the view's own config with the draft laid over it
(`layListStateOverView`, split out of `buildPersonalViewConfig`), then
`buildViewConfigSaveBody`, the body the view settings panel saves. The
reader's row height is left out (`rowHeight: undefined` on the laid
preference, F5); column widths never travel.
- New `saveAndPublishRuntimeMetadata(type, name, body, ctx)`: a draft
write with the first-write pin (`{ mode: 'draft', ifNoneMatch: '*' }`),
then `publish`. A `409 METADATA_CONFLICT` on the write means a draft is
already pending; it resolves `'pending-draft'` and nothing is written or
published. A publish the server refuses discards the draft this save
wrote (`reset(type, name, { state: 'draft' })`) and rethrows. Caches are
invalidated and the draft ledger announced on both paths.
- `handleViewSaveAndPublish` shows the saved body at once
(`setViewDraft`) and lets `handleDraftBarChange` drop it when the
saved-views re-read lands (objectstack-ai#36031), so the list does not flash the old
sort. On `'published'` the list draft is dropped (`handleResetView`) and
"Saved, visible to everyone" is toasted; on `'pending-draft'` the draft
stays and `pendingDraft` is toasted.
- Using the server's pin instead of a client read of the draft closes
the read-then-write window the premise read named (P4). The window left
is between this save's draft write and its publish: the view settings
panel writes its draft without the pin, so a settings save landing in
those milliseconds would overwrite this draft and be published with it.
A known edge, not closed here: card objectstack-ai#36137.

**Layout and row colour join the draft** (`objectViewListRenderer.tsx`,
`ListView.tsx`, `personalViews.ts`)

- The renderer wires the published `onViewChange` to `listDraft.patch({
viewType })` and the new `onRowColorChange` to `listDraft.patch({
rowColor })`; picking the view's own value drops the entry. The draft's
values go to `ListView` as `schema.viewType` / `schema.rowColor`, and
the view's own through `viewDefaults.viewType` /
`viewDefaults.rowColor`, so the `layout` / `rowColor` parts and the
Display count still judge against the view after a remount.
- `ListView`: `onRowColorChange` fires on a pick in the row colour panel
(the rule in force) and on Clear (`null`), never at mount or for a
reset. Each new `viewDefaults` member is read only when its key is
present; without them nothing changes.
- Both saves read them: `PersonalViewListState.display` carries
`viewType` and `rowColor`; a layout switch retypes the view and fills
the kanban / gallery mirror from the saved columns when the block lacks
one (`IN_PLACE_COLUMN_MIRRORS`). Save as my view builds from
`listDraft.draft.viewType ?? activeView.type` and passes the row colour.

**i18n**: the five keys in all ten hand-written packs; zh-Hant
regenerated (`pnpm gen:zh-hant`).

**Docs**: `ui/packages/plugin-list/README.md` (new host-props section),
`content/docs/ui/views.mdx` (§ "A user's list state never writes the
view"), `docs/qa/platform-checklist/areas/records-forms.json`
`records-forms.adhoc-filter-sort-builder` revision 14 (steps[8],
acceptance[5], negative[4]; not loosened).

## Tests

- New `ObjectView.sharedViewSave-35955.test.tsx` (8): confirm, then
`save(... { mode: 'draft', ifNoneMatch: '*' })` then `publish`, body
carries the draft sort and the view's own row height `short` while the
reader's stored one is `tall`; cancel writes nothing; pending draft (409
`METADATA_CONFLICT`) writes nothing more and toasts; refused publish
resets the draft; a read-only package's view is not offered; layout and
row colour laid into the schema and `viewDefaults` and kept across a
remount; picking the view's own value drops it; the save retypes to
kanban with its columns mirror and the row colour.
- `runtime-metadata-persistence.test.ts` (+4): published; pending-draft;
a `409` with another code (`DESTRUCTIVE_CHANGE`) rethrows; refused
publish resets and rethrows.
- `ListView.personalization-28950.test.tsx` (+4): the `rowColor` part
judged against `viewDefaults`, a control without them,
`onRowColorChange` on pick and on Clear (`null`), and no call at mount.
- `ObjectView.personalViews-29635.test.tsx` (+1): the draft row colour
reaches the personal save and Save as my view.
- L1-b S1 (`ObjectView.sharedViewSave-35955.test.tsx` +3,
`ObjectView.personalViews-29635.test.tsx` +2): the confirm and Save as
my view's default name read the view's tab label (`listLabel`,
`viewTabLabel`), with a view that has no label and one whose label is a
locale map (plus a plain-label control on the confirm). Ablated: the raw
label turns the locale-map confirm case and both copy-name cases red. In
the shared-view harness a stored view with no label already arrives
named by its name, so that case is a pin, not a discriminator.
- `ObjectView.listUrlState-11860.test.tsx` (+2, G2): a reload whose
address was rewritten before the seed applies its `uf_*` state; a reload
on a record page then Back applies the list entry's `uf_*` state. Pins
of current behaviour, no behaviour change.

## Acceptance notes

- P3 (seat 14:28Z): any pending draft refuses, the saver's own earlier
draft too; the server does not record a draft's author.
- F5: a shared save never carries the saver's row height or column
widths; a personal save still carries the row height, as on main.
- The view settings panel and the footer calculation still save a shared
view as a draft that the view settings publish (ruling 7045525672
unchanged).
- Not touched: where column widths, row height and the view order are
stored (PR 3).
- Landing order with objectstack-ai#36133 (PR 3): both bump
`records-forms.adhoc-filter-sort-builder` to revision 14 and edit the
same section of `content/docs/ui/views.mdx`. Whichever lands second
renumbers to 15 and merges the two history entries.
- L1-b N1 taken: the pending-draft test is `isDraftVersionConflict` from
`DraftConflictDialog.tsx`, the predicate the other draft-door callers
use.

## Verification

CI and local runs at head `da8b797b`; the S1 commit's tests and type
check at `0ada6797`.

- CI: every check green (54 passed, 10 skipped by path), mergeable
clean. The first head (`433d7c02`) went red on four pins, each fixed in
its own commit: the `rowColor` firing control in
`object-view-unmirrored-keys-7779.test.ts` now reads `const
viewOwnRowColor = viewDef.rowColor ?? listSchema.rowColor;` (the relay
reads the view's own rule once, so the draft's can lie over it); the de
quote-pair count in `de-quote-pairing-3876.test.ts` goes 120 to 121 for
`saveToViewConfirm` („{{name}}“); three `viewDefaults` equalities in
`ObjectView.userListState-12418.test.tsx` gain `viewType`; a checker
narrowing in the new test is read through a cast. No pin was loosened:
each asserts the same thing at the new spelling.
- Local (`pnpm --dir ui exec vitest run` over
`app-shell/src/views/ObjectView*`, `runtime-metadata*`,
`personalViews*`, `listDraft*`, `plugin-list/src/__tests__/ListView*`):
237 files, 2290 tests; the only 3 failures were the `viewDefaults`
equalities above, 40/40 after the fix. `packages/i18n`: 105 files, 1962
passed. `packages/types` 7779: 236/236.
- `pnpm --dir ui/packages/app-shell run type-check` exit 0; `pnpm --dir
ui/packages/plugin-list run type-check` exit 0 (both include
`tsconfig.test.json`).
- eslint on every changed `ui/` source and test: 0 errors.
`check:i18n-keys`, `check:i18n-drift`, `check:control-bytes`,
`check:vi-mock-specifiers`, `check:vi-mock-override-shape`,
`check:metadata-write-doors`, `check:changeset-claims`,
`check:pending-changeset-literals`, `check:readme-exports`,
`check:new-line-citations` exit 0; `node
scripts/check-platform-checklist.mjs` OK.
- `node scripts/pm/overlap-check.mjs --base=origin/main`: clean against
main `dc10b3b4` and open objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024.
- Clause-② measured on the built
`ui/packages/plugin-list/dist/ListView.d.ts`: `onRowColorChange` and the
two `viewDefaults` members are added, optional; no member removed or
narrowed. The seat runs the declaration L2.
- Browser, at `0ada6797` (showcase `objectstack dev`, the `ui/` HMR
console pointed at it; checklist
`records-forms.adhoc-filter-sort-builder` steps[8]), on a shared view
the admin created and published (`showcase_task.team_tasks`, package
`com.example.showcase.custom`):
- admin, sort by Priority: Save offers "Save to this view"; the confirm
reads "Everyone who uses “Team tasks” will see these changes.";
confirming sends `PUT
/api/v1/meta/view/showcase_task.team_tasks?mode=draft` with
`If-None-Match: *` (200) then `POST …/publish` (200) and toasts "Saved,
visible to everyone"; Discard and Save go.
- a second reader who is not an administrator (`phone.demo@example.com`)
opens the view sorted by Priority, and after a sort of their own is
offered only "Save as my view". Control: on the read-only package's
`showcase_task.in_progress` the admin is offered only "Save as my view"
too.
- with a draft of the view already pending, the admin's confirmed save
gets `409` on the pinned `PUT`, sends no publish, toasts the
pending-draft hint and keeps Discard and Save; the pending draft is
still there afterwards and the live view unchanged.
- Not driven in the browser: the row height (F5) and the layout and row
colour round trip, pinned in the unit tests above.

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

https://claude.ai/code/session_01L6bhgWyeXh2Keywo6oK1Nn

---
_Generated by [Claude Code](https://claude.ai/code)_
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgWyeXh2Keywo6oK1Nn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…ckage view's refused save says why in the reader's words (objectstack-ai#36212)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu3R6vTvrF8uP9Z2MFVbqmJV)_

repo:objectstack#1 · os-sales · session_01L6bhgX7ez5A7JDsmzTy9Ks

Fixes objectstack-ai#36194
Fixes objectstack-ai#36195

Clause-②: yes (widening) — two new keys in every `@object-ui/i18n`
locale pack (`console.objectView.personalizedParts.summaries`,
`console.objectView.saveRefused.packaged`); zh-Hant regenerated; nothing
removed or renamed. `ListView` / `ObjectGrid` props unchanged (doc
comments only).
Metadata-protocol: none

## 维护者速读

-
列表底部选、换、去掉一列的统计:马上显示结果,不再写进视图或个人视图;和筛选排序一样算草稿,出现「放弃」「保存」,「保存」菜单的未保存列表多一项「统计」。「放弃」还原;「保存到这个视图」(自己的视图)和「另存为我的视图」把统计一起存进去。
- 包里带的视图(比如
HotCRM「全部客户」)、没有权限改的共享视图:照样能选统计,进草稿,「保存」里只有「另存为我的视图」。任何时候都不会再出现卡上那段英文报错。
- 服务端拒绝保存包里带的视图时,提示改成一句中文(11
种语言都有):「这个视图来自应用包,不能直接修改,可以另存为我的视图。」其它拒绝照旧显示服务端那句话(那些是写给人看的,已有测试钉着)。
- 卡上那段报错的来历:包可写的判断要等包列表读回来,列表为了不和页面抢网络,要等页面请求安静下来(最多 8
秒)才读;这之前判断按设计放行,底部入口就直接写了视图。统计改成草稿后,这段时间里底部不再写任何东西。

## What changes

**A footer calculation is a draft part** (`objectViewListRenderer.tsx`,
`listDraftStore.ts`, `columnSummaryWrite.ts`, `ObjectView.tsx`)

- `ListDraft` gains `summaries` (column → calculation, `null` = None
over a column the view sums); an emptied part is no part. It lives
exactly as the other parts (objectstack-ai#35955 item 4: kept on a record round trip,
dropped on another view or object and on a reload).
- The renderer lays the draft's calculations over the columns it hands
`ListView` (`columnsWithSummaries`), so the grid draws them at once, and
`onColumnSummaryPick` only patches the draft and answers `true`. A pick
equal to the column's own calculation (`columnSummaryOf`) drops the
column from the draft.
- The menu is offered (`columnSummaryPickFields`) on the columns the
list draws, the reader's added fields included: the columns a saved body
carries. Where the list holds no draft (an environment list, no open
view) nothing is offered (`listViewActions.draftsSummaries`).
- Removed: `handlePickPersonalViewSummary` (wrote the reader's own view
at once) and `handlePickSharedViewSummary` (wrote the shared view's
draft, `PUT /meta/view/<name>?mode=draft`). No footer pick writes
anything now.
- The Save menu's unsaved list names it: host-side part `summaries`
(`ListDraftActions`' `ListPersonalizationPart` gains it; `ListView`'s
own vocabulary is untouched), pushed in `objectViewListUrlState.ts` like
`columns`.
- Saves carry it: `PersonalViewListState.summaries`, laid by
`buildPersonalViewConfig` on the columns it keeps (after added fields,
order and hidden columns). Callers: Save to this view (own view), Save
as my view, the switcher's create card with "include current".

**A view the reader cannot change in place** — the same "can save in
place" reading as the filter and the Save menu, no second rule: the Save
menu offers Save to this view on the reader's own view only (on `main`),
so a package's view and a non-admin's shared view get Save as my view
alone. With objectstack-ai#36123 merged in, its shared-view Save to this view keeps
its own test (`canSaveToSharedView`, now waiting for the package list:
small call 5) and stores the calculations too.

**A refused save of a package's view** (`viewSaveRefusal.ts`,
`objectViewViewCrud.tsx`, `ObjectView.tsx`)

- `viewSaveRefusalText(err, t)`: `code === 'NOT_OVERRIDABLE'` (the
door's close on an item a package ships,
`protocol-packaged-base-refusal.ts`) →
`console.objectView.saveRefused.packaged`; anything else →
`formatMetadataError` as before. Used at every view-write toast on the
object page except delete (view settings save, create, rename, pin, set
default, personal create / save / save as).

**Docs**: `content/docs/ui/views.mdx` § "A user's list state never
writes the view". Changeset `36194-footer-calculation-draft.md`.

## Small calls made in this thread (Sales 22:19:27Z rule; seat agreed
22:51Z)

1. The menu is offered on every column the list draws, not only the ones
the view declares: the draft can carry a calculation on any column the
saved body keeps (objectstack-ai#35702's declared-only limit existed because the pick
wrote the view).
2. A reader who is no admin gets the menu on a shared view too (their
pick is their draft; Save as my view keeps it). The card's "no entry for
a reader without permission" acceptance line predates the fold; the
brief settles it as "into the draft, Save as my view alone".
3. Only `NOT_OVERRIDABLE` is reworded. Other refusals (403 permission,
422 field issues, pin / default / rename) keep the door's message, which
objectui#11583 / objectstack-ai#12417 pin as worded for the person saving.
4. The switcher's create card carries the calculations only with
"include current", as it does the filter and sort.
5. **Done after objectstack-ai#36123 merged:** its 「保存到这个视图」 on a shared view stays
hidden while the package list is unread, and for a package listed
read-only (`usePackageSaveRead`: the same session-held read as
`usePackageRefusesSaves`, with the in-flight state told apart; a failed
read or an unlisted package still offers it, as today). Reason measured
below: the unread window is where the card's error came from.

## Root cause of the card's error (measured, client-side)

HotCRM 6.5.0 on `main` (`fa304140`), console from this tree's `ui/`
against it: the server's package list reports `app.objectstack.hotcrm`
`writable: false`, and `crm_account.all_accounts`'s row carries
`_packageId: app.objectstack.hotcrm`. The reading is right once read;
but `fetchSessionPackages` waits for the page's own requests to go quiet
(up to 8 s) before it reads, and until then `usePackageRefusesSaves`
fails open by design. Measured at 1440: the list drew with 「+ 添加统计」 at
7.2 s, the package list answered at 8.0 s, and the entry went. A pick
inside that window sent the `PUT ?mode=draft` the card shows. With this
PR the pick writes nothing in any window.

## Tests

- `ObjectView.footerCalculationDraft-36194.test.tsx` (7, renamed from
`ObjectView.readOnlyPackageView-35933.test.tsx`; real `ObjectView`,
`ListView` stand-in that draws the condition row's end, every non-GET
`fetch` recorded): a pick is drawn, writes nothing, Save names it,
picking None again drops it; Discard takes it off; the reader's own view
stores it only on Save to this view; a view that declares no columns
gets the menu on the drawn columns and Save as my view stores it; a
package's view: drawn, no write, Save offers Save as my view alone,
which stores it; the package list unread: still a draft; a non-admin on
a shared view: a draft, Save as my view alone.
- `__tests__/footerCalculationDraft-36194.test.ts` (9):
`columnsWithSummaries` / `columnSummaryOf`; the draft store's empty
part; `buildPersonalViewConfig` stores calculations on kept columns
(added kept, hidden dropped) in a body `ListViewSchema` accepts;
`viewSaveRefusalText` (package refusal reworded, a 403 keeps the door's
words, issues keep the list).
- `AppContent.draftSaveKeepsList-35932.test.tsx` (8, adapted): the pick
no longer writes, so the refresh pulse a draft save announces is
announced by the test (`emitMetadataRefresh`); no skeleton, no remount,
picks drawn through it; a reader's pick is offered (their draft).

## Verification

Local at head (`claude/project-thread-8r2qm4`):

- `pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView
packages/app-shell/src/views/__tests__
packages/app-shell/src/views/ListDraftActions
packages/app-shell/src/views/personalViews
packages/app-shell/src/console/__tests__/AppContent packages/i18n
packages/plugin-list/src packages/plugin-grid/src/__tests__` → 797
files, 8404 passed / 13 skipped; the 7 failures of that run were the
first version of the refusal helper (it also reworded every 403) and a
stale zh-Hant; both fixed, and the three files re-run green
(`ObjectView.viewWriteRefusal-11583`,
`ObjectView.createViewRefusal-11578`, `packages/i18n` 106 files).
- `@object-ui/app-shell` `type-check` (both `tsc --noEmit` and
`tsconfig.test.json`): exit 0.
- `eslint` on every changed file: 0 errors.
- The whole app-shell package is left to CI's shards.

## Since the first L1-b read (`ef54913f` → `efa7c4f0`)

- Merged `main` twice (objectstack-ai#36128, then objectstack-ai#36123). Resolutions: the renderer's
memo deps take objectstack-ai#36128's `openReferencedRecord` and keep this PR's drop
of `summaryPickKey`; `ObjectView`, `personalViews`, `listDraftStore` and
`views.mdx` keep both sides (calculations beside objectstack-ai#36123's layout and row
colour).
- The shared-view Save to this view passes `summaries` to
`layListStateOverView`, which lays them after the added, ordered and
hidden columns; it still writes neither the reader's row height nor
column widths.
- Small call 5: `usePackageSaveRead` in `useStudioDesignGate.ts`
(`unread` / `refuses` / `takes`); `canSaveToSharedView` asks for
`takes`.
- L1-b N1: `viewSaveRefusalText` reads the code with `errorCodeIs`.
- Tests: three new cases in `ObjectView.sharedViewSave-35955.test.tsx`
(a pick on a shared view writes nothing and Save to this view stores it
with the view's own row height; unread package list hides the save, the
answer offers it; a failed read offers it). Local: 203 files / 1769
tests green (ObjectView*, the gate hook, `views/__tests__`, the console
draft test); app-shell type-check 0; eslint 0 errors.

## Evidence (HotCRM 6.5.0, 1440×900,
`/mnt/project-files/build-seat1/36194-36195/`)

- Before: `before-1440-{light,dark}-hotcrm-pick-refused.png` — 「全部客户」,
the package list held 15 s to show the window, a 「去重」 pick: `PUT
…/crm_account.all_accounts?mode=draft`, the English refusal toast.
- After (same hold): `after-1440-{light,dark}-hotcrm-pick-in-draft.png`
(「去重 9」 drawn, 「放弃」「保存」, no write),
`after-1440-{light,dark}-hotcrm-save-menu.png` (「未保存的改动: 统计」, 「另存为我的视图」
alone), `after-1440-light-hotcrm-discarded.png`,
`after-1440-light-saved-as-my-view.png` (「全部客户 副本」 keeps 「去重 9」),
`after-1440-light-my-view-save-menu.png` (own view: 「保存到这个视图」 offered),
`after-1440-light-my-view-after-reload.png` (saved 「非空 9」 survives a
reload; the only write of the run: `PATCH
/api/v1/data/sys_personal_view/<id>`).

## Overlap

`overlap-check.mjs` @ `efa7c4f0`: merges cleanly with `main`
(`af2361ee`, objectstack-ai#36123 and objectstack-ai#36128 in); textual conflict with objectstack-ai#36133 only
(`listDraftStore.ts`, `objectViewListRenderer.tsx`).

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

https://claude.ai/code/session_01L6bhgX7ez5A7JDsmzTy9Ks

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgX7ez5A7JDsmzTy9Ks -->

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… that can group (objectstack-ai#36204) (objectstack-ai#36223)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuTGE2nV5qgwDdDHZ12i82BA)_

Fixes objectstack-ai#36204

Clause-②: yes (widening) — `@object-ui/components`'s `GroupingEditor`
gains the optional props `askFieldOnAdd`, `fieldOptionsLoading` and
`fieldLabel`, and its `labels` the optional `noFields`;
`@object-ui/i18n` gains `list.noGroupableFields` in every locale
(zh-Hant regenerated); nothing removed or renamed.
`@object-ui/plugin-list`'s package exports are unchanged.
Metadata-protocol: none

## 维护者速读

- 列表里点「添加分组字段」:不带默认值,也不马上分组。字段下拉直接展开,选了才分组;不选关掉,列表不分组,也不出现「放弃」「保存」。
-
下拉只列单选(状态也是单选)、勾选、人员、关联记录,每种只含单值的。文本、数字、日期、多选都不列。先列这个视图的列(按列的顺序),再列对象里其它这类字段,负责人也在里面。HotCRM「全部客户」下拉是
行业、类型、健康度…母公司、是否活跃…客户负责人,没有 客户名称、年营收、日期。
- 对象里一个这类字段都没有:按钮灰掉,下面写「没有可以用来分组的字段」。字段类型还没读回来的一瞬间按钮也是灰的,但不显示这句话,不会误报。
- 已经按别的字段(比如名称)分组的视图照常显示,这一级仍能换、能删。分组仍是草稿(objectstack-ai#35955),不写视图。

## What changes

The card was rewritten after this PR's first version (rewrite note
7072750584, claim amend 7073321855): the first version's "default to the
first single select" and "suitable types first, others still selectable"
are both gone. In both Group editors (the wide toolbar's Group panel and
the 视图设置 menu's Group level):

1. **No default, no grouping on the click.** "Add group field" opens a
row whose field dropdown is already open. The level is written only on a
pick; closing the dropdown without one writes nothing.
2. **Only fields that can group** (`isGroupableField`): `select`,
`radio`, `boolean`, `toggle`, `user`, `lookup`, `master_detail`, `tree`,
and not `multiple: true`. Order: the view's columns in the reader's
column order (`schema.columnState.order`), then the object's other
fields of those types the reader may read and the definition does not
hide, business fields before system ones (the Filter panel's tiers).
3. **None to offer:** the button is drawn disabled with
`aria-describedby` on the reason 「没有可以用来分组的字段」 / "No field here can
group the list".
4. **Still a draft** (objectstack-ai#35955): the pick goes through `onGroupingChange`
to the host's `listDraft.patch` and the URL, as before.

Not changed, per the card: the group display, kanban, date grouping. A
view already grouped by another kind of field keeps its level, shown
under the field's label (`fieldLabel`), and the level can still be
changed or removed.

Code:

- `@object-ui/components` `GroupingEditor`: `askFieldOnAdd` (the pending
row, testid `grouping-field-pending`), `fieldOptionsLoading`,
`labels.noFields` (disabled button + `grouping-no-fields`),
`fieldLabel`. Without them the editor behaves as before.
- `@object-ui/plugin-list` `ListView`: one `groupOptions` list and one
`groupFieldLabel` for both editors; `ViewSettingsPopover` takes
`groupOptions` / `groupOptionsLoading` from it (`groupFieldOptions` and
`isGroupableField` are module helpers, not package exports). `allFields`
carries `type` and `multiple` from the definition.
- Platform checklist `records-forms.grid-personalization` rev 11 (after
objectstack-ai#36133's rev 10): steps[3] says the dropdown opens without grouping,
lists only groupable fields, and Status is picked there.

### Small calls made in this thread (Sales 22:19:27Z rule)

- **A field whose type is not loaded yet** (L2 should-fix): while the
definition read is in flight, nothing is offered and the button is
disabled *without* the reason, so it never says "nothing to group by"
before the types are known. If there is no definition to read at all (a
host with no `getObjectSchema`, or the read failed), no type is known
and every column is offered, as before. Both pinned.
- **"Status"**: the spec has no `status` type; a status is a `select`.
`radio` counts as a single select.
- **"Linked record"** includes `master_detail` and `tree` beside
`lookup`; **"tick"** includes `toggle` beside `boolean`.
- **Fields outside the columns**: the card says 「这个对象没有…」, so the
object's other groupable fields are offered after the columns. The
record owner is one (the maintainer's 「加上负责人」). Created by / updated by
are offered only when the view shows them as a column; otherwise every
object would have a person field and the disabled state could never
appear.
- **A field the reader may not read** is never offered; a level already
holding one keeps showing its name, not its label (objectstack-ai#11984).
- **Second level**: the same list, less the fields levels use.

## Verification

-
`ui/packages/components/src/__tests__/grouping-editor-add-default-36204.test.tsx`
(11): the click writes nothing and opens the dropdown; a pick writes the
level; second level; Escape writes nothing; `noFields` disabled +
described; loading disabled without a reason; enabled when options
arrive; `fieldLabel`; three CONTROLs without the new props.
-
`ui/packages/plugin-list/src/__tests__/ListView.groupAddDefault-36204.test.tsx`
(16), both editors: the click writes nothing, the dropdown is Industry,
Owner, Stage, VIP, Parent account, Record owner (no name, text, date,
number, multi-select, hidden field, unshown created-by), a pick writes
the level with no `create`/`update`/`delete`; Escape; no groupable field
→ disabled + reason; second level; column order; created-by as a column
is offered; a view grouped by name shows "Customer name" and can change;
loading → disabled without reason, enabled once the definition answers;
CONTROL with no definition offers every column; View settings labels a
non-column pick (Record owner) on its level and on the menu's Group row;
the helper functions.
- Direction, measured: with `main`'s `grouping-editor.tsx`,
`ListView.tsx` and `ViewSettingsPopover.tsx` swapped in, 22 of these 26
fail; the other four include the three editor CONTROLs. The View
settings label pin added at `89c82900` fails with that commit's one-line
host change reverted.
- Updated where tests read the old first-column default:
`ListView.harness` (objectstack-ai#32631: fields typed, CONTROL re-reads the level
options after the pick), `ListView.onGroupingChange-11860` (stub answers
`getObjectSchema`; the add picks from the dropdown),
`ListView.fieldListRead-11984` (the Group list offers `Status`/`Secret
Status` only; the full-read control probes Group with the select),
`ObjectView.listUrlState-11860` (no definition there, so every column,
`priority` picked).
- `vitest run` packages/plugin-list, components `grouping*` +
`list-builders*`, app-shell `ObjectView.listUrlState-11860`,
packages/i18n: 293 files, 4039 passed / 13 skipped.
- `tsc --noEmit` and `tsconfig.test.json`: components, plugin-list,
app-shell, i18n, exit 0. ESLint on changed files: 0 errors.
`check-platform-checklist.mjs`: OK. Changeset checks: OK.

## Evidence (1440×900 @2x, zh-CN, light and dark;
`/mnt/project-files/build-seat1/36204/`, index in its `README.md`)

Console from this branch's `ui/`; every non-GET request recorded in the
page.

- Self-built 「客户」 (package `com.demo.kehu`), 「全部客户」 (客户名称, 所属行业, 负责人,
电话): `v2-1440-{light,dark}-kehu-all-1-after-add-dropdown.png` — the
click opens the dropdown (所属行业, 负责人), list not grouped, no request.
`-2-list-grouped.png` — after picking 所属行业: 4 groups of 3, 「放弃」「保存」; the
only request is the grouped read `POST
/api/v1/data/kehu_customer/query`.
- 「联系方式」 (客户名称, 负责人, 电话, 签约日期):
`v2-…-kehu-contact-1-after-add-dropdown.png` (负责人, then the non-column
所属行业), `-2-closed-no-pick.png` (Escape: no level, no 「放弃」「保存」, no
request).
- 拜访记录 (text, textarea, number, date, multi-select + platform owner):
`v2-…-kehu-visit-*` — dropdown 负责人 only.
- 便签 (`ownership: 'org'`, no owner; only text, textarea, number, date,
multi-select): `v2-…-kehu-note-nofield-0-group-panel.png` — disabled,
「没有可以用来分组的字段」, a click does nothing.
- HotCRM (`main` 6090c83) 客户 → 全部客户:
`v2-…-hotcrm-accounts-1-after-add-dropdown.png` — 行业, 类型, 健康度, 商务能力,
付款周期, 销售区域, 母公司, 是否活跃, 审批状态, 来源线索, 客户分层, 客户细分, 客户负责人; no write, not
grouped. `-2-list-grouped.png` — grouped by 行业, 「放弃」「保存」; only the
grouped read.
- `before-*` shots show `main` (one click groups by 客户名称, 12 groups of
one). `v1/` holds this PR's superseded first version.

## Since the first reads (L1-b ACCEPT 7073310792, L2 FAIL 7073316679)

The rework answers the L2's four must-fixes (default, filter, disabled
state, rewrite note) and its should-fixes (untyped-field rule + test,
checklist, changeset, body). Nits: the plugin-list members are out of
Clause-② (not package-public); the harness CONTROL re-checks the level
options after the pick. Heads: `4e90470e` (rework), `953c8cbf` (record
owner offered, provenance only as a column; L1-b delta ACCEPT
7074055354, declaration L2 delta PASS 7074084200), `89c82900` (L2 S1:
`ListView` hands `groupFieldLabel` to `ViewSettingsPopover`, which
labels the menu's Group row and the level with it, so a non-column pick
no longer reads as `owner_id`/`industry`; pinned; browser: 「联系方式」 pick
所属行业, the row reads 「分组 所属行业」,
`v2-1440-{light,dark}-kehu-contact-3-menu-row-noncolumn.png`. L2 N4: the
changeset headline is `fix(list)` like the title).

## Overlap

`main` merged after objectstack-ai#36133 (`0d8fc77b`): the one conflict was
`records-forms.grid-personalization`, resolved by keeping objectstack-ai#36133's
steps[2] and rev 10 row; this PR's row is rev 11.

## 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.
- [x] 3. No formatter ran; `pnpm lint` passes (changed files: 0 errors).
- [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.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

https://claude.ai/code/session_01L6bhgXeD1yUYqBJm8uzRrP

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgXeD1yUYqBJm8uzRrP -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…reference rows the Console no longer reads (objectstack-ai#36304)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XURgXCZHcjPoyo5g9cMEATi)_

Part of objectstack-ai#35955

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:普通用户无感;运维人员升级后多了一个清理工具,可以删掉服务器上每个人旧的「列表个人偏好」数据(列宽、行高、标签页顺序,以及更早的排序和筛选)。
- 为什么做:列表重做专题里「列表上的改动都是临时的、列宽只记在浏览器」这张卡,维护者定了已存下的偏好「清掉」,这是收尾的一步。
-
出错会怎样:删的是已经没有任何地方读取的旧数据;默认只出报告不删,删之前强制写一份只有本人能读的备份文件并核对,误删可以从备份里找回,但平台不会自动恢复。
- 要你做什么:这次会删除每个组织存量的旧列表偏好数据,按座位令由你本人审阅、批准并亲手合并。L1 ACCEPT 7075313108,契约
PASS 7075403391(head f4b177f,安全相关:是,按裁定的范围)。

## What changes

A new operator command, `os migrate list-preferences`, deletes the
per-reader list preference rows an earlier Console stored in
`sys_user_preference` under `ui.list.OBJECT`. Since PR objectstack-ai#36133 the
Console no longer reads or writes them, and the maintainer ruled the
stored rows cleared, not migrated (card item 6, verbatim:
「**已存下的个人偏好不迁移**:上线后服务端那一份不再读,所有人回到视图本来的样子,包括列宽、行高和标签页顺序。旧数据由升级脚本清掉。升级说明里写明。」;
on stored sort/filter preferences: 「清掉」).

- `packages/cli/src/commands/migrate/list-preferences.ts` (new,
oclif-discovered, not exported from `index.ts`). Dry run by default:
counts rows, readers and organizations, and per key the rows and readers
holding it; never prints a value; boots read-only (the `os migrate plan`
boot) and writes no row, table or file.
- `--apply` deletes, only with `--export PATH`: every row the run
deletes, as stored, written owner-only (`0600`, `wx`, never overwriting)
and read back before the first delete; any failure there refuses the run
with nothing deleted. Each delete is the engine's by-id delete in the
system context. After the deletes the family is read again; any row
still stored exits 1. A second run finds nothing, writes no export and
exits 0.
- `packages/cli/src/utils/list-preference-sweep.ts` (new): the read
(driver-level, unscoped: every organization and every user,
`$startsWith: 'ui.list.'`), the counts, the export document and its
read-back check.
- Precedent followed: `os db orphans` for the export (mandatory,
owner-only, `wx`, read back, `export_required` / `export_exists` /
`export_failed` / `export_incomplete` / `confirmation_required`, exit
1), the system-context by-id delete judged by read-back, the read-only
report boot and the no-auto-run pin; the `os migrate` family for the
command name, `--apply`, `--yes`, `--force` and the SQLite occupancy
gate. Tenancy: every organization's rows, as `os db orphans` and `os
secret orphans` read (driver-level, unscoped).
- Confirmation: `--apply` without `--yes` asks once on a terminal; where
stdin is not a terminal (or with `--json`) it reads nothing, deletes
nothing and exits `1` naming `--yes`. That gate sits before the boot, as
the `os migrate` family's confirmation pin requires.
- `sys_user_preference` is declared by plugin-auth's identity objects,
so the boot composes `createIdentityObjectsPlugin()` for its
declarations only (the `os user set-password` shape): no auth manager,
no hook, nothing started.
- Docs: `content/docs/deployment/cli.mdx` (a Data migrations row and an
`os migrate list-preferences` section) and `content/docs/upgrading.mdx`
(an "Upgrading from 18.6.0 or earlier" note: run it once the upgraded
Console is serving).
- Changeset `.changeset/35955-migrate-list-preferences.md`,
`@objectstack/cli` patch.

Not in this pull request: the sign-out keep (objectstack-ai#36110), related-tab widths
(objectstack-ai#35892), the spec `columnState` retirement.

### Read first (by risk)

1. `packages/cli/src/commands/migrate/list-preferences.ts`, the
`--apply` half from "The export, written and READ BACK" down: the export
is written and checked before the first delete, and the outcome is
judged by the read-back.
2. `packages/cli/src/utils/list-preference-sweep.ts`,
`readListPreferenceRows`: the delete set is exactly the driver's
case-sensitive `$startsWith` answer for `ui.list.` (dot included).
3.
`packages/cli/src/commands/migrate/list-preferences.integration.test.ts`:
the seeded survivors (`ui.record.account`, `ui.recent`, bare `ui.list`,
`ui.listx.account`, `UI.LIST.account`).

### Two-minute check

`os migrate list-preferences --database-url
file:PATH-TO-A-DB-WITH-UI-LIST-ROWS` prints the rows per `ui.list.*` key
and "Dry run only — no row or table was written or deleted."; adding
`--apply --export ./backup.json` asks once, writes `./backup.json` with
mode 600, and prints "Deleted N sys_user_preference row(s)".

## Tests

- `list-preferences.integration.test.ts` (8 cases, real boot, real
SQLite, rows in two organizations): the dry run's counts and a
byte-identical database with no file; `--apply --export` deletes the
four family rows in both organizations and keeps the five survivors, the
export is mode `0600` and holds each row as stored; the first delete
finds the export already complete on disk (order pin, with an injected
refusal judged by read-back: exit 1, `failed` names it); a second run
deletes nothing and writes no export; `export_required`,
`export_exists`, `export_failed` and `confirmation_required` each exit 1
with nothing deleted.
- `list-preferences.no-auto-run.test.ts` (5 cases, unit tier): no
non-test source imports the command or its plan module; positive
controls first (the scanner finds `serve.ts`'s dynamic import of the
boot migration gate, and the command's own import of its plan).
- `schema-migrate.one-shot-family.integration.test.ts`: the command is
added to the `bootSchemaStack` caller table (its first case would
otherwise go red by file name); 5 new cases: the dry run leaves the
database byte-identical and creates no missing SQLite file, `--apply`
runs no seed write, and neither mode creates key material.

- `test/migrate-confirmation-exit.pin.test.ts`: the command joins the
family roster (`--apply --export`, confirm `--yes`); its text face
without `--yes` off a terminal exits 1 with nothing written. Ablation on
`f4b177f6`: the non-TTY gate disabled turns the pin red (1/60,
"list-preferences - text face: exit 1").

## Acceptance notes

- The dispatch order said `@objectstack/cli` minor; the changeset is
`patch`, because `Metadata-protocol: none` grades every introduced entry
`patch` (`check:changeset-no-major`, AGENTS.md Post-Task Checklist step
3).
- A first version re-filtered the driver's rows with an in-memory prefix
test, on the belief that SQLite `LIKE` folds case. Ablating that filter
stayed green (8/8): the driver's `$startsWith` is case-sensitive
(`textMatchPredicate` without folding), so the second filter was removed
rather than kept untested. The export read-back still judges each row's
key.
- Observation: the one-shot family pin's `test-budget` header says "134
cases"; `vitest list` counts 189 on this head (184 before this PR). Not
touched here.
- Out of scope, filed objectstack-ai#36331: `os db orphans --delete` and `os secret
orphans --delete` without `--yes` off a terminal print "Aborted" and
exit 0 (read from source); they are outside the migrate family's
confirmation pin.
- Tests deleted, migrated or rewritten: none.

## Verification

Head `f4b177f6`: CI green (40 success, 15 skipped by selector). On
`f4b177f6` locally: `vitest run` of
`test/migrate-confirmation-exit.pin.test.ts`, the two list-preferences
suites and `test/exit-signal.pin.test.ts`: Test Files 4 passed (4),
Tests 220 passed (220); `dispatch-gates --commands` 103 families
derived, 103 run, 0 unrun. The rest on head `edcf4e1b` unless noted.
Local runs were narrowed, and said so here: the shared verification lock
never reached this run for ~45 minutes (three 9-minute queue timeouts
behind other worktrees' builds), so after the one locked build and
typecheck the single-file test runs ran unlocked with `--maxWorkers=1`.
The full `@objectstack/cli` unit and integration projects are CI's (Test
Core).

<details><summary>Build and typecheck</summary>

- `pnpm --filter '@objectstack/cli^...' build` under the lock: `VERDICT
command-exit 0`.
- `pnpm --filter @objectstack/cli typecheck` under the lock (`tsc
--noEmit` and `check:test-typecheck`): `VERDICT command-exit 0`;
"check:test-typecheck: OK".

</details>

<details><summary>Tests</summary>

- `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=1
src/commands/migrate/list-preferences.integration.test.ts
src/commands/migrate/list-preferences.no-auto-run.test.ts` on
`edcf4e1b`: Test Files 2 passed (2), Tests 13 passed (13).
- The same two plus
`src/utils/schema-migrate.one-shot-family.integration.test.ts`,
`test/exit-signal.pin.test.ts` and `test/vitest-tiers-partition.test.ts`
on `d6d3bf8c` (the last commit adds two module-top imports to the new
suite only): Test Files 5 passed (5), Tests 371 passed (371). `vitest
list` shows the five new family cases for `migrate list-preferences`.

</details>

<details><summary>Ablations (one-off, through
scripts/ablation-replace.mjs; the tool proved the mutation landed and
the restore equals HEAD)</summary>

- The in-memory prefix re-filter (`return rows.filter(...)` replaced by
`return rows;`) on `65c4733b`: the integration suite stayed green, 8/8.
Read as: the driver's `$startsWith` is already exact, so that filter was
removed (commit `d6d3bf8c`).
- The trailing dot dropped from the read (`$startsWith: 'ui.list'`) on
`d6d3bf8c`: 4 of 8 red. The dry run's counts differ; `--apply` refuses
with `export_incomplete` naming `s_bare` and `s_lookalike` (the export
read-back judges each key); the order pin's first delete is never
reached; the re-run case exits 1. Restored: blob equals HEAD, `git diff
HEAD` empty.

</details>

<details><summary>Gates (derived with dispatch-gates --commands; 102
families, all run, reconciled with --ran: 102 run, 0 unrun)</summary>

- Exit 0: 94 families, among them `check:cli-command-ids`,
`check:cli-examples-parity`, `check:doc-anchors`, `check:doc-authoring`,
`check:changeset-no-major --base origin/main`,
`check:adr-0087-registration --base origin/main`,
`check:empty-changeset`, `check:closing-keyword-parity`,
`check:nul-bytes`, `check:type-check-coverage`,
`check:system-context-census`, `check:cross-package-test-inputs`,
`check:issue-citations`.
- `check:test-source-alias`: exit 1 on `d6d3bf8c` (the new suite reached
`@objectstack/platform-objects/plugin` and
`@objectstack/plugin-security` through dynamic imports in a clocked
window); module-top imports added in `edcf4e1b`; re-run exit 0.
- NOT MEASURED (exit 3, the gate's own prerequisite refusal, unrelated
packages unbuilt in this worktree, a shallow clone, or the lock
unreachable): `check:plugin-teardown-shape --self-test` (shallow clone),
`@objectstack/spec check:skill-examples`, `check:dual-build-cjs-loads`,
`check:i18n`, `check:i18n-coverage`, `check:i18n-walk-parity`,
`check:type-check-debt` (lock queue timeout). CI runs them.

</details>

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

<!-- signed: repo:objectstack#4 · os-project-manager ·
session_01FEkQ5krBqrrgxCYgjXmfbv -->

---------

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

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants