Repository navigation
Commit 8ecbe0f
feat(spec): the view display page size defaults to 50 — PaginationConfigSchema.pageSize .default(25) → .default(50) (#20184)
Fixes #20050
Clause-②: no
## What
The view display page size defaults to **50**.
`PaginationConfigSchema.pageSize` in `packages/spec/src/ui/view.zod.ts`
moves from `.default(25)` to `.default(50)`. That is the only
declaration of the view display default. Maintainer ruling, verbatim
(objectui#9853, batch #223 item 4): 「9853 默认页大小改为50」. The change goes
into the protocol first: the renderer reads the spec default
(objectui#9853 ruling C′ item 1), and no renderer hardcodes 50.
## Contract face: accept set unchanged, one default moved
- **Default:** `ui/PaginationConfig:pageSize` moves from `25` to `50`.
This is the only default the build's ratchet saw move (`📌 1 declared
default change(s) accepted (#4666): - ui/PaginationConfig:pageSize: 25 →
50`).
- **Accept set:** unchanged. The type is still
`z.number().int().positive()`. The refusal pins `should reject negative
pageSize`, `should reject zero pageSize` and `should reject non-integer
pageSize` (`view.test.ts`) still pass without edits, and so does the
component-arm cross-check
(`component-object-grid-pagination-accept-set.pin.test.ts`). Measured on
the built dist: `PaginationConfigSchema.safeParse({ pageSize: 0 })` is
refused with `too_small` at `pageSize`.
- **Describe text:** unchanged, byte for byte. It still reads: "Number
of records per page. On a view with no pager (kanban, gallery, timeline)
it is the fetch ceiling, and the renderer owes two things: bound its
fetch at this number, and, when the filtered set is larger than it, show
a visible truncation signal saying what is on screen is not the whole
set". The schema docblock gains one paragraph naming the ruling and
stating that the renderer reads this default.
- **Parse outputs, measured on the rebuilt `packages/spec/dist`:**
| input | parsed `pagination` |
| :--- | :--- |
| `ListViewSchema` with `pagination: {}` | `{ pageSize: 50 }` (was `25`)
|
| `ListViewSchema` with no `pagination` | absent, before and after |
| `ListViewSchema` with `pagination: { pageSize: 25 }` | `{ pageSize: 25
}` |
- **Published JSON Schema:** `json-schema/ui/PaginationConfig.json` now
has `pageSize.default: 50`.
## Sweep of every text stating the display default as 25, counted by
declaration
The declaration census covers every `pageSize` `.default(` under
`packages/spec/src`. It finds 3 declarations: `ui/view.zod.ts` (25, this
card), `kernel/metadata-plugin.zod.ts` (50) and
`marketplace/marketplace.zod.ts` (20). The last two are out of scope per
the card and untouched. Texts restating the view default:
| text | what it said | this PR |
| :--- | :--- | :--- |
| `view.zod.ts` `PaginationConfigSchema.pageSize` | `.default(25)` |
`.default(50)` |
| `packages/spec/authorable-defaults/ui.json` (generated) |
`ui/PaginationConfig:pageSize = 25` | regenerated by the build to `= 50`
|
| `content/docs/references/ui/view.mdx` (generated), 3 rows:
`ListView.pagination`, `ObjectListView.pagination`, `##
PaginationConfig` | `optional (default: 25)` | regenerated by `gen:docs`
to `optional (default: 50)` |
| `view.test.ts` pin `should default pageSize to 25` | `toBe(25)` |
flipped to `should default pageSize to 50` / `toBe(50)` |
| `view.test.ts` pin `should accept custom page size` | input `pageSize:
50` | input changed to `25`. With a default of 50 an input of 50 could
no longer tell "the authored value survived" from "the default applied",
so the pin now uses a non-default value |
**Deliberately unchanged.** None of these states the current default:
- `component-object-grid-pagination-accept-set.pin.test.ts` docblock
table row `| view — PaginationConfigSchema | …default(25) | no |`. Its
column header is `declaration before #19046`, so it is a historical
record and still accurate.
- Authored `pagination: { pageSize: 25 }` values: `plugin-approvals`
`sys-approval-request.object.ts` (3 list views) and the CLI view
scaffold template (`packages/cli/src/commands/generate.ts`). These are
explicit author choices and still parse to 25.
- Other `pageSize: 25` hits in `packages/spec/src/api/metadata.test.ts`,
`kernel/metadata-plugin.test.ts`, `benchmark.bench.ts` and `sdui-parser`
tests. These are different surfaces or authored inputs.
- **Governed files:** none. No file under `skills/**` or `docs/adr/**`
states the view page-size default (grep for page size / pagination with
25, zero hits).
- **Hand-written docs / examples:** none. No hand-written page under
`content/docs/**` (outside `references/`) or `examples/**` states a
page-size default of 25.
## Surfaces this needed beyond the claim's list (measured, not optional)
1. **`packages/spec/scripts/lib/default-changes.ts`** gains the row
`ui/PaginationConfig:pageSize` `from '25'` `to '50'`. Without it `pnpm
--filter @objectstack/spec build` fails with `❌ 1 authorable key(s)
changed the DEFAULT they apply when the author omits them: -
ui/PaginationConfig:pageSize: 25 → 50`, and the gate prints this exact
row to add. The row's `reason` states what moves and the one-line way to
keep 25.
2. **Semantic migration entry `view-pagination-page-size-default-50`**
(`src/migrations/entries/semantic/18.…ts`, plus `registry.ts`
regenerated by `gen:migration-registry`). The ledger header prescribes
one for a default move that reaches already-deployed silent documents.
Every precedent where deployed behaviour moves has one: the autonumber
`unique` default, the audience posture default and the approval
escalation flip. The precedents where nothing deployed moves have none.
`gen:spec-changes` and `gen:upgrade-guide` were re-run and produced zero
diff, because step 18 is not projected yet. The same holds for the other
170 step-18 entries.
## Changeset level: `minor`
This is a behaviour change for every author who omits the key, with no
refusal and no type change. It is not a bug fix, so `patch` would
understate it. It is not a narrowing and not a removal, so it is not
breaking: `Clause-②: no`, no ADR-0087 marker owed
(`check-adr-0087-registration`: "this PR adds no declared-breaking
changeset"), and a `major` is refused by the repo in any case. This
matches the level the previous published-default moves shipped at (the
`enableOnInstall` default move and the default-flip conversion class
both shipped `minor`). The changeset states the behaviour change for
authors who omit `pagination.pageSize` and gives a FROM → TO table.
## Reverse verification (ablation), after the fix was committed
`node scripts/ablation-replace.mjs` put back
`.positive().default(25).describe(` in place of `.default(50)` at HEAD
eaf5d39. The `view.zod.ts` blob `c474dcb477c7` is identical at
72e9a6a. The anchor hit x1 → x0, and the blob went `c474dcb477c7` →
`c6933f3d2587`. Then it ran `vitest run src/ui/view.test.ts`. The
direction observed was the expected one, red: `Tests 1 failed | 460
passed (461)` with `FAIL … PaginationConfigSchema > should default
pageSize to 50` and `AssertionError: expected 25 to be 50`. The restore
was proven two ways: the blob equals the HEAD blob (`c474dcb477c7…`) and
`git diff HEAD` is empty. The script also carried an EXIT/INT/TERM trap
with an absolute path. The test imports `./view.zod` from source, so no
dist leg was needed.
## Tests and gates (at `72e9a6a0`, after merging `origin/main` e2c4e12)
- `@objectstack/spec` build: exit 0 (`📌 … ui/PaginationConfig:pageSize:
25 → 50`). `check:generated`: 1 stale artifact
(`content/docs/references/**`), fixed with `gen:docs`, then green.
- `@objectstack/spec` test (`--project local`): `Test Files 540 passed
(540)`, `Tests 15820 passed | 2 todo`. Test (`--project repo`): `31
passed`, `579 passed`. typecheck: exit 0.
- Consumer suites (contract-face fixture triage):
`@objectstack/platform-objects` `55 files / 911 tests passed`;
`@objectstack/lint` `108 files / 4144 tests passed`. A repo-wide grep
finds no test outside `packages/spec` that asserts a parsed view's
`pagination.pageSize` (no `.snap`/JSON fixture carries one either).
`plugin-approvals` / `cli` suites were not run locally; they are
declared to CI (their fixtures author `pageSize: 25` explicitly).
- Derived gates: `dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` on the actual 8 changed paths (merge base
e2c4e12) gives **112 commands**. Every one was run at 72e9a6a, and
its exit code was written to disk before any pipe. **108 exit 0.** 4 are
**NOT MEASURED**; each exited 3 with PREREQUISITE NOT MET because it
reads BUILT output of packages this diff does not touch:
- `check:skill-examples` needs `@objectstack/client-react` dist;
- `check:lean-entry-closure` needs `@objectstack/objectql` dist;
- `check:dual-build-cjs-loads` and `check:type-check-debt` need the
whole workspace built.
The targeted closure build could not get the shared verify lock (two
9-minute queue timeouts), so this is a declared narrowing, left to CI.
This diff adds or changes no export, type or module
(`check:api-surface`, `check:dts-closure` and `check:published-files`
are green). The reconciliation `dispatch-gates.mjs --ran` reads: `112
derived famil(ies) accounted for — 108 run, 4 NOT-MEASURED (4 DERIVED
from a recorded exit 3)`, 0 UNRUN. Three lint-dist gates first exited 3;
after the lint closure was built they were re-run green. Also run: the 5
artifact-roster gates whose roster lives in a directory this diff
touches (`check-changeset-fixed`, `check:meta-url-spelling`,
`check:authz-resolver`, `check:error-code-casing`,
`check:filter-alias-parity`), all exit 0.
- Mergeability: a driver-less `merge-tree` of this head onto origin/main
`836aad2a` (7 commits newer, one of them touching `registry.ts`) is
clean.
- `turbo ls --affected` is not used for any narrowing here.
## objectui (read-only, at `.objectui-sha` f8a9d0f)
No objectui test pins `25` as the spec default. objectui brings the spec
schema in as `stripImportedDefaults(SpecPaginationConfigSchema)`
(`packages/types/src/zod/objectql.zod.ts`), and
`spec-subschema-parity.test.ts` asserts identity against that stripped
object, not a value. Every `pageSize: 25` in objectui tests is an
authored input. objectui#9853 is where the renderer starts reading this
default. objectui was not edited.
## Acceptance notes
- The CLI view scaffold (`os generate view`) writes an explicit
`pagination: { pageSize: 25 }`, so a newly scaffolded view shows 25
rows, not the platform default. It is an authored value and it
validates. It is not a defect under the filing classes; noted only.
Carrier: none.
- `view.zod.ts` is region-split with seat 2's #20051. This diff touches
only `PaginationConfigSchema` (around line 1100). It does not touch the
flattened list-overlay region
(`ListViewShapeSchema.extend(flattenedViewOverlayFields()).strip()` /
overlay `options`).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Rjy9MeetSfq34PKn81CRiN)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e4471e6 commit 8ecbe0f
8 files changed
Lines changed: 146 additions & 9 deletions
File tree
- .changeset
- content/docs/references/ui
- packages/spec
- authorable-defaults
- scripts/lib
- src
- migrations
- entries/semantic
- ui
| 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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
930 | | - | |
| 930 | + | |
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| |||
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
1329 | | - | |
| 1329 | + | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
| |||
1595 | 1595 | | |
1596 | 1596 | | |
1597 | 1597 | | |
1598 | | - | |
| 1598 | + | |
1599 | 1599 | | |
1600 | 1600 | | |
1601 | 1601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
536 | 557 | | |
537 | 558 | | |
| 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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14207 | 14207 | | |
14208 | 14208 | | |
14209 | 14209 | | |
| 14210 | + | |
| 14211 | + | |
| 14212 | + | |
| 14213 | + | |
| 14214 | + | |
| 14215 | + | |
| 14216 | + | |
| 14217 | + | |
| 14218 | + | |
| 14219 | + | |
| 14220 | + | |
| 14221 | + | |
| 14222 | + | |
| 14223 | + | |
| 14224 | + | |
| 14225 | + | |
| 14226 | + | |
| 14227 | + | |
| 14228 | + | |
| 14229 | + | |
| 14230 | + | |
| 14231 | + | |
| 14232 | + | |
| 14233 | + | |
| 14234 | + | |
| 14235 | + | |
| 14236 | + | |
| 14237 | + | |
| 14238 | + | |
| 14239 | + | |
| 14240 | + | |
| 14241 | + | |
| 14242 | + | |
14210 | 14243 | | |
14211 | 14244 | | |
14212 | 14245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1434 | 1434 | | |
1435 | 1435 | | |
1436 | 1436 | | |
1437 | | - | |
| 1437 | + | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
1441 | | - | |
| 1441 | + | |
1442 | 1442 | | |
1443 | 1443 | | |
1444 | 1444 | | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
1445 | 1448 | | |
1446 | | - | |
| 1449 | + | |
1447 | 1450 | | |
1448 | 1451 | | |
1449 | 1452 | | |
1450 | | - | |
| 1453 | + | |
1451 | 1454 | | |
1452 | 1455 | | |
1453 | 1456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1096 | 1096 | | |
1097 | 1097 | | |
1098 | 1098 | | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1099 | 1104 | | |
1100 | 1105 | | |
1101 | 1106 | | |
1102 | 1107 | | |
1103 | 1108 | | |
1104 | | - | |
| 1109 | + | |
1105 | 1110 | | |
1106 | 1111 | | |
1107 | 1112 | | |
| |||
0 commit comments