Skip to content

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

Todo

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAmQQaqVXpJepCqm4Xa

Filing gate: ① · Source: fleet (found by the hotcrm lane while working objectstack-ai/hotcrm#2753, a p1 the product owner graded)
Grade: area:ux · Bug · p1 (blocks hotcrm#2753, p1; a blocking card takes the highest grade it blocks) · reach: measured on a booted HotCRM (server @objectstack 18.6.0, console 0.0.0-next-20261125013212) · evidence measured (hotcrm#2753 comment 7155046293; screenshots kept in the hotcrm project files).
Reader: the domain:ui seat; on landing, the hotcrm seat adds dependsOn: [crm_account] to two lookups on the next bump.
Dedupe: searched related tab New prefill dependsOn (4), dependsOn hides prefill (3), related list New parent prefill dropped (12), dependsOn seed initial values related (10), closed included. Nearest: #35050 (closed: related-list New did not run the parent's lookupAutofill; the lookup's own + New seeds dependsOn values since then). None covers the related tab's New with dependsOn.

维护者速读

  • 用户能看到什么变化:从记录页的相关页签「添加 → 新建」建子记录时,预填的父记录(如订单、商机)不再变成「请先选择客户」或被清空,保存后子记录正确挂在父记录下。
  • 为什么做:子对象的关系 lookup 一旦声明 dependsOn,页签里新建会丢掉预填的父记录并静默保存为未关联;这也挡住了 HotCRM 用 dependsOn 让「添加」只列同客户记录(hotcrm#2753, p1)。
  • 出错会怎样:今天的结果是数据静默挂错(子记录没有父记录、不报错);修复只影响新建表单的初始值。
  • 要你做什么:无。

What happens

A record page's related tab (#35725) → + Add → + New in the picker opens the create form with the parent reference prefilled. When the child's relationship lookup declares dependsOn:

  1. crm_billing_milestone.crm_sales_order with dependsOn: [crm_account] (and lookupAutofill filling crm_account from the order): the form shows Account = the order's account, but Order shows "Select…", and Create POSTs crm_sales_order: null. The milestone saves without its order and no error appears, because its contract satisfies the source rule.
  2. crm_contract.crm_opportunity (already declares dependsOn: [crm_account], no autofill): on opportunity → Contracts → Add → New, Related Opportunity shows "Select Account first"; the prefilled opportunity is hidden. This one reaches HotCRM today on the console newer than 18.6.0.

The derived Add picker itself honours dependsOn correctly (#36729): with dependsOn: [crm_account] the order's Add lists only that account's unlinked milestones (filter=[[crm_sales_order,is_empty],[crm_account,equals,<account>]]).

Expected

The tab's New seeds each dependsOn field of the relationship lookup from the parent record (child field = the parent's value, the inverse of what parentScopeOf already computes for the picker in #36729), the way the lookup's own + New seeds dependsOn values (#35050). The prefilled parent stays visible and is saved.

Done when

On an object pair like order → billing milestone with dependsOn: [crm_account] on the child's relationship lookup: tab → Add → New shows the parent prefilled and its dependsOn field(s) filled, Create saves the parent id; the same with no lookupAutofill (opportunity → contract). The Add list stays scoped as today.

Blocks: objectstack-ai/hotcrm#2753.

Activity

  1. added
    bug
    priority:p1
    pm:queue
    domain:ui
    on Nov 25, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T07:33Z. Confirmed as filed: area:ux · Bug · p1, by the blocker rule (it blocks a product-owner-graded hotcrm p1) · pm:queue → seat 4 (p1 outside area:cloud).

  3. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

    Claim: PM loop round 2 · area a4-U · 2026-11-25T07:37Z
    Session: session_01QSeKYmRepQK9DkZeU7F53D
    Account: os-justin
    Branch: claude/issue-37246-related-new-dependson-prefill
    Worktree: objectstack-issue-37246
    Domain: domain:ui
    Seat: repo:objectstack#4
    Area: a4-U
    File surface: the related tab's New seeding path. Candidates are ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx (the formLink it builds), ui/packages/app-shell/src/urlParams.ts and ui/packages/app-shell/src/console/AppContent.tsx (how formLink seeds the create form), and the shared parent-scope helper beside parentScopeOf in ui/packages/plugin-detail/src/RelatedList.tsx if the inverse belongs there. Pins as a top-level describe in the existing harness for the file fixed, and one patch changeset per moved package. The dev names the exact files after reproducing, before editing (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier at d7f299c: no path-derived mandate), effort: high (reason: p1 blocking hotcrm#2753; the New seeding must mirror the picker's parent scope (#36729) and the lookup's own + New dependsOn seeding (#35050) without breaking either)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the platform's own console code (@object-ui/app-shell related-record New / @object-ui/plugin-detail, objectstack) | the lookup's own + New already seeds dependsOn values (#35050), and the related tab's Add picker already scopes by them (#36729); the tab's New does neither | every app whose child relationship lookup declares dependsOn (HotCRM: order → billing milestone, opportunity → contract), measured on 18.6.0
    Thread-read: 7156012160
    Premise: holds as filed, measured by the hotcrm lane on a booted HotCRM (18.6.0). The dispatch's first act is to reproduce it on origin/main d7f299c in a test (tab → Add → New with a dependsOn relationship lookup); if it does not reproduce there, the dev stops with readings
    Serial constraints cleared: the related-tab New path is one lane in this zone, run serially: #37248 (RelatedRecordActionsBridge.tsx, + New on a readonly FK) and #37251 (RelatedList.tsx addEntry label) wait for this card. Open PRs #37244 and #37220 touch RelatedList.tsx (body table, count badge); the dev keeps clear of their hunks and runs overlap-check before every push
    Pre-claim lane: triage first touch routed it to seat 4 (7156012160); the seat gave it to zone a4-U; not an epic child
    Pre-claim deps: none; it blocks objectstack-ai/hotcrm#2753
    Prior rulings read: card terms (related tab New, dependsOn, prefill, formLink) → no ruling line; #35050 and #36729 are the precedents this card mirrors. Repo: objectstack-ai/objectstack

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uipm:dispatchedpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions