fix(plugin-timeline): gate the record query on the settled object definition (objectui#7895) - #7905
Merged
Merged
Conversation
…inition (objectui#7895) `ObjectTimeline` was the last member of the set objectui#6482 converged on the shared settled-schema gate, and nothing marked it a deliberate exclusion. It held the object definition in a local `useState` fed by its own metadata effect and listed that definition in the record-fetch effect's dependency array, so every object-bound load issued two `find` calls — the first unexpanded, before the definition landed — and, whenever the metadata read was the slower of the two, painted three times. The resolution half is now `useSettledSchema` (`@object-ui/react`), which settles on every exit; the gate holds only the branch that issues the query. The metadata read is deliberately NOT disabled for an authored-items timeline: unlike the two sibling conversions, this component reads the definition's fields for option colours and labels on that path. Measured with an instrumented renderer, one mount per hold, `getObjectSchema` held over a refined grid, `ObjectCalendar` and `ObjectGantt` as positive controls in the same vitest run: before, 2 finds with expand sets `[null, ['owner']]`, 1 paint plus 3 late writes at every hold from +3ms up; after, 1 expanded find, 1 paint, 0 late writes, first paint tracking the hold. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This was referenced Sep 6, 2026
os-sam
marked this pull request as ready for review
September 6, 2026 02:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7895
ObjectTimelinetakes the settled-schema gate objectui#6482 converged the record views on. The localuseStatefor the object definition and its hand-written metadata effect are replaced by the shareduseSettledSchemafrom@object-ui/react, and the record-fetch effect now waits on that resolution instead of listing the definition in its dependency array and re-running once it lands.ObjectGantt(objectui#7225 ask 2) is the worked example this follows;ObjectCalendar(objectui#6453) is the other. No third shape was designed — the set was deliberately converged and this was its last unconverted member, with nothing marking it a deliberate exclusion.The measurement — a green run with no hold is zero evidence here
This container settles the metadata read and the record read together by default, so the defect is invisible unperturbed. The lever is the metadata fetch, so
getObjectSchemawas held by a fixed delay and the writes into an instrumented renderer counted per SINGLE mount, withObjectCalendarandObjectGanttin the same vitest run as positive controls. Grid: 0/1/2/3/4/5/6/7/8/9/10/15/25/50/100 ms, one mount per hold. This is PR #7892's measurement shape, re-run on both sides of the change.Before —
ObjectTimeline, 2findcalls, expand sets[null, ['owner']]at every hold:The card's expected N=3 at +25 ms reproduced exactly, and the refined grid located its lower edge: nothing at +0/+1, one late write at +2, the full three from +3 ms up. The unperturbed rows show nothing, which is the reading objectui#7466 paid for.
After — one
find, carrying['owner'], at every hold:⭐ First paint tracks the hold. That is the signature that the gate is live, not an absence of observation: before the change the first paint sat at a flat 3-7 ms whatever the hold, i.e. it arrived before the metadata; after it moves with the hold the way both gated siblings already did.
Positive controls, same runs.
ObjectCalendarandObjectGanttread 1 paint / 0 late writes / 1 expandedfindat every hold, before and after, with their first paint tracking the hold throughout (calendar 29 ms at +25 and 103 ms at +100; gantt 29 ms and 104 ms). They are what make the timeline's zeroes readable: the instrument does fire, in this container, on this day, in those same runs.Second-order reading — the objectui#7466 fixture no longer reddens
The double paint is what made the timeline ladder fixture intermittently red, so the question was put to the same instrument: does the fixture still redden under the pre-#7521 harness shape — module global, arity-only predicate, no unmount, a re-read of the global — with two renders inside one
it? Measured in the 1-9 ms window, 10 repetitions per hold, the fix reverted and then restored:Failures carry the card's exact signature —
second=["#abc"]where["#123456"]was authored, the first render's colour read back out of the module global by the second. The answer is that it no longer reddens there, which is this card's second delivered reading rather than a claim that no second mechanism exists: the window swept is 1-9 ms and the shape swept is that one fixture.⛔ No guard was deleted or relaxed because of it. A guard's value does not depend on there currently being a live trigger, and
ObjectTimeline.colorFieldLadder-7243.test.tsxis untouched by this PR.Reverse verification
The fix was committed first, then reverted with
git checkoutpinned to the base commitd9580f464(never to a moving remote-tracking name), the mutation confirmed on disk by blob hash (1b4575d, against HEAD's6eae2ef), and restored fromHEADunder a trap. Restoration proved by an emptygit diff HEADand a matching blob hash, not by an exit code.With the fix reverted, the new pin reads 4 failed / 2 passed. The two that stay green are the two whose behaviour the gate does not change: the adapter that exposes no
getObjectSchema(one query either way) and the authored-itemstimeline (no query either way). Predicted before running: the first two cases red. Observed: those two plus the held-paint case (the mechanism itself) and the rejecting-read case, the latter because the replaced effect logged throughconsole.warnwith its own wording where the shared hook logs[useSettledSchema]throughconsole.error. Direction as predicted, magnitude higher, reported rather than adjusted.Two deliberate departures from the sibling conversions
ObjectCalendarandObjectGanttpasshasInlineData ? undefined : dataSource, because they read metadata only to expand a record query. This component also reads the definition's fields ineffectiveItems— option colours and field labels — on the authored-items path, where no query is issued at all. Their recipe would take that read away; a fetch-sequencing change must not.schema.objectName, notresolveRecordSourceObjectName. That is the object the record query itself names (dataSource.find(schema.objectName, …)) and the one the replaced effect read. This component resolves nodatablock to take a second name from, and gating on a key the query does not use is the stale-key mismatch the hook's render-time comparison exists to make unrepresentable.Scope
Internal fetch sequencing only. No schema key, no zod, no validator accept/reject behaviour, no gate predicate and no scan population moved.
useTimelineTranslation.ts(objectui#7874 / PR #7887's surface, since landed on main) is untouched; the$expandset and its FLS gate are objectui#7429's concern and are untouched;ObjectGanttandObjectCalendarare untouched.Filed while here, deliberately out of scope for this PR: objectui#7903 —
ObjectGalleryinpackages/plugin-listcarries the identical pre-gate shape, including the same log wording. Out of this card's binding file surface, so it is an unassigned finding rather than a rider on this PR.Changeset
node scripts/check-changeset-presence.mjs, verbatim (the verdict line is prefixed with a green check in the real output; transcribed here asOKso the character survives):Scored
patch: one fewer round trip per load and no three-step paint is user-visible, so the empty-frontmatter form would have declared something untrue.Verification
Re-run after the final commit, on the pushed SHA
aca81f48a, withgit diff HEADempty:pnpm exec vitest run packages/plugin-timeline/— 24 files / 297 tests passed (23 pre-existing files plus the new pin; the pin's 6 cases verified by name in a verbose run)pnpm --filter @object-ui/plugin-timeline run type-check— Done (tsc --noEmit && tsc -p tsconfig.test.json). Not vacuous:tsc -p tsconfig.test.json --listFilesnames bothsrc/ObjectTimeline.tsxandsrc/ObjectTimeline.fetchGate-7895.test.tsx, so it is a real reading about thempnpm --filter @object-ui/plugin-timeline run lint— 0 errors (109 pre-existing warnings)check-changeset-presence,check-changeset-no-major,check-changeset-overwrite,check-changeset-fixed,check-control-bytes,check-vi-mock-specifiers,check-vi-mock-inherit,check-unreferenced-sources,check-lint-coverage,check-type-check-coverage,check-package-self-import,check-i18n-call-site-keys,check-i18n-dead-keys,check-side-effects-array,check-entry-guard— all exit 0check-governed-queue-guard --teston all three changed paths —NOT GOVERNED, 3 path(s) checked against 5 governed surface(s); none matchedcheck-readme-exportsandcheck-sdui-registration-pinsboth exit non-zero here for a missing prerequisite, not a finding — they say so themselves (its type entry ./dist/index.d.ts is not on disk -- run pnpm build first, andNo console build to weigh at apps/console/dist/assets). Neither is in the family derived from these paths, and CI builds before running them.Repo-wide
pnpm lintis left to CI;plugin-timelinewas linted in full and the config is not type-aware, so this change cannot move a judgement on a file it does not touch.Session:
https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3Generated by Claude Code