Repository navigation
Commit ba1f164
fix(app-shell): interface list toolbar honours the userActions spec defaults — Filter, Row height, Group and Hide Fields are on unless written false (#29299)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbK4zrqkvfgzpmvBDm7Q5uxL)_
Fixes #29144
Clause-②: no
Metadata-protocol: semantic
Skills-docs: none — `git grep -n "userActions" skills/` names no
interface-page toolbar default; the skills describe neither the old
closed reading nor the new one
## 维护者速读
- **改了什么**:界面页(interface page)列表工具栏的「筛选 / 行高 / 分组 / 隐藏字段」四个开关,改为与列表视图同一份
`userActions` 规范默认值:不写即开启,写 `false` 才关闭;「行着色」仍需显式开启。ADR-0047 同步加一段修订说明。
- **为什么改**:规范把这四项默认设为开,但界面页只认显式 `true`,同一张页面经过解析就有按钮、未解析(无 userActions
块或 Studio 存储行)就没有,两种工具栏全凭页面进入控制台的路径决定。
- **风险与回滚**:没写 userActions 块的界面页、以及未解析存储的页面,会多出这四个按钮;代码包里已声明 userActions
块的示例页(showcase 11 张、HotCRM 1 张)解析后本来就有分组和隐藏字段,无变化。回滚即还原
`InterfaceListPage.tsx` 一处映射。
-
**先看**:`ui/packages/app-shell/src/views/InterfaceListPage.tsx`(userActions
映射那段);`docs/adr/0047-object-ui-run-modes.md`(修订横幅);`.changeset/29144-interface-toolbar-spec-defaults.md`。
- **两分钟验证**:`cd ui && pnpm exec vitest run
packages/app-shell/src/views/InterfaceListPage.userActionsSpecDefaults.test.tsx`,预期
17 个用例全绿。
- **需要你做的**:本 PR 触及 `docs/adr/**`(Tier H),待席位 ACCEPT 后请审阅并批准合并。
## What changes
- `InterfaceListPage` reads `filter`, `rowHeight`, `group` and
`hideFields` from the page's `interfaceConfig.userActions` as `!==
false`, the published default of `UserActionsConfigSchema` (the schema a
list view's `userActions` uses too). `search` and `sort` already read
this way. `rowColor`, off by default in the spec, stays `=== true`.
Export stays off.
- A page with no `userActions` block, a stored page that was never
parsed, and a parsed block that omits a key now draw the same toolbar.
Before, only the parsed block drew the four controls, because the parse
had written the default `true` that `=== true` was waiting for.
- ADR-0047 gets a dated amendment banner and status note under the
maintainer's ruling (#29144 comment 6574404727, batch #455, letter A):
the toolbar toggles take the shared defaults; §3.4's closed rows (quick
filters, visualization lock, no user-created views, session filter
state) and the export lock stand. `docs/adr/README.md` is regenerated by
`pnpm adr:index`.
- The sentence "an interface page keeps its own closed-by-default
toolbar" is corrected in three places: the
`list-view-hide-fields-default-on` semantic entry, the default-change
ledger reason (`packages/spec/scripts/lib/default-changes.ts`) and the
still-pending changeset `.changeset/28912-hide-fields-default-on.md`
(one bullet), which would otherwise publish the now-false sentence.
### Reach (measured at 49aba82)
| Pages | userActions block | Today | After |
|---|---|---|---|
| showcase `active-projects`, `review-queue`, `task-triage`,
`task-workbench` and the seven `task-visualizations` pages (11 pages);
HotCRM `account_workbench` | declared, omits `group` / `hideFields` |
parsed by `defineStack`: Group and Hide Fields already drawn | unchanged
|
| any page with no block; any stored page never parsed (Studio drafts
and rows) | absent or unparsed | none of the four drawn | Filter, Row
height, Group, Hide Fields drawn unless written `false` |
The parse reading: `PageSchema.parse` of a block `{ sort, search,
filter: false, rowHeight: false, addRecordForm: false }` yields `group:
true` and `hideFields: true`; a page with no block parses with none.
## Tests
- New `InterfaceListPage.userActionsSpecDefaults.test.tsx` (17 cases):
no block, an unparsed `{}` and a parsed `{}` (through the real
`PageSchema`) compose the same spec-default toolbar; a curated block
composes the same toolbar parsed or unparsed; an explicit `false`
withholds each of the four alone; an explicit `true` keeps each; for
four blocks the page draws exactly what a list view parses the same
block to (`UserActionsConfigSchema.parse`); `rowColor` stays opt-in.
- A list view is unchanged: `ListView.test.tsx` (its `hideFields`
default-on, explicit `false` and `group: false` cases) runs green beside
the page tests.
- `InterfaceListPage.relayCensus-11572.test.ts`: the `userActions` and
`compactToolbar` reasons no longer say "closed by default".
- Ablation: restoring `hideFields: userActions.hideFields === true`
(through `scripts/ablation-replace.mjs`, anchor 1 → 0, replacement 0 →
1) turns 8 of 17 cases red on the final head (the parsed-`{}` case stays
green under the ablation, which is the defect: only a parse made the old
read draw the control); the restored blob equals HEAD and `git diff
HEAD` is empty.
## Acceptance notes
- A list view's toolbar is unchanged: `ListView` already reads these
four as `!== false`; this diff does not touch `@object-ui/plugin-list`.
- **`check-empty-changeset` stays red on purpose.** This PR edits
`.changeset/28912-hide-fields-default-on.md`, a pending release note it
did not add. That is the gate's DELIBERATE CORRECTION class: the note's
interface-page bullet said the page keeps a closed-by-default toolbar,
which this change makes false, so restoring it would publish a false
sentence. The one bullet now says the page reads the same default and
`hideFields: false` withholds the control. The correction is named in
the claim amendment (#29144 comment 6574419950) under the maintainer's
ruling; the maintainer confirms it with the Tier H approval.
## Verification
All readings on head `05795338` (branch merged with `origin/main` at
`eb14f7ad`). Head `899749f6` only raises the changeset's
`@objectstack/spec` grade from `patch` to `minor` (the level axis of
`check-changeset-no-major`: a `semantic` change takes `minor` on a
moved, published package); on it the changeset gates were rerun:
`check-changeset-no-major` 0, `check:changeset-gate-self-tests` 0,
`check-adr-0087-registration` 0, `check:pm-changeset-deadline-census` 0,
`check:doc-authoring` 0, `check:issue-citations` 0, `check:nul-bytes` 0,
`check-empty-changeset` 1 (as above).
<details><summary>Tests (locked, two vitest workers)</summary>
- `cd ui && pnpm exec vitest run` over the 11 `InterfaceListPage.*` test
files plus `plugin-list/src/__tests__/ListView.test.tsx`: Test Files 12
passed, Tests 249 passed.
- `pnpm exec turbo run type-check --filter=@object-ui/app-shell`: 65 of
65 tasks green.
- `pnpm --filter @objectstack/spec check:generated`: all 14 generated
artifacts up to date.
- `pnpm --dir ui exec vitest run scripts/`: Test Files 169 passed, 2
skipped; Tests 4900 passed.
- Ablation (`scripts/ablation-replace.mjs`, hideFields back to `===
true`): Tests 8 failed, 9 passed (17); restored, `git diff HEAD` empty.
</details>
<details><summary>Derived gates (dispatch-gates commands, 91
families)</summary>
- 90 run with exit 0; `node scripts/check-empty-changeset.mjs --base
origin/main` exit 1, the deliberate correction named under Acceptance
notes.
- `dispatch-gates --ran`: 91 derived, 91 run, 0 NOT-MEASURED, 0 UNRUN.
- Changed lines 275 (+255 / -20), 9 files, under the 3000 human-merge
threshold. Tier H by `docs/adr/0047-object-ui-run-modes.md` and
`docs/adr/README.md`.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jUidUZdX3neiGCfRHE)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent cfe5d49 commit ba1f164
9 files changed
Lines changed: 255 additions & 20 deletions
File tree
- .changeset
- docs/adr
- packages/spec
- scripts/lib
- src/migrations/entries/semantic
- ui/packages/app-shell/src/views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
13 | 29 | | |
14 | 30 | | |
15 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
734 | | - | |
735 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
| 520 | + | |
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
576 | 577 | | |
577 | 578 | | |
578 | 579 | | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
583 | 593 | | |
584 | 594 | | |
585 | 595 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
590 | 600 | | |
591 | 601 | | |
592 | 602 | | |
| |||
0 commit comments