Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit 95bd23c

Browse files
feat(plugin-timeline): declare navigation on object-timeline, by reference to the spec (objectui#8654) (#11324)
Fixes #8654 Clause-②: yes `navigation` is now declared on the `object-timeline` block, by reference to the spec. This is the timeline arm of the objectui#8652 maintainer ruling (verbatim 「B」): declare the key on the platform element schema first, then mirror it here. The platform half shipped in `@objectstack/spec` 17.5.0, the release this repo resolves: `ComponentPropsMap['object-timeline']` declares `navigation: NavigationConfigSchema.optional()`, and its docblock names it the spec half of that ruling, honoured standalone, with no enclosing view. Dispatched by the `domain:spec @ objectui` seat (objectui#10217), session `https://claude.ai/code/session_01VhxTqosz7wn54ahqyxgERT`. ## Premises, re-measured on `origin/main` `cd5b19a7e` before the first edit - **H1 holds; no edit there.** `ObjectTimelineBlockSchema` reads the spec row by reference in its `properties` bag. On the installed 17.5.0, `{ type: 'object-timeline', properties: { navigation: { mode: 'drawer' } } }` parses on `safeValidateSchema` and on `StrictAnyComponentSchema`. A bad `mode` is refused at `properties.navigation.mode` and a bogus member at `properties.navigation`, on both faces. A parse writes no default. `objectql.zod.ts` is untouched. - **H2 confirmed, but its placement is falsified.** The TypeScript checker (`getPropertyOfType`, not a grep) reads `navigation` as NOT DECLARED on `ObjectTimelineProps['schema']` and on `TimelineSchema`; the read went through `(schema as any).navigation`. The same instrument's lit control is the reason this PR does not put the member on `TimelineSchema`: `objectName`, a member of the same spec row, reads DECLARED on the plugin-local half of `ObjectTimelineProps['schema']` and NOT DECLARED on `TimelineSchema`. A nonsense key reads not declared on both. - `TimelineSchema` is the presentational rail (`type: 'timeline'`). Its docblock calls its vocabulary disjoint from the object-bound one by design, and `TimelineRenderer` never reads `navigation`. - The spec declares `navigation` on the `object-timeline` row only and has no `timeline` component row. Declaring it on `TimelineSchema` would add the key to a face the spec does not declare it on (the dispatch's zone-1 ruling forbids that). - Measured: the strict face refuses `objectName` on `type: 'timeline'`. A `navigation` declared there could not build the `new_window` URL, which needs the object name. - objectui#8220 handled `filter` and `sort` on these same two tags the same way: registration `inputs` on both tags, `TimelineSchema` left alone. - ⇒ The member is declared on the object-bound half of `ObjectTimelineProps['schema']` in `plugin-timeline/src/ObjectTimeline.tsx`, beside `objectName`, `timeline`, `filter` and `sort`. That file is inside the claim. `@object-ui/types` is NOT changed: neither `data-display.ts` nor `zod/data-display.zod.ts` is touched, so this PR does not overlap the objectui#6152 round-5 region. - **H3 confirmed.** Neither registration published `navigation`. The description was written from measurement on the real component, and it differs from the board's and the calendar's in two places, as listed under Acceptance notes. - **H4 confirmed: the guard owes nothing here and cannot take a pin yet.** `registry-inputs-spec-parity.test.ts` books `object-timeline` in `UNJUDGED_SPEC_BLOCKS`, owed to objectui#11168 (it does not load the lazily registered block). Its assertion `every member pin names a key that is still array/object-armed on a covered block` would refuse a `MEMBER_PINS` entry for `object-timeline.navigation`. So that file is NOT edited. The pin file below names the block and the key, so the locator accepts it when slice 3 registers the entry. ## What changed - `@object-ui/plugin-timeline`: - `ObjectTimelineProps['schema']` declares `navigation?: ViewNavigationConfig`, the spec's `NavigationConfig` type that `ObjectGridSchema`, `ObjectKanbanSchema` and `ObjectCalendarSchema` use. `ObjectTimeline` reads `schema.navigation` with no cast. The read still supplies no default (see Acceptance notes). - Both registrations, `object-timeline` and `view:timeline`, publish a `navigation` input typed `object`, with one shared description. Both tags carry it for the reason both carry `filter` and `sort`: `view:timeline` is the same renderer under a second tag. That is also the calendar precedent from PR objectui#11292 (`OBJECT_CALENDAR_INPUTS`, shared by `object-calendar` and `calendar`). - Docs (AGENTS.md #2): `README.md` and `content/docs/plugins/plugin-timeline.mdx` document the object-bound block's `properties` bag and its `navigation` key, member by member, with the three cases that open nothing. - Changeset `.changeset/8654-timeline-navigation.md`: `@object-ui/plugin-timeline` minor (a widening). The fixed group moves together anyway. ### Pins - `object-timeline-navigation-8654.test.tsx`: - the spec premise, read live from the installed spec: it declares the key, and it refuses a bad `mode` at `navigation.mode`; - on both validator faces, value-level: every mode parses, a bad `mode` is refused at `properties.navigation.mode`, a bogus member is refused, the retired `view` member is refused, and a parse writes no default; - the TS face: an `Equal` assertion, a `@ts-expect-error` bad-mode row, and a valid block that annotates with no cast; - both registrations: the input is declared as `object`, the html tier accepts the block and refuses a string by kind, and a control prop is still reported as unknown; - end to end through the real `SchemaRenderer` and registry, on both tags: an authored drawer block opens the record, and the same node without the key opens nothing. - `timelineNavigationMembers-8654.test.tsx`, the member pin: every member through a real entry click on the real `ObjectTimeline`, `useNavigationOverlay` and overlay shell: - `drawer` (the lit control), `modal` and `popover` open the entry's record; - `none` opens nothing, and `preventNavigation` outranks an overlay mode; - `new_window` opens the record page in a new tab, and `openNewTab` does too, outranking both `page` and `drawer`; - `size` resolves through the bucket table, a deprecated `width` wins over `size`, and `auto` gives the unsized width; - a parent `onRowClick` outranks the whole key; - four warning rows hold the description to the truth: an absent key, `page`, a mode-less block and `split` each open nothing. ## Verification, on `b6a1f6057` (the head of this PR) - The dependency closure was built first (`pnpm --filter '@object-ui/plugin-timeline^...' run build`, 9 packages). `pnpm --filter @object-ui/plugin-timeline run type-check` echoed `tsc --noEmit && tsc -p tsconfig.test.json` and exited 0. `tsc -p tsconfig.test.json --listFilesOnly` lists both new pin files, with the objectui#8220 pin as the control. - `pnpm exec vitest run packages/plugin-timeline/`: `Test Files 41 passed (41)`, `Tests 461 passed | 34 skipped (495)`. The skips are all in the existing `dateOnlyZone-10866` files. The two new files: 22 + 16 passed. - Neighbouring suites that read these registrations, this source, or the object-timeline arm: 26 files, `Tests 1409 passed (1409)`. They cover: - console: `registry-inputs-spec-parity`, `public-contract`, `public-block-binding-reach`, `timelineAxisRefusalReach-7070`, `filterContextTokensSweep-10666`, `pullToRefreshOwner-10105`; - types: `object-timeline-arm-10859-b3`, `object-kanban-calendar-navigation-8652`, `timeline-declared-keys`, `zod-mirror-parity`, `base-bind-declared`, `timeline-catalog-fixture-migrated`; - `navigationOverlayConsumers.onRowClickArity-9357`, `ObjectTree.schemaTyped-8655`, `registered-types-validate-ratchet-10859`, `catalog-gallery-render`, the list and view timeline-binding suites; - the script tests for component-surface-parity, designer-field-key-parity, handler-key-read-sites, prompt-component-keys, sdui-registration-pins, registry-bare-names and date-only-zone-pins. - Gates exiting 0: - `check:designer-field-key-parity`, `check:component-surface-parity`, `check:prompt-keys`, `check:handler-key-reads`, `check:registry-bare-names`, `check:element-data-source-declaration`, `check:spec-symbols`; - `check:doc-types`, `check:doc-fences`, `check:doc-example-ids`, `check:doc-example-readers`; - `check:new-line-citations`, `check:control-bytes`, `check:installed-pin-claims`, `check:comment-mask-corpus`, `check:unreferenced-sources`, `check:phantom-deps`, `check:shell-escape-residue`, `check:i18n-keys`; - `check:test-path-roots` and the three `check:vi-mock-*`; - `check:changeset-claims`, `check:pending-changeset-literals`, changeset presence and no-major; - `check:readme-exports`, `check:doc-snippets` and `check:doc-examples`, each run after the doc-snippet build closure was built (the first `readme-exports` run reported a collapsed population on an unbuilt tree, which is not a verdict); - `check:sdui-registration-pins` and `check:eager-closure`, each run after a full console build (the first console build stopped on an unbuilt `@object-ui/plugin-tree`, which is a prerequisite miss, not a verdict). - Lint, as a declared narrowing: - `eslint --no-inline-config --format json` over the 4 changed TS files reports 4 files and 0 errors. - Warnings against the base blobs: `ObjectTimeline.tsx` 28 to 27 (the removed cast) and `index.tsx` 5 to 5. The new contract pin carries 1, the deliberate `any` in its `Equal` control. - `eslint.config.js` enables no type-aware linting (no `parserOptions` / `projectService`). None of the 10 rule sources under `eslint-rules/` reads the filesystem; as a control, 9 of them contain `context.report`. So this diff cannot move a verdict on an untouched file. - The repo-wide `pnpm lint` is left to CI. ### Ablations, each committed first, run through `ablation-replace.mjs`, and restored to `HEAD` Each ablation was proven landed by anchor count and blob change. Each restore was proven by blob equals `HEAD` and an empty `git diff HEAD`, and the tree was clean afterwards. - **TS member removed** (renamed away, so the import stays used): `tsc -p tsconfig.test.json` exits 2, with TS2344 on the `Equal` assertion and TS2578 (unused `@ts-expect-error`) on the bad-mode row. This was the predicted direction. - **Renderer read ignores the authored key** (`navigation: undefined`): 11 failed and 27 passed. The 11 are exactly the rows where a click opens something: 9 member rows and the 2 end-to-end drawer rows. Every "opens nothing" row and the parent-handler row stayed green. ⚠️ The count pre-registered before the run was 12, a miscount by me; enumerating the "opens something" rows gives 11. - **`object-timeline` registration row removed** (the `view:timeline` row kept): 2 failed and 20 passed, as predicted. The failures were the declared-as-object row and the html-tier row for that tag. The first attempt was a no-op, which the tool refused before running anything: the replacement was a suffix of the anchor, so its count could not rise. It was re-anchored and re-run. - The validator face was not ablated, because this PR does not change it. Its rows pin the existing by-reference reading (objectui#10859 batch 3). ## Acceptance notes - ⚠️ **Three cases open nothing on a standalone timeline.** All three are measured on the real component. The description, the docs and four pin rows state them. They are not changed here. - An **absent key** opens nothing. Unlike `ObjectKanban` and `ObjectCalendar`, `ObjectTimeline` supplies no `?? { mode: 'drawer' }` default, so the hook resolves the spec's `page`. - `page`, and a block written without `mode`, open nothing. This is the objectui#11293 family, and the timeline is a third site of it. - `split` opens nothing. The timeline hands `NavigationOverlay` no `mainContent`, and the split shell returns nothing without it. The board, the calendar, the gantt and the grid all pass it. This is reported to the seat as a finding. - `onItemClick` fires twice per entry click when it is the only host handler. `ObjectTimeline` hands `onRowClick ?? onItemClick` to the hook, which calls it. The composed `onItemClick` then calls `onItemClick` again after `navigation.handleClick`. This was measured once by a probe (two calls, with 2 and 1 arguments). No in-repo producer passes `onItemClick` to `ObjectTimeline`. Not pinned. Carrier: none. - The strict authoring face refuses `objectName` on `type: 'timeline'`, while the `view:timeline` registration marks it `required: true`. That is pre-existing and was observed while choosing the TS face. It is not measured through a public door. Carrier: none. - Overlap: PR objectui#11312 (objectui#11117) is in `objectql.zod.ts`, which this PR does not touch. objectui#6152 round 5 is in `data-display.ts` / `zod/data-display.zod.ts`, which this PR does not touch either. `registry-inputs-spec-parity.test.ts` is not edited. --- _Generated by [Claude Code](https://claude.ai/code/session_01VhxTqosz7wn54ahqyxgERT)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0e6e76b commit 95bd23c

7 files changed

Lines changed: 671 additions & 2 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/plugin-timeline': minor
3+
---
4+
5+
`navigation` is declared on the `object-timeline` block, by reference to `@objectstack/spec` (objectui#8654). This is the timeline arm of the objectui#8652 maintainer ruling: the spec declares the key on the `object-timeline` element from 17.5.0, for the block standalone, and objectui now mirrors it.
6+
7+
- `ObjectTimelineProps['schema']` declares `navigation` with the spec's `NavigationConfig` type (`ViewNavigationConfig`), the type the grid, kanban and calendar schemas use. `ObjectTimeline` reads the key without a cast. `TimelineSchema` in `@object-ui/types` is unchanged: it describes the presentational rail, which does not read the key.
8+
- The `object-timeline` and `view:timeline` registrations publish `navigation` in their `inputs`, so the designer offers it.
9+
- An authored `{ "type": "object-timeline", "properties": { … } }` document was already judged by the spec row: a bad `mode` is refused at `properties.navigation.mode`, and a member the spec does not declare inside the block is refused. That is unchanged and now pinned.
10+
11+
What a click does with each member is unchanged. `drawer`, `modal` and `popover` open the entry's record in that overlay, and `new_window` or `openNewTab: true` opens the record page in a new tab. Three things open nothing on a timeline that no parent view navigates for: an absent key, `page` (also what a block without `mode` resolves to), and `split`. The published input description says so.

‎content/docs/plugins/plugin-timeline.mdx‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,48 @@ writing one is a type error and a validation failure. Write `items` instead of
177177
the vertical rail is always drawn on the left.
178178
</Callout>
179179

180+
## Object-bound timeline (`object-timeline`)
181+
182+
`object-timeline` fetches records from `objectName` and draws one entry per
183+
record, from the fields its `timeline` config names. An authored node takes its
184+
props in the `properties` bag, where `@objectstack/spec`'s
185+
`ComponentPropsMap['object-timeline']` row declares them:
186+
187+
```json
188+
{
189+
"type": "object-timeline",
190+
"properties": {
191+
"objectName": "project_task",
192+
"timeline": { "startDateField": "start_date", "titleField": "name" },
193+
"navigation": { "mode": "drawer" }
194+
}
195+
}
196+
```
197+
198+
### Entry-click navigation
199+
200+
`navigation` is what an entry click opens — the spec's `NavigationConfig` by
201+
reference, `ViewNavigationConfig` in `@object-ui/types`, the type
202+
`ObjectGridSchema.navigation` uses: `mode` (`page`, `drawer`, `modal`, `split`,
203+
`popover`, `new_window` or `none`) with `size`, `openNewTab` and
204+
`preventNavigation`.
205+
206+
| Member | On an entry click |
207+
|--------|-------------------|
208+
| `mode: 'drawer'` / `'modal'` / `'popover'` | Opens the entry's record in that overlay |
209+
| `mode: 'new_window'`, or `openNewTab: true` | Opens the record page in a new tab; `openNewTab` outranks the mode |
210+
| `preventNavigation: true`, or `mode: 'none'` | Opens nothing |
211+
| `size` | Sets the overlay width (`sm` … `full`, or `auto` for the default) |
212+
213+
A click handler from a parent view outranks the whole key.
214+
215+
<Callout type="warn">
216+
Write the block with `mode`. With the key absent, or with a block written
217+
without `mode` (it takes the spec's `page` default), a click opens nothing on a
218+
timeline no parent view navigates for (objectui#11293). `split` opens nothing on
219+
this block either, because the timeline gives the split shell no main panel.
220+
</Callout>
221+
180222
## Variants
181223

182224
### Marker Variants

‎packages/plugin-timeline/README.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,37 @@ const schema = {
7575
};
7676
```
7777

78+
### Object-bound timeline (`object-timeline`)
79+
80+
`object-timeline` fetches records from `objectName` and draws one entry per
81+
record, from the fields its `timeline` config names. An authored node takes its
82+
props in the `properties` bag, where `@objectstack/spec`'s
83+
`ComponentPropsMap['object-timeline']` row declares them:
84+
85+
```json
86+
{
87+
"type": "object-timeline",
88+
"properties": {
89+
"objectName": "project_task",
90+
"timeline": { "startDateField": "start_date", "titleField": "name" },
91+
"navigation": { "mode": "drawer" }
92+
}
93+
}
94+
```
95+
96+
`navigation` is what an entry click opens — the spec's `NavigationConfig` by
97+
reference, `ViewNavigationConfig` in `@object-ui/types`: `mode` (`page`,
98+
`drawer`, `modal`, `split`, `popover`, `new_window` or `none`) with `size`,
99+
`openNewTab` and `preventNavigation`. `drawer`, `modal` and `popover` open the
100+
entry's record in that overlay, `new_window` and `openNewTab: true` open the
101+
record page in a new tab, `preventNavigation: true` opens nothing, and `size`
102+
sets the overlay width. A click handler from a parent view outranks the whole
103+
key. ⚠️ Write the block with `mode`: with the key absent, or with a block
104+
written without `mode` (it takes the spec's `page` default), a click opens
105+
nothing on a timeline no parent view navigates for (objectui#11293). `split`
106+
opens nothing on this block either, because the timeline gives the split shell
107+
no main panel.
108+
78109
## Links
79110

80111
- 📚 [Documentation](https://www.objectui.org/docs/plugins/plugin-timeline)

‎packages/plugin-timeline/src/ObjectTimeline.tsx‎

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import React, { useEffect, useState, useCallback, useMemo, useRef } from 'react';
10-
import type { DataSource, TimelineSchema, ListViewTimelineConfig } from '@object-ui/types';
10+
import type { DataSource, TimelineSchema, ListViewTimelineConfig, ViewNavigationConfig } from '@object-ui/types';
1111
import { useDataScope, useNavigationOverlay, useSafeFieldLabel, useSettledSchema, useDataInvalidation, useFilterScope, useResolvedFilter } from '@object-ui/react';
1212
import { NavigationOverlay } from '@object-ui/components';
1313
import { extractRecords, buildExpandFields, convertSortToQueryParams, createFieldColorResolver, recordDisplayValueAt, toDisplayDate } from '@object-ui/core';
@@ -171,6 +171,41 @@ export interface ObjectTimelineProps {
171171
* has always declared on it, and that this renderer now actually reads.
172172
*/
173173
timeline?: ListViewTimelineConfig;
174+
/**
175+
* Entry-click navigation — what a click on an entry opens (an overlay
176+
* mode, the record page in a new tab, or nothing), with the overlay `size`
177+
* and the `openNewTab` / `preventNavigation` flags. Handed to
178+
* `useNavigationOverlay` below, which the composed `onItemClick` fires.
179+
*
180+
* DECLARED by objectui#8654, the timeline arm of the objectui#8652
181+
* maintainer ruling, verbatim 「B」: the platform half is
182+
* `@objectstack/spec` 17.5.0, whose `ComponentPropsMap['object-timeline']`
183+
* row declares `navigation: NavigationConfigSchema.optional()` for this
184+
* block standalone, with no enclosing view. So this member follows the
185+
* installed spec rather than leading it. Before it, the read went through
186+
* an `as any` cast, and without the cast it would have compiled only
187+
* through `BaseSchema`'s `[key: string]: any`.
188+
*
189+
* Declared HERE, beside `objectName`, `timeline`, `filter` and `sort`,
190+
* rather than on `TimelineSchema` in `@object-ui/types`, and that is the
191+
* spec's own split: `TimelineSchema` is the presentational rail, whose
192+
* renderer never reads this key, while the spec declares it on the
193+
* object-bound `object-timeline` row only. That row's other members live
194+
* on this half for the same reason. The zod face of the row is
195+
* `ObjectTimelineBlockSchema`'s `properties` bag, which reads the spec row
196+
* by reference and so judges this key already.
197+
*
198+
* Same spec type as `ObjectKanbanSchema.navigation` and
199+
* `ObjectCalendarSchema.navigation` — aligned with `@objectstack/spec`
200+
* `NavigationConfig` rather than restated, so the vocabulary cannot fork.
201+
*
202+
* ⚠️ Unlike the board and the calendar, this renderer supplies NO default
203+
* for an ABSENT key: the hook then resolves the spec's `page`, and a click
204+
* opens nothing on a timeline no parent view navigates for. A parent's
205+
* `onRowClick` / `onItemClick` outranks the whole key. The members are
206+
* pinned in `__tests__/timelineNavigationMembers-8654.test.tsx`.
207+
*/
208+
navigation?: ViewNavigationConfig;
174209
/**
175210
* Query filter for the object fetch, in any shape `toFilterNode` accepts
176211
* (spec `ViewFilterRule[]`, ObjectQL AST nodes, or a MongoDB-style object).
@@ -750,8 +785,13 @@ export const ObjectTimeline: React.FC<ObjectTimelineProps> = ({
750785
enabled: !!schema.objectName && !!dataSource,
751786
});
752787

788+
// `navigation` is a declared member of this component's schema since
789+
// objectui#8654 (see `ObjectTimelineProps`), so it is read with no cast.
790+
// ⛔ No `?? { mode: 'drawer' }` here: an absent key resolving to the hook's
791+
// `page` is the behaviour the published description states and the member
792+
// pins hold. Changing it is objectui#11293's question, not a read-site edit.
753793
const navigation = useNavigationOverlay({
754-
navigation: (schema as any).navigation,
794+
navigation: schema.navigation,
755795
objectName: schema.objectName,
756796
onRowClick: onRowClick ?? onItemClick,
757797
});

0 commit comments

Comments
 (0)