Skip to content

Commit 7a5ae65

Browse files
docs(spec): the compactToolbar describe and the userActions liveness note say which toolbar draws Refresh (#36872)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB9Gqqp1VYZwEqbXEm1YsTjU)_ Fixes #36353 Clause-②: no Metadata-protocol: none repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB ## 维护者速读 - 用户无感:视图元数据里「紧凑工具栏」这一项的说明文字改了,写明默认就是紧凑工具栏、紧凑工具栏上没有刷新按钮;界面与行为都不变。 - 属于「列表页重做」专题的收尾:上一轮已把「刷新开关只管宽工具栏」写进刷新开关的说明,这次把相邻的工具栏说明和审计台账补齐。 - 出错时最坏是说明文字不准,作者或智能体误判某个开关管哪个工具栏;只改文字,可整体撤回。 - 无。 ## What changes - `packages/spec/src/ui/view.zod.ts`, the `compactToolbar` describe: the first sentence is kept and two are added. It now says the compact toolbar is on by default (omitted or `true`; `false` draws the wide toolbar, one button per control) and that the compact toolbar draws no Refresh button, so `userActions.refresh` governs only the wide toolbar; pull-to-refresh is unaffected by either key. The wording follows the `userActions.refresh` describe that #36339 landed ("Governs only the wide toolbar's Refresh button (`compactToolbar: false`): the default toolbar has no Refresh, so the toggle changes nothing there."). - `packages/spec/src/ui/view.form.ts`: the view form's `compactToolbar` hint mirrors the new describe. The hint == describe pin (`src/ui/view-form-composite-children.test.ts`, "top-level rows that gained a hint carry their schema description") requires it. - `packages/spec/liveness/view.json`, the `userActions` note: the `userActions.refresh` sentence now says it drives only the wide toolbar's Refresh button and names the reader by line: `showRefresh` at `ui/packages/plugin-list/src/ListView.tsx:2710`, the button at `:8125` behind `!compactToolbar`, measured at `5c2e34cdb`. The verdict stays `live`. - Regenerated, not hand-edited: `content/docs/references/{ui/view,data/object,api/protocol}.mdx` (`check:generated --fix`, which found only `check:docs` stale) and `packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts` (`node scripts/check-i18n-bundles.mjs --write --filter=platform-objects`; translated locales keep their wording). - Changeset `.changeset/36353-compact-toolbar-refresh-describe.md`: patch for `@objectstack/spec` and `@objectstack/platform-objects`. Description text only. `compactToolbar` stays `z.boolean().optional()` and `userActions.refresh` is not touched, so no key, type, default or optionality changes and the accept set is the same. What the new sentences rest on, read on `origin/main` `5c2e34cdb` (`ui/packages/plugin-list/src/ListView.tsx`): 1. Default: `compactToolbar: schema.compactToolbar !== false` (`:2718`). The plugin-list registry input already says "On by default; `false` draws one toolbar button per control" (`ui/packages/plugin-list/src/index.tsx:236`). 2. No Refresh in the compact toolbar: the only Refresh button is `toolbarFlags.showRefresh && !toolbarFlags.compactToolbar` (`:8125`, `data-testid="refresh-button"`). `ViewSettingsPopover` gets no refresh prop (the `viewSettingsElement` at `:7548`), and `components/ViewSettingsPopover.tsx` has no `refresh` hit at all. 3. Pull-to-refresh: `usePullToRefresh({ onRefresh: handlePullRefresh, enabled: !!dataSource && !!schema.objectName })` (`:3680`), attached unconditionally to the list root (`ref={pullRef}`, `:7637`). It reads neither `compactToolbar` nor `userActions.refresh`. Prior rulings: `check-prior-rulings --paths` over both files lists 146 hit lines. The ones near the edited lines (view.zod.ts `:3710` ruling 6095014058 letter A on `sharing`, `:3733` #15184 ruling B on composition order, `:1935`/`:1946` the `hideFields`/`editInline` defaults; view.json `:236`, `:250`, `:254`) are about other keys, and none governs `compactToolbar` or the refresh scope. No ADR names `compactToolbar`. The scope sentence restates what #36339's describe already says (contract review record 7076152814, N2 and N3), and no ruling is reversed. Read first, by risk: 1. `packages/spec/src/ui/view.zod.ts`, the `compactToolbar` line: this is the published schema text, and the contract review reads it. 2. `packages/spec/liveness/view.json`, the `userActions` note: the line numbers it cites. ## Tests Final head: `ca02fd3f8`. Every local reading below was taken against that head's tree. <details><summary>Local readings (builds and tests under scripts/pm/os-verify-lock.sh)</summary> - `pnpm --filter @objectstack/spec build`: VERDICT command-exit 0. - `pnpm --filter @objectstack/spec check:generated --fix`: rebuilt the package first, and regenerated only `check:docs` (`content/docs/references/**`), the one artifact it found stale. A re-run of `check:generated` then exited 0. - `pnpm --filter @objectstack/spec test`: Test Files 885 passed (885), Tests 28146 passed, 1 todo (28147), exit 0. - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/platform-objects test`: Test Files 125 passed (125), Tests 2126 passed (2126), exit 0. `typecheck`: exit 0. - The hint == describe pin `src/ui/view-form-composite-children.test.ts`: Test Files 1 passed (1), Tests 20 passed (20), VERDICT command-exit 0. With `view-form-pagination.test.ts` and `view.test.ts`: 3 files, 573 tests passed. - `node scripts/check-i18n-bundles.mjs`: before the regeneration, "platform-objects: 1 bundle(s) drifted from the schema". After `--write --filter=platform-objects`: "OK (10 package(s), all bundles in sync)". This ran after the build of the `@objectstack/cli` + `@objectstack/platform-objects` closure (VERDICT command-exit 0). </details> No ablation and no reverse verification: the diff changes description text, a ledger note and generated output, and no tested behaviour. ## Acceptance notes - Card "Done when" 1 (describe states the default, no Refresh in the compact toolbar, pull-to-refresh unaffected, matching `ListView.tsx` on `main`; form hint, regenerated docs and the hint == describe pin in step): done; see the three readings above. The pin passes. - Card "Done when" 2 (liveness note names the wide-toolbar scope and the current reader line): done (`:2710` reader, `:8125` button). - Noted, not filed: the note's first sentence still cites `ListView.tsx:374 toolbarFlags`, an older objectui line, for the whole `userActions` row. Only the refresh sentence is in this card's scope. Today the memo is at `ui/packages/plugin-list/src/ListView.tsx:2700-2729`. - Noted, not filed: the ten translated `compactToolbar` hints (and `ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts:440`) carry only the first sentence. They are still true, just less precise than English. Translating them is a translator's edit, as with #36339's `refresh` hint. - Overlap: `node scripts/pm/overlap-check.mjs` reports a textual conflict with #36802 in the generated `content/docs/references/data/object.mdx` only. That file is routed `merge=os-regen` (`.gitattributes:159`), so whichever PR lands second regenerates it with `check:generated --fix`. It merges cleanly against `origin/main`, #36857 (which shares `view.zod.ts`) and #36858. ## Verification Two-minute check: `pnpm --filter @objectstack/spec exec vitest run src/ui/view-form-composite-children.test.ts` shows 20 passed. `grep -n "compactToolbar: z" packages/spec/src/ui/view.zod.ts` shows the new describe after `z.boolean().optional()`. <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` on the final diff named 112 commands, and all of them ran locally. The `--ran` reconciliation reads "112 derived famil(ies) accounted for, 112 run, 0 NOT-MEASURED". - 108 exited 0. The other four: - Exit 3, PREREQUISITE NOT MET, so NOT MEASURED locally (CI measures them): `node scripts/check-plugin-teardown-shape.mjs --self-test`, because the shallow clone cannot reach its pinned fixture commit; `pnpm check:dual-build-cjs-loads`, because the whole-tree dist is absent; `pnpm --filter @objectstack/spec run check:skill-examples`, because some workspace dists are absent. - Exit 1: `pnpm check:platform-checklist`, "ABSENT SYMBOL `packages/metadata-core/src/anonymous-form-intake.ts#anonymousFormExplicitWithdrawals`" in `docs/qa/platform-checklist/areas/access-security.json`. This diff touches neither file. The symbol is absent from that source at the base `5c2e34cdb` and at the current `origin/main` `d9c799c10`, so it is red independently of this PR, and it is reported to the seat. - `pnpm --filter @objectstack/spec check:generated`: exit 0. `node scripts/check-i18n-bundles.mjs`: exit 0. `node scripts/pm/overlap-check.mjs`: see Acceptance notes. - `node scripts/check-dev-prereqs.mjs` (a local-only family): exit 1, "the workspace is not built" (44 of 108 package dists absent in this container). This describes the machine and says nothing about the diff. - `node scripts/pm/dispatch-gates.mjs --tier`: no path-derived mandate. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 370e14d commit 7a5ae65

8 files changed

Lines changed: 26 additions & 13 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/platform-objects': patch
4+
---
5+
6+
docs(spec): the `compactToolbar` describe says which toolbar is the default and that it draws no Refresh
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The `compactToolbar` description on a list view (and the view form's hint for it, which mirrors it) now says what a renderer does when the key is omitted and which toolbar `userActions.refresh` applies to: the compact toolbar (the View settings popover) is on by default, omitted or `true`; `false` draws the wide toolbar, one button per control. The compact toolbar draws no Refresh button, so `userActions.refresh` governs only the wide toolbar; pull-to-refresh is unaffected by either key. This matches the `userActions.refresh` description, which already scopes the toggle to the wide toolbar.
12+
13+
Description text only: the key, its type, its optionality and the accepted values are unchanged, so every view that parsed before parses the same. The generated reference pages and the English metadata-forms help text carry the new sentence; the translated help texts keep their current wording.

‎content/docs/references/api/protocol.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
19951995
| **searchableFields** | `string[]` | optional | Fields enabled for search |
19961996
| **filterableFields** | `never` | optional | [REMOVED] `view.list.filterableFields` was removed in @objectstack/spec 18 (ADR-0049 enforce-or-remove) — the key was declared as a shorthand for `userFilters.fields` (the quick-filter bar), but the one renderer that read it used it as a whitelist of the fields the Filter panel offers instead, so one key carried two meanings and drew no quick filter. Delete the key; no per-view Filter-panel whitelist replaces it. For a curated end-user filter bar, declare `userFilters: { element: 'dropdown', fields: [{ field: '<field_name>' }] }`. The Filter panel offers every field the user may read: field read security decides, and a field the object definition marks `hidden: true` is not offered. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
19971997
| **resizable** | `boolean` | optional | Enable column resizing |
1998-
| **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover |
1998+
| **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover. On by default: omitted or `true`, the renderer draws this compact toolbar; `false` draws the wide toolbar, one button per control. The compact toolbar draws no Refresh button, so `userActions.refresh` governs only the wide toolbar; pull-to-refresh is unaffected by either key. |
19991999
| **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration |
20002000
| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) |
20012001
| **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration |
@@ -2075,7 +2075,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
20752075
| **searchableFields** | `string[]` | optional | Fields enabled for search |
20762076
| **filterableFields** | `never` | optional | [REMOVED] `view.list.filterableFields` was removed in @objectstack/spec 18 (ADR-0049 enforce-or-remove) — the key was declared as a shorthand for `userFilters.fields` (the quick-filter bar), but the one renderer that read it used it as a whitelist of the fields the Filter panel offers instead, so one key carried two meanings and drew no quick filter. Delete the key; no per-view Filter-panel whitelist replaces it. For a curated end-user filter bar, declare `userFilters: { element: 'dropdown', fields: [{ field: '<field_name>' }] }`. The Filter panel offers every field the user may read: field read security decides, and a field the object definition marks `hidden: true` is not offered. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
20772077
| **resizable** | `boolean` | optional | Enable column resizing |
2078-
| **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover |
2078+
| **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover. On by default: omitted or `true`, the renderer draws this compact toolbar; `false` draws the wide toolbar, one button per control. The compact toolbar draws no Refresh button, so `userActions.refresh` governs only the wide toolbar; pull-to-refresh is unaffected by either key. |
20792079
| **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration |
20802080
| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) |
20812081
| **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration |

‎content/docs/references/data/object.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ const result = ApiMethod.parse(data);
416416
| **searchableFields** | `string[]` | optional | Fields enabled for search |
417417
| **filterableFields** | `never` | optional | [REMOVED] `view.list.filterableFields` was removed in @objectstack/spec 18 (ADR-0049 enforce-or-remove) — the key was declared as a shorthand for `userFilters.fields` (the quick-filter bar), but the one renderer that read it used it as a whitelist of the fields the Filter panel offers instead, so one key carried two meanings and drew no quick filter. Delete the key; no per-view Filter-panel whitelist replaces it. For a curated end-user filter bar, declare `userFilters: { element: 'dropdown', fields: [{ field: '<field_name>' }] }`. The Filter panel offers every field the user may read: field read security decides, and a field the object definition marks `hidden: true` is not offered. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
418418
| **resizable** | `boolean` | optional | Enable column resizing |
419-
| **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover |
419+
| **compactToolbar** | `boolean` | optional | Collapse Group/Color/Density/Hide-fields into a single View settings popover. On by default: omitted or `true`, the renderer draws this compact toolbar; `false` draws the wide toolbar, one button per control. The compact toolbar draws no Refresh button, so `userActions.refresh` governs only the wide toolbar; pull-to-refresh is unaffected by either key. |
420420
| **selection** | `{ type?: Enum<'none' \| 'single' \| 'multiple'> }` | optional | Row selection configuration |
421421
| **navigation** | `{ mode?: Enum<'drawer' \| 'page' \| 'new_window' \| 'none'>; preventNavigation?: boolean; openNewTab?: boolean; size?: Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>; … }` | optional | Configuration for item click navigation: the drawer size, and `preventNavigation` for a list whose rows open nothing (`mode` is deprecated — the record name opens the page, the hover icon the side panel) |
422422
| **pagination** | `{ pageSize?: integer; pageSizeOptions?: integer[] }` | optional | Pagination configuration |

0 commit comments

Comments
 (0)