Repository navigation
Commit 7a5ae65
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
- .changeset
- content/docs/references
- api
- data
- ui
- packages
- platform-objects/src/apps/translations
- spec
- liveness
- src/ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1995 | 1995 | | |
1996 | 1996 | | |
1997 | 1997 | | |
1998 | | - | |
| 1998 | + | |
1999 | 1999 | | |
2000 | 2000 | | |
2001 | 2001 | | |
| |||
2075 | 2075 | | |
2076 | 2076 | | |
2077 | 2077 | | |
2078 | | - | |
| 2078 | + | |
2079 | 2079 | | |
2080 | 2080 | | |
2081 | 2081 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
0 commit comments