Skip to content

fix(console): View all → New seeds the relationship lookup's dependsOn fields - #37421

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-37290-view-all-new-seed
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-37290-view-all-new-seed

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37290
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:从记录页相关列表点「查看全部」进入列表,再点「新建」时,关联字段所依赖的上级值(如客户)会和父记录一起预填,不再卡在「请先选择客户」。
  • 为什么做:补齐上一张相关页签预填改动漏掉的「查看全部」入口,两条入口用同一套预填规则。
  • 出错会怎样:只影响新建表单打开时的初始值;关联字段没有声明依赖时行为与今天一致,读不到父记录时退回只带父记录;可直接撤回。
  • 要你做什么:无。

What changes

ObjectDataPage's New under a record trail (a related list's "View all") wrote the parent formLink pair alone. It now applies relatedCreateSeedOf (from @object-ui/plugin-detail/core, already exported and already imported by RelatedRecordActionsBridge): parent pair first, then one formLink pair per dependsOn field, the same URL shape the related tab's New writes.

  • A2 measured: the page holds only the trail's parent id (source.i), not the parent record. The related-tab New uses its mounted parent record; here the page reads it once via dataSource.findOne(source.o, source.i), and only when the relationship lookup declares a non-empty dependsOn (looked up with parentRelationshipFieldDef, so array-form field lists count too). No dependsOn means no read. A failed or empty read opens with the parent pair alone.
  • A1 holds: no export change; nothing copied.

Files to read first (by risk): ui/packages/app-shell/src/views/ObjectDataPage.tsx (the New button's onClick, the async findOne branch).

Tests

ui/packages/app-shell/src/views/ObjectDataPage.viewAllNewSeed-37290.test.tsx: two cases.

  • contract.opportunity dependsOn: ['account'], trail parent opportunity O-1 (account A-1): formLink = ['opportunity:O-1', 'account:A-1'], findOne called once with ('opportunity', 'O-1').
  • CONTROL: task.opportunity with no dependsOn: formLink = ['opportunity:O-1'], no read of the parent.
Pin green with fix, red without (head ad4ceb5)
  • With the fix: Test Files 1 passed (1) · Tests 2 passed (2), lock VERDICT command-exit 0.
  • ObjectDataPage.tsx checked out from base ff6f9768d2 (relatedCreateSeedOf count 0), restored from HEAD (hash matches the HEAD blob, git diff HEAD empty): Tests 1 failed | 1 passed (2), AssertionError: expected [ 'opportunity:O-1' ] to deeply equal [ 'opportunity:O-1', 'account:A-1' ], lock VERDICT command-exit 1. The control stays green both ways.

Acceptance notes

  • "That path seeds through the same relatedCreateSeedOf": yes, the one exported function, no copy.
  • "One pin covers it, red without the fix": the file above, red reading quoted.

Verification

Local gates
  • dispatch-gates --ran: 38 derived, 36 run (all exit 0), 2 NOT-MEASURED (check:type-check-debt and pnpm --dir ui exec vitest run scripts/: both need the shared verify lock, held by a sibling run 30+ minutes). CI runs both.
  • pnpm --filter @object-ui/app-shell run type-check: NOT MEASURED locally for the same reason; CI Type Check UI covers it.
  • overlap-check --branch=HEAD: VERDICT clean exit 0. origin/main merged once before opening (no conflict).

Two-minute check: cd ui && pnpm exec vitest run packages/app-shell/src/views/ObjectDataPage.viewAllNewSeed-37290.test.tsx; expect 2 passed.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv

…n fields

The record-trail New on ObjectDataPage wrote the parent formLink pair
alone. It now applies relatedCreateSeedOf, the seed the related tab's New
writes: the parent record is read once (the trail carries its id only),
and only when the relationship lookup declares dependsOn.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 7bcb29c · 2026-11-26T03:43Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 7bcb29c20a13387333bbef532a003b4a8974b093
Local-runs: none

PR #37421 for card #37290. Read: the card body and its four comments (triage 7163981674 and 7167139627, claim 7180634038, dev report 7181920218; no ruling and no earlier record on the card), the PR body, the three-file net diff against origin/main, the 51 check-runs on this head, and the cited source on the head (relatedParentScope.ts, parent-scope.ts, RelatedRecordActionsBridge.tsx, AppContent.tsx). Nothing built or run.

Face: no published schema and no governed path in the three files (Governed Surface Queue Guard success), and the Clause-②: line is a bare no with no narrowing arm, so the declaration face is what remains and TIER_DEFAULT is the exact tier.

① Derived judgments

  • Public exports: none added, none changed. Right. relatedCreateSeedOf is already exported at ui/packages/plugin-detail/src/core.ts:51 and @object-ui/plugin-detail is already a dependency of @object-ui/app-shell; parentRelationshipFieldDef is already exported from @object-ui/core. The diff adds two imports and no export. The card's "seeds through the same relatedCreateSeedOf" is met by the one function, not a copy.
  • URL accept set (formLink): not widened. Right. The repeated formLink pair, parent first, is the shape RelatedRecordActionsBridge.openChildForm writes (lines 484 to 491) and AppContent already parses (lines 865 to 882, first pair per field wins). sp.set became sp.delete plus sp.append, which is the same URL for the single-pair case, so a lookup with no dependsOn writes what it wrote on main.
  • Seed rule: the helper's own, unchanged. Right. A lookup or master_detail, single-valued, each dependsOn entry resolved from the parent, text values only, the link field itself skipped, and nothing seeded when one entry does not resolve. The page adds no rule of its own to what is seeded.
  • New observable behaviour: one findOne(source.o, source.i) on the New click, and the form now opens after that read settles. Right in intent, with one gap, S1. The read is gated on a non-empty dependsOn array on the link's field def; null, a non-object and a rejected read all fall back to the parent pair alone, as the PR body and the changeset say.
  • What a metadata author can write: unchanged. Right. dependsOn keeps the meaning console: a related tab's New drops the parent it prefills when the child's relationship lookup declares dependsOn, and saves the child unlinked #37246 gave it on the related tab; this entry now honours it too. Metadata-protocol: none stands.

Findings:

  • S1 (should-fix) — the New click is now asynchronous with no in-flight state and no staleness guard (ObjectDataPage.tsx, the findOne branch of the New button's onClick). Three consequences. The button stays enabled and draws nothing while the read is pending, so on a slow link the click looks dead. A read that never settles never opens the form: the fallback covers a rejected or empty read, not a hung one. And open applies sp, a copy of the search params taken at click time, through the click-time setSearchParams: a filter change or a navigation made while the read is pending is overwritten or undone when it resolves, where on main the write was synchronous and could not be stale (the related tab's writer reads window.location.search live). Narrow window, nothing is written to data, so not a blocker. Fix shape: disable or mark the button while pending, and drop the result when the location or the mount has changed since the click.
  • S2 (should-fix) — the fallback the changeset publishes ("a parent that cannot be read opens with the parent link alone") has no pin. The two cases cover the seeded read and the no-dependsOn control; the .catch arm and the null arm are untested. One case with findOne rejecting closes it.
  • N1 (nit) — the read fetches the whole parent record where the dependsOn params are all it uses; QueryParams.$select exists (ui/packages/types/src/data.ts:72). The page also re-reads dependsOn itself to decide whether to fetch, a second copy of a gate the helper owns. A small export beside relatedCreateSeedOf that names the params would serve both the gate and the projection.

② Semver level

  • Changeset .changeset/37290-view-all-new-dependson-seed.md: @object-ui/app-shell patch and @object-ui/console patch. Matches. The diff moves ui/packages/app-shell alone (one source file, one test file); it is a bug fix in a released package, so patch. @object-ui/console ships the pre-built SPA built on app-shell (workspace:*), and naming it beside app-shell is the repo's standing practice for a console-visible fix. Check Changeset success.
  • Clause-②: no — right. No accept set is widened or narrowed: no spec key, no export, no new URL parameter or value shape, no accepted input that main refused. The line is line-initial in both the PR body and the changeset body, same spelling on both, and carries no arm, which is correct for a change that neither widens nor narrows.
  • Metadata-protocol: none — right, and none takes patch, which is the level shipped.
  • Not breaking: no banner, no migration and no ADR-0087 disposition owed.

③ Boundary flags

  • open_questions: empty. security_findings: none. out_of_scope_findings: none. Nothing to escalate.
  • Deviation, the client closure built locally so the app-shell test could resolve @objectstack/client: accepted. A local build; the diff carries three files and no built output.
  • Deviation, app-shell type-check and two derived families (check:type-check-debt, the ui scripts/ vitest run) not measured locally because a sibling held the verify lock: accepted. The check-runs on this head are the gate verdicts: Type Check UI success, Type Check · debt ledger success, Type Check · workspace success, Test UI success (aggregate, with shards 1 to 9), Lint · PM dispatch-gates success. The diff also touches no file under ui/scripts. The dev named the gap instead of reporting a green it did not measure, which is the right shape.
  • Deviation, origin/main merged once before opening: accepted. Head 7bcb29c2 is that merge over ad4ceb57; the merge changes none of the three PR files nor the two helpers they call, so the red and green legs quoted at ad4ceb57 describe this head's code, and Test UI on the head governs in any case.
  • File surface against the claim (7180634038): held. ObjectDataPage.tsx in the record-trail New path only, one pin file named for the card, one changeset; relatedParentScope.ts read, not changed.
  • Acceptance: both items met. The pin is two cases, with the red reading quoted in the PR body and the dev report.
  • SQL push-down: no finding. The change adds no id materialisation and no in-app join: one read of one row by primary key, with nothing fanned out from its result. The read is justified. The related tab seeds from the parent record its page already holds; this page holds the trail entry only (object, id, title), and the dependsOn values live on the parent row, so they must come from somewhere. Carrying them in the trail would put record data in every "View all" URL for a click most visits never make, and no server-side seed exists to push to. The read is lazy (on the click, not on mount), gated (only when the link declares a dependsOn, pinned by the control case), single, and it goes through the same permission-enforced findOne door as any record read, so a user who cannot read the parent gets the parent pair alone. The unprojected column list is N1, a nit.

Implemented-by: claude/issue-37290-view-all-new-seed
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 7bcb29c20a13387333bbef532a003b4a8974b093
REWORK — L1, seat repo:objectstack#5: the two should-fix findings of contract record 7182025259 are fixed in this PR before landing; the rest of L1 reads clean.

  1. Shape: open draft against main, 3 files (+199/−3), Fixes #37290, Clause-②: no, Metadata-protocol: none, patch changeset on @object-ui/app-shell and @object-ui/console. l1-face is CLEAN: 38 success, 13 expected skip, 0 failed.
  2. Premise: the record finds the seed reuses relatedCreateSeedOf from @object-ui/plugin-detail/core (already exported, not copied), the formLink URL shape is the one the related tab writes, and the single permission-enforced findOne of the parent is justified: lazy, on click, only when the lookup declares dependsOn. No SQL push-down finding.
  3. Owed in this PR:
    • S1. The New click is now asynchronous with no in-flight state and no staleness guard. Nothing shows while the parent read is pending, a read that never settles never opens the form, and the resolve writes search params copied at click time, so a filter change or navigation made meanwhile is overwritten. Give it a pending state (disable the button or ignore repeat clicks), bound the wait so the form opens with the parent link alone when the read does not settle, and drop the result if the page moved on.
    • S2. The changeset publishes "a parent that cannot be read opens with the parent link alone", but the rejected and null read arms have no pin. Add them, and pin the S1 timeout or staleness arm too.
      The same reviewer reads the delta.
  4. Accepted deviations: the type-check and two derived families not measured locally (sibling held the verify lock); the head's Type Check UI, Type Check · debt ledger, Type Check · workspace and Test UI runs are green, and nothing under ui/scripts changed. Nit N1 ($select the dependsOn params instead of the whole row; the page re-checks dependsOn the helper already gates) is fixed in the same push if cheap.
  5. Out of scope and where it went: none.
  6. Landing terms: ungoverned, default tier. A same-head PASS with S1 and S2 closed and an ACCEPT are owed. The area lands it.

… read and drops a stale result

The record-trail New reads the parent before opening the form when the
link declares dependsOn. While it reads, New is disabled and aria-busy;
the read is bounded (TRAIL_NEW_PARENT_READ_TIMEOUT_MS), past which the
form opens with the parent link alone; a read that settles after the
page unmounted or the address moved on opens nothing. Pins the refused,
empty, hung and stale arms.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 90c47a7a633aab768f585c42cef6dc0ec079a06b
Local-runs: none

Delta review of PR #37421 (card #37290), rework round 1, against record 7182025259 on head 7bcb29c2. Read: the delta 7bcb29c2..90c47a7a (three commits, the same three files, +107/−12, no merge of main), dev report 7183408462, seat verdict 7182035521, the PR body as it stands, the 51 check-runs on this head (38 success, 13 skipped, 0 failed), and the cited source on the head. Nothing built or run. Face unchanged: no schema, no governed path, a bare Clause-②: no, so the declaration face and TIER_DEFAULT.

① Derived judgments

  • S1: closed. Each of the four claims holds in the code (ObjectDataPage.tsx, the New button's onClick).
    • Pending state: disabled={createDisabled || newPending} and aria-busy while the read runs. Right.
    • Bound: the read is raced against TRAIL_NEW_PARENT_READ_TIMEOUT_MS (5000); past it open(undefined) writes the parent pair alone. A read that answers after the bound is ignored, since the race has settled, so the form cannot open twice. Right.
    • Stale drop: a per-mount click token, bumped by an unmount cleanup, and a compare of pathname plus search at click time against the live locationRef. Right.
    • Synchronous throw: findOne is now called inside a then, so a throw lands in the same .catch as a rejection. Right.
  • What I looked for in the rework and did not find:
    • The timer is cleared whenever the race settles. After an unmount it lives at most 5 s, then fires into the token check and sets nothing.
    • A read that never settles is held only by the data source; the page keeps no reference past the race.
    • newPending is restored on every path of a live mount: the stale-address path clears it before returning, and the only path that skips it is a superseded or unmounted click.
    • A hash-only change is not read as stale, since the compare is pathname plus search, so it cannot misfire there.
    • The three new hooks sit above the first early return (the objectDef guard), and Lint UI is green.
  • S2: closed. Four new cases: refused, empty, hung (fake timers, also asserts disabled and aria-busy), stale (asserts the moved address survives and no formLink is written). The dev reports ablations turning hung, stale and refused red, and says plainly that the empty case pins a promise and not a guard, which is correct: relatedCreateSeedOf answers {} for a missing parent. Test UI is green on this head.
  • N1: open, not taken, reason accepted. Narrowing the read to the dependsOn params needs the helper's parsing, which means a new export on the published @object-ui/plugin-detail/core: a widening outside this card's claimed surface. It stays a nit and blocks nothing.
  • New export TRAIL_NEW_PARENT_READ_TIMEOUT_MS: not a public-surface change. Right. It is exported from the ObjectDataPage module for the test to import. That module reaches the package only through AppContent's lazy import, and the package's one published entry does not re-export it.
  • N2 (nit) — the PR body's Tests section still says "two cases"; the file now holds six. Nothing else in the body is false: "A failed or empty read opens with the parent pair alone" and "no export change" both still hold, and the quoted red and green legs are labelled with the head they were read on. The body is silent on the pending state, the bound and the stale drop, which the changeset and comment 7183408462 state. The body should be patched when the relay allows it.
  • N3 (nit) — a dropped stale result opens nothing and shows nothing. That is the behaviour the changeset declares, so it is a noted trade-off, not a defect.

② Semver level

  • Changeset unchanged in level: @object-ui/app-shell patch, @object-ui/console patch. Still matches. The rework stays inside app-shell. Check Changeset success.
  • The changeset body now states the pending state, the 5-second bound and the stale drop, each matching the code.
  • Clause-②: no — still right. Nothing accepted is widened or narrowed, and the new constant is not on a published entry. Same spelling in the PR body and the changeset.
  • Metadata-protocol: none — still right.

③ Boundary flags

  • open_questions: empty. security_findings: none. Nothing to escalate.
  • Deviation, PR body not patched because the relay refused it: accepted for this round. One sentence in the body is now out of date (N2); no behaviour claim in it is false.
  • Deviation, worktree re-created and two closures rebuilt locally: accepted. The delta carries the same three files and no built output.
  • Deviation, app-shell type-check and two derived families not measured locally: accepted as before. Type Check UI, Type Check · debt ledger, Type Check · workspace and Test UI are success on this head, and no file under ui/scripts changed.
  • File surface against the claim: held. The same three files.
  • SQL push-down: no finding, unchanged. The rework adds no read. It is still one row by primary key, on the click, only when the link declares a dependsOn, through the permission-enforced findOne.

Implemented-by: claude/issue-37290-view-all-new-seed
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 90c47a7a633aab768f585c42cef6dc0ec079a06b
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Fixes #37290, Clause-②: no, Metadata-protocol: none, patch on @object-ui/app-shell and @object-ui/console. The rework since 7bcb29c2 has no main merge. The new TRAIL_NEW_PARENT_READ_TIMEOUT_MS is module-local, and the published entry does not re-export it.
  2. Rework closed (delta contract record 7183453645):
    • S1: New is disabled and aria-busy while the read runs. The read is raced against a 5000 ms bound and then opens with the parent link alone. A result is dropped on unmount or address change, and a synchronous throw counts as refused.
    • S2: four new pins (refused, empty, hung, stale), and the changeset states the pending state, the bound and the stale drop.
  3. Gates: check-runs at 90c47a7a63: 38 success, 13 expected skip, 0 failed.
  4. Accepted deviations:
    • N1 not taken: $select would need a new export on the published @object-ui/plugin-detail/core, which is outside the claim's surface.
    • N2: the PR body's Tests section still says "two cases" (there are six). The relay refused the body patch, so the rework notes stand in comment 7183408462, and no behaviour claim in the body is false.
    • N3: a dropped stale result shows nothing, as the changeset declares.
  5. Out of scope and where it went: none.
  6. Landing terms: ungoverned, default tier. L2: PASS, comment 7183453645, same head, no must-fix, no should-fix. The area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Probe Reading
check-governed-merges --pr 37421 NOT governed, ≤ 3000 lines
landing-k --pr 37421 CAN'T ANSWER: no Test Core shard ran on this UI-only diff. Measured by hand instead: K = 1 first-parent commits on main since this head's merge base, after the platform's base sync (pr_update_branch, 90c47a7a63 → 31cf7c211d)
pr-state --pr 37421 at 31cf7c211d 38 success · 13 expected skip · 0 failed · 0 pending, mergeable clean
Diff identity git diff merge-base..head matches the ACCEPTed head 90c47a7a63 byte for byte (ignoring index lines), so the base sync moved no line of this PR
os-regen paths in diff none

Landing on seat ACCEPT 7183461042. The maintainer named this PR on the seat thread's decision card (「合并这三个」 on 「合并 #37394、#37421、#37464 这三个已 ACCEPT 的非受管 PR 吗?」, 2026-11-26T07:11Z). Action: ready + auto-merge. Closes #37290 on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 07:43
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit cc38a91 Nov 26, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37290-view-all-new-seed branch November 26, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"View all" → New from a record trail on ObjectDataPage still writes only the parent pair, not the dependsOn seed

2 participants