Skip to content

「补填必填字段」弹窗按改动前的记录算选项可见性:商机改为「失败」时丢单原因显示「暂无可选项」,无法保存 #37250

Description

@huangyiirene

环境

云端,平台 18.6.0,hotcrm 6.6.0(2026-11-25,Irene 操作;Claude 读取了元数据核对原因)。

现象

商机详情页「销售流程」区块,直接把「阶段」从「谈判」改为「失败」。#35956 的「补填必填字段」弹窗弹出,要求补填「丢单原因 *」,但下拉显示「暂无可选项」,无法填写,改动也就保存不了。

原因

crm_opportunity.loss_reason 的每个选项都带 visibleWhen(hotcrm#2592 的修复):

(has(record.stage) && record.stage == "closed_lost") || (has(record.requested_status) && record.requested_status == "closed_lost")

补填弹窗计算选项可见性时,用的是改动前的记录(stage 仍为「谈判」),没有把这次待保存的改动(stage → closed_lost)合进去,于是所有选项都被判为不可见。选「成交」补填「赢单原因」时 win_reason 同理,很可能同样为空。

期望

补填弹窗评估 visibleWhen / requiredWhen 等条件时,使用「原记录 + 本次改动」合并后的值;本例应列出全部丢单原因选项。

相关

优先级:priority:p1(产品负责人 Irene 要求)。

Activity

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

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    First touch 2026-11-25T07:33Z.

  3. added
    pm:queue
    on Nov 25, 2026
  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Claim: PM loop round 3 · 2026-11-25T07:36Z
    Session: session_01QSeKYpEsWWE9Y5YtSsDgqZ
    Account: os-justin
    Branch: claude/issue-37250-fill-in-dialog-pending-values
    Worktree: objectstack-issue-37250
    Domain: domain:ui
    Seat: repo:objectstack#4
    File surface: ui/packages/fields/src/RequiredFieldsDialog.tsx, ui/packages/fields/src/requiredWhenPrompt.ts and the option-visibility evaluation they call, with their tests and .changeset/37250-*.md. Stop on any breach and explain it in the report.
    Container & model: S/M, mode:subagent. The seat runs this p1 itself because zone a4-U is holding the three related-tab p1 cards. model: default tier — no path-derived mandate, effort: high
    Clause-②: yes (widening) (corrected at L1 7158746595: RequiredWhenPromptField.record? is added to a published export)
    Metadata-protocol: none
    Responsibility: objectstack platform code — the required-fields fill-in dialog (#35956) evaluates option visibleWhen against the record before the pending change | none | any app whose option visibleWhen depends on the field being changed; reproduced on cloud 18.6.0 with hotcrm 6.6.0 (opportunity → 失败 → 丢单原因 has no options, and the change cannot save)
    Thread-read: 7155996237
    Premise: holds (card reproduction on 18.6.0; the dev re-measures on main first)
    Serial constraints cleared: none known — the dev runs scripts/pm/overlap-check.mjs before the first push

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 25, 2026
  6. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Progress · held on one maintainer answer · 2026-11-25T08:46Z

    • Fix: done, tested and committed on the local branch claude/issue-37250-fill-in-dialog-pending-values at 57e988ac224. It is 4 files, +129/−1, with a patch changeset.
    • Premise: holds, and the cause is broader than the card says. The fill-in dialog handed its controls no record at all, so option visibleWhen was judged against {}. The fix carries the collector's merged record ({...record, ...changes}) on each prompted field. The dialog's controls then read that record plus the values typed in the dialog.
    • Tests: 4 new cases. They are red on main and green at head. Ablation of either half turns them red. The @object-ui/fields suite passes (5020 tests), and 38 of 38 derived gates pass.
    • Blocked: the dev's first remote write, an empty-branch git push, was refused by its session's permission check. It did not retry or route around the refusal, so no PR exists yet. The seat has put the push to the maintainer. The seat does not push in the dev's place without that answer.
    • For the L1: the change adds one optional member, record, to the published RequiredWhenPromptField interface of @object-ui/fields.
    • Out of scope, noted: host refusalField rows carry no record (recordPathStageChange, InlineEditSaveBar, objectGridRequiredPrompt). In a confirmation dialog with zero collected fields, such a row reads only the typed values. This was not reproduced through a public entry point.
  7. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Delivered · 2026-11-25T11:44Z · PR #37264 merged.

    The fill-in dialog now hands its controls the record the write would leave. The things that read that record now resolve against it: option visibility, dependsOn gates, dependent-lookup filters, and a money field's followed currency.

    Follow-up #37270 covers the hosts' refusal-named rows.

  8. removed
    pm:dispatched
    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:uipriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions