Skip to content

Parent create/edit form: new detail-table rows should prefill the child's defaults and not flag required cells before save (as the record page now does) #35940

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Found by the L1 review of PR #35937 (#35745 + #35816). Part of epic #35590 (record page redo).

What a user sees

#35816 fixed the record page's edit state: a new row in a master-detail table is prefilled with the child object's default values, and a required cell is not flagged red until the user tries to save. The parent object's own create / edit FORM (MasterDetailForm → LineItemsField) does not get the same: its new rows are still blank, and a required cell with a default (for example a status that defaults to 「待处理」) is flagged red at once, although saving would succeed with the default.

To do

Pass the same new-row start values and the "not flagged before the host reports it" behaviour that #35937 adds to LineItemsField from the form host as well, so both places behave alike. While there, the review noted two related points: the default-value read does not pass the context ObjectForm uses (currentUserId, homeCurrency, homeTimeZone), and a new row holding only defaults is skipped silently on save. Decide both together.

Acceptance

  • On the parent's new / edit form, adding a detail row shows the child's defaults and no red frame; saving without touching a required cell that has no default flags that cell with a message and does not submit.

Reader: domain:ui. Blocked by #35937 merging.

Activity

  1. added
    bug
    pm:retriage
    domain:ui
    on Nov 20, 2026
  2. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue (from pm:retriage); rationale: area:ux · Bug · the parent create/edit form (MasterDetailForm → LineItemsField) still starts new detail rows blank and flags a required cell with a default before save, while the record page no longer does (#35816); topic #35590 → p2 (UX rule) · size S.

  3. added
    pm:queue
    priority:p2
    and removed
    pm:retriage
    on Nov 20, 2026
  4. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Riders from PR #35937's reviews (landing 7051901818). They are added to this card's scope:

    1. RecordBodyTableEditor casts childSchema before it calls schemaDefaultValues. The cast hides whether the schema can still be undefined before it loads. From L2 7050830297, N1.
    2. schemaDefaultValues options, and a line that holds only its defaults being skipped without a word. From L1-c 7050813930.
    3. Once another line's save is refused, a line that was added but never edited turns red too, even though the save skips it. From L2 7051882763, N2.
    4. CI never runs ui/e2e/live/record-page-polish-35745.spec.ts, because test:e2e:live:ci runs a fixed list. Also, the spec's "not stored" check reads 500 rows and filters them in the test. Add the spec to the CI list, and give that check a $filter on expense_report. From L2 7051882763, N3.
  5. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Claim: PM loop · 2026-11-20T23:18Z
    Area: b1-DB
    Session: session_01L6bhgWYi6WWWnJAmc7Jtpu (the card thread)
    Account: os-sales
    Branch: claude/project-thread-c6vkj1
    Seat: repo:objectstack#1
    Domain: domain:ui
    File surface:

  6. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Maintainer ruling · 2026-11-21T03:09Z · On the seat's decision card 「明细表里新增后没动过的行,保存时怎么处理?」 (what happens on save to a detail-table row that was added and never touched), the maintainer chose 「跳过并提示未保存」 (option A of three) at 2026-11-21T03:08:41Z. The other two options were 「当作真实行保存」 (save it as a real row) and 「继续静默跳过」 (keep skipping it silently).

    Recorded meaning:

    • An added row the user never edited (it holds only its defaults) is not saved. The save itself succeeds as usual.
    • After the save, a notice tells the user how many blank detail rows were not saved (「N 行空白明细未保存」).
    • Such a row is never marked red, before or after a save attempt, even when a required cell has no default.
    • The master-detail form and the record page behave the same way.

    The card thread builds this into the same PR, which carries Fixes #35940.

  7. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgWYi6WWWnJAmc7Jtpu
    os-dev-report

    {
      "issue": 35940,
      "status": "done",
      "branch": "claude/project-thread-c6vkj1",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35984",
      "session": "session_01L6bhgWYi6WWWnJAmc7Jtpu",
      "premise_still_valid": true,
      "summary": "On a parent object's create/edit form a new detail line now starts on the child's static defaults (schemaDefaultValues with the ObjectForm seed context: acting user, home currency, home time zone) and its empty required cells read red only once a save was tried. RecordBodyTableEditor drops its childSchema cast and seeds with the same context. Per ruling 7056413638 an added line nobody edited is skipped at save, is never red, and the save shows form.lineItems.untouchedNotSaved on the form and on the record page's edit state (11 locales). The live record-page spec joins test:e2e:live:ci and its not-stored check uses $filter.",
      "tests": "head e642739c, under the verify lock: vitest run packages/fields packages/i18n packages/plugin-form -> Test Files 655 passed | 1 skipped, Tests 9356 passed | 21 skipped; vitest run packages/app-shell/src/views -> Test Files 1575 passed, Tests 14926 passed | 1 skipped (declared narrowing: the rest of app-shell left to CI). Type-check fields, i18n, plugin-form, app-shell exit 0. Nine ablations via scripts/ablation-replace.mjs on the committed head, each red (table in the PR body); a form-mode Add seed ablated stayed green and was removed (96501c25). Live stack (workspace showcase backend + built console preview): record-page-polish-35745.spec.ts 1 passed; create form and record page each: Add -> defaults, 0 flagged cells; save -> notice, 0 lines stored.",
      "gates": "dispatch-gates --ran: 56 derived, 56 run, 0 NOT-MEASURED, 0 UNRUN, every recorded exit 0 (check:type-check-debt first exit 3 queue-timeout, re-run under the lock: exit 0). CI on e642739c: 46 success, 13 skipped, 0 failed.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0 MCP GitHub calls (reads via gh api)",
      "api_writes": "3 — relay pr_create (POST pulls + POST issues/35984/assignees), relay issue_patch (PATCH issues/35984 body), this comment (POST issues/35940/comments)",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["L1-c nit: the branch base predates #35938, so the record-page screenshots still show the stage strip; CI tests the merged code · carrier: PR #35984 · noted, not filed"]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxbugdomain:uipm:queuepriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions