Skip to content

Commit 53dda03

Browse files
docs(spec): the record-page timeline total's published description reads it as an upper bound of the drawn entries (#29357)
domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb5DkUodwi3PzSqr8HW8Hc8N)_ Fixes #29138 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:`RecordPageTimelineCountSchema` 的文档注释与 `total` 的 `.describe()` 改为说明总数统计的是请求所点名各来源的行数(按调用者可读),是「动态」面板实际绘制条目数的上界,并点名两种少画的情形;API 参考页与 JSON schema 随之重新生成;`@object-ui/types` 中 `RecordPageResponse.timeline` 的镜像注释同步改为同一说法。 - **为什么改**:#28998(PR #29120)只改了请求侧注释;发布到 JSON schema 的 `total` 描述仍写成「面板持有的条目数」,第三方客户端会把差值当成缺陷。 - **风险与回滚**:仅描述文本与注释,不动任何键、类型、`.min()`、默认值、导出与运行时行为;回滚即 revert 本 PR。 - **先看**:`packages/spec/src/api/record-page.zod.ts`(`RecordPageTimelineCountSchema` 注释与 `total` 描述)、`content/docs/references/api/record-page.mdx`(生成结果)、`ui/packages/types/src/data.ts`(`timeline` 注释)、`.changeset/29138-timeline-total-describe.md`。 - **两分钟验证**:`pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated`,预期 All 14 generated artifacts are up to date。 - **需要你做的**:无,席位落地(总监契约复核由席位转交)。 ## What changes - `packages/spec/src/api/record-page.zod.ts`: the `RecordPageTimelineCountSchema` docblock and its `total` `.describe()` now say what the `RecordPageTimelineRequestSchema` docblock (landed in d089dac) says: the total counts the rows of the sources the request named, as that schema's table defines them and as the caller may read them, so it is an upper bound of the entries the 动态 panel draws, not their number. Both name the two cases where the panel draws fewer: its `showCompleted` / `types` configuration, and a ledger row with no displayable diff. - The request-side `timeline` `.describe()` in `RecordPageRequestSchema` ("Return the size of the record's timeline stream over the sources named (`RecordPageTimelineCountSchema`).") is **not touched**. It says "size", the word the landed file header defines as the sources' row count, and it points at `RecordPageTimelineCountSchema`, whose `total` now carries the upper-bound sentence. The response-side `timeline` `.describe()` uses the same word and the card keeps it fixed, so leaving the request side alone keeps the two sides in the same words. - `ui/packages/types/src/data.ts`: the `RecordPageResponse.timeline` docblock in `@object-ui/types`, the UI's mirror of the response, says the same: the total counts the sources' rows, so it is an upper bound of the drawn entries, with the same two cases. Folded in by the seat's claim amendment on the card (comment 6577666544). Comment only. - No key, type, member, `.min()`, default or export moves. Only the two docblock comments and one description string change. - Generated: `content/docs/references/api/record-page.mdx` (the `total` row in both nested shapes that show `RecordPageTimelineCount`). The JSON schema under `packages/spec/json-schema/` is gitignored and regenerated by the build; nothing else that `check:generated` covers moved. - Changeset: `.changeset/29138-timeline-total-describe.md`, `@objectstack/spec: patch` and `@object-ui/types: patch` (its `dist/*.d.ts` ships the docblock). ## Tests No new tests: the change is prose. The spec package's suite and `check:generated` ran on the final head (readings below). ## Verification <details><summary>check:generated and the JSON schema reverse check</summary> - `pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated` before regenerating: `✗ 1 of 14 artifact(s) stale: check:docs`. After `check:generated --fix`: `✓ All 14 generated artifacts are up to date`. - Reverse check: `grep -rl "upper bound of the entries the timeline panel draws" packages/spec/json-schema` lists `api/RecordPageTimelineCount.json`, `api/RecordPageResponse.json` and `objectstack.json`; the old sentence has zero hits in `packages/spec/json-schema`, `content/docs` and `packages/spec/src`. </details> <details><summary>Tests, type-checks and the derived gate sweep on head 3d67012</summary> - `pnpm --filter @objectstack/spec test` on 21c2817 (the last head that moved `packages/spec`; 3d67012 only adds the `@object-ui/types` comment and the changeset line): VERDICT command-exit 0, Test Files 791 passed (791), Tests 23391 passed, 1 todo. - `pnpm --filter @objectstack/spec typecheck` (21c2817): exit 0. `pnpm --filter @object-ui/types run type-check` (3d67012): exit 0. - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` on 3d67012: 100 derived commands (38 changed lines, 4 files), including `node scripts/check-sdui-manifest.mjs` and `pnpm --dir ui exec vitest run scripts/`. Ran all 100: 99 exit 0, and `pnpm check:dual-build-cjs-loads` exits 3 (PREREQUISITE NOT MET: some workspace packages have no dist without a full build), so it is NOT MEASURED locally and left to CI. `--ran` reconciliation: 100 derived, 99 run, 1 NOT-MEASURED, 0 UNRUN. - The body gates (`check-changeset-no-major --base origin/main`, `check-closing-keyword-parity`, `check-adr-0087-registration --base origin/main`, `check-partof-closing-keyword`) exit 0 on this body with `Clause-②: no` / `Metadata-protocol: none`; none asked for a different declaration. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jUNaEANxba2LHLfyuZ)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent dfbe34d commit 53dda03

4 files changed

Lines changed: 31 additions & 7 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+
'@object-ui/types': patch
4+
---
5+
6+
docs(spec): the record-page `timeline` total's published description reads it as an upper bound of the drawn 动态 entries
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`RecordPageTimelineCountSchema.total`'s `.describe()`, which ships in the published JSON schema and the API reference, and the schema's docblock now say what the `RecordPageTimelineRequestSchema` docblock says: the total counts the rows of the sources the request named, as that schema's table defines them and as the caller may read them. That makes it an upper bound of the entries the 动态 panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. Description text only: no key, type, bound, default or export changes, and no behaviour changes.
12+
13+
The `RecordPageResponse.timeline` docblock in `@object-ui/types`, the UI's mirror of the response, says the same: the total counts the sources' rows, so it is an upper bound of the drawn entries, and the panel draws fewer in the same two cases. Comment only: no type, member or export changes.

‎content/docs/references/api/record-page.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ This schema accepts one of the following structures:
548548

549549
| Property | Type | Required | Description |
550550
| :--- | :--- | :--- | :--- |
551-
| **total** | `integer` | ✅ | How many entries the record's timeline stream holds for this caller, over the sources the request named. |
551+
| **total** | `integer` | ✅ | The rows of the sources the request named, counted as this caller may read them: an upper bound of the entries the timeline panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. |
552552

553553
### Nested Shape: `RecordPageResponse.timeline[option 2]`
554554

@@ -596,7 +596,7 @@ This schema accepts one of the following structures:
596596

597597
| Property | Type | Required | Description |
598598
| :--- | :--- | :--- | :--- |
599-
| **total** | `integer` | ✅ | How many entries the record's timeline stream holds for this caller, over the sources the request named. |
599+
| **total** | `integer` | ✅ | The rows of the sources the request named, counted as this caller may read them: an upper bound of the entries the timeline panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. |
600600

601601

602602
---

‎packages/spec/src/api/record-page.zod.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,18 @@ export const RecordPageStreamRowsSchema = lazySchema(() => z.object({
313313
export type RecordPageStreamRows = z.input<typeof RecordPageStreamRowsSchema>;
314314
export type RecordPageStreamRowsParsed = z.infer<typeof RecordPageStreamRowsSchema>;
315315

316-
/** [#28737] The `timeline` part: how many entries the record's 动态 stream holds. */
316+
/**
317+
* [#28737] The `timeline` part: the size of the record's 动态 stream, counted
318+
* by the reads `RecordPageTimelineRequestSchema` names, as the caller. The
319+
* total counts the sources' rows as that schema's table defines them, so it is
320+
* an upper bound of the entries the 动态 panel draws, not their number. The
321+
* panel draws fewer where its `showCompleted` / `types` configuration filters
322+
* entries out, and where a ledger row has no displayable diff and so draws no
323+
* entry.
324+
*/
317325
export const RecordPageTimelineCountSchema = lazySchema(() => z.object({
318326
total: z.number().int().min(0).describe(
319-
'How many entries the record\'s timeline stream holds for this caller, over the sources the request named.',
327+
'The rows of the sources the request named, counted as this caller may read them: an upper bound of the entries the timeline panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff.',
320328
),
321329
}).strict());
322330
export type RecordPageTimelineCount = z.input<typeof RecordPageTimelineCountSchema>;

‎ui/packages/types/src/data.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,12 @@ export interface RecordPagePayload {
423423
/** The record's newest attachments and their count, or their read's refusal (objectstack#28470). */
424424
attachments?: { total: number; records: Record<string, any>[] } | { error: RecordPagePartRefusal };
425425
/**
426-
* How many entries the record's 动态 stream holds over the sources the
427-
* request named (objectstack#28737), or the refusal of a comment or
428-
* activity read.
426+
* The size of the record's 动态 stream over the sources the request named
427+
* (objectstack#28737), or the refusal of a comment or activity read. The
428+
* total counts the sources' rows, so it is an upper bound of the entries the
429+
* 动态 panel draws, not their number: the panel draws fewer where its
430+
* `showCompleted` / `types` configuration filters entries out, and where a
431+
* ledger row has no displayable diff and so draws no entry.
429432
*/
430433
timeline?: { total: number } | { error: RecordPagePartRefusal };
431434
}

0 commit comments

Comments
 (0)