Skip to content

带内嵌子表的表单弹窗:取消 / 保存不固定在底部,长表单要滚到最下面才看得到 #34599

Closed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #34571(控制台核心业务操作体验专题,维护者直派,「都是p1」)。⛔ 不是认领。

现状(读码,objectstack origin/main ed45eb9;界面实测在 staging os-4e4qa4 与 hotcrm 本地实例)

  • 普通表单弹窗的底栏是固定的(ui/packages/plugin-form/src/ModalForm.tsx 约 :1295,shrink-0 border-t)。
  • 带内嵌子表时走另一条分支(ModalForm.tsx:1185–1246,subforms?.length && mode !== 'view'):<MasterDetailForm> 整个放在滚动区里(:1204 flex-1 overflow-y-auto),ModalForm 自己不画底栏;MasterDetailForm.tsx:2233–2262 把取消 / 保存画在内容最后(border-t pt-4,test id md-form-cancel / md-form-submit),于是随内容滚走。
  • 实测(hotcrm 本地实例,18.5.0):新建报价单、新建项目预算,弹窗顶部看不到任何按钮,要滚过全部字段和行项目表格才到。
  • MasterDetailForm 还被 ObjectForm.tsx:408(整页)和 DrawerForm.tsx:959(抽屉)使用。同一分支也没有未保存改动的拦截和冲突对话框(:1187 直接透传 onOpenChange)。

要做的

  1. 带内嵌子表的表单在弹窗、抽屉、整页三种容器里,取消 / 保存都固定在容器底部,与普通表单一致。建议给 MasterDetailForm 加一个把操作栏交给宿主渲染的口(它需要内部的 handleSave、saving、uploadGate,单纯的 DOM portal 不够),由 ModalForm 放进 shrink-0 border-t 的底栏。
  2. 这条分支补上未保存改动的关闭拦截,与普通表单一致。

不做的

  • 不改保存逻辑(/api/v1/batch)。

验收

  1. 新建一张带行项目的单据,弹窗滚动到任何位置,取消 / 保存都可见。
  2. 抽屉和整页同样。
  3. 填了内容后点关闭,有未保存提示。
  4. 现有点 md-form-submit 的 e2e(e2e/live/master-detail.spec.ts、form-view-subforms.spec.ts 等)通过。

设计图(静态示意稿,标「新」的是改动;字段和文案以实际元数据为准)

图 3 新建报价单

图 3 新建报价单

Reader: domain:ui 车道,改 ModalForm.tsx 的子表分支与 MasterDetailForm.tsx 的操作栏。

Dedupe: repo:objectstack-ai/objectstack MasterDetailForm action bar sticky footer ModalForm subforms → 0。

Activity

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → pm:queue · 2026-11-17T03:26Z

    ⛔ Not a claim.

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs

    Claim: PM loop round 1 · 2026-11-17T03:40Z
    Session: session_01WGufzgwLiKcfujYUug7sPs
    Account: os-support-ai
    Branch: claude/issue-34599-subform-sticky-footer
    Worktree: objectstack-issue-34599
    Domain: domain:ui
    Seat: repo:objectstack#3
    File surface: ui/packages/plugin-form/src/** (ModalForm.tsx subform branch, MasterDetailForm.tsx action bar, DrawerForm.tsx / ObjectForm.tsx hosts, + tests), ui/e2e/live/** only if a locator must move, ui/packages/i18n/src/locales/* (new keys only), root .changeset/
    Container & model: M, mode:subagent (area o3-B), model: TIER_DEFAULT (dispatch-gates --tier on the plugin-form files: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: ui/packages/plugin-form (objectstack): MasterDetailForm draws its Save bar at the end of the host's scroll area and ModalForm's subform branch passes onOpenChange straight through | no platform path pins the bar or guards the close today | every console user creating or editing a record whose object has inline sub-tables (HotCRM quote, project budget)
    Thread-read: 6937202657
    Premise: holds (area read-only premise read at origin/main 8dd8192: ModalForm.tsx:1186-1247 subform branch inside scroller :1205, no footer, :1188 onOpenChange passthrough; MasterDetailForm.tsx:2233-2265 bar with md-form-cancel/md-form-submit; MasterDetailForm exposes no dirty signal; hosts ObjectForm.tsx:408, DrawerForm.tsx:959)
    Serial constraints cleared: overlap-check probe on ModalForm/MasterDetailForm/DrawerForm/ObjectForm vs origin/main f4a2d14d: clean, 0 open PR heads share these files; area queue after this card: #34604 then #34607 (same ModalForm hunks), #34605 (card thread, lease o3-B) builds after
    Pre-claim lane: domain:ui — every path is under ui/packages/plugin-form/src/** (area o3-B roots)
    Pre-claim deps: none — no Blocked-by: or "after #N" on the card; overlap-check clean
    Prior rulings read: masterdetailform,modalform,sticky,footer,ondirtychange → 2 hits; ADR-0035 Decision §6 ("ModalForm/DrawerForm host the master-detail form inside their envelope and suppress their own footer (the form owns its Save)"), ADR-0050 Decision §4 (not engaged); thread: none. Route keeps ADR-0035 §6 true: the Save bar stays owned and rendered by MasterDetailForm and is pinned to the bottom of the host's scroll frame; hosts draw no second footer. The card's host-rendered bar is its own "建议", not a ruling.

    Lease o3-B (seat post #34584); child of epic #34571. Clause-② note: no holds while the exported surface of @object-ui/plugin-form (MasterDetailFormProps, MasterDetailFormSchema, index exports) does not grow; the dirty signal goes through a package-internal channel. If the diff must grow an exported prop or type, the dev stops and reports and the area escalates to the seat.

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs
    os-dev-report

    {
      "issue": 34599,
      "status": "blocked",
      "branch": "claude/issue-34599-subform-sticky-footer",
      "pr": null,
      "head": "205f1d23",
      "session": "session_01WGufzgwLiKcfujYUug7sPs",
      "premise_still_valid": true,
      "summary": "Implemented and pushed (head 205f1d23, main 518bacad merged in): MasterDetailForm's action bar is sticky bottom-0 with an opaque after-strip over the host scroller's bottom padding, so Save/Cancel stay in view in the ModalForm body, the DrawerForm sheet and the ObjectForm/RecordFormPage page host; a package-internal FormDirtyReportContext (formDirtyReport.ts, not exported) carries header OR lines (linesUnsaved, the edit save's row diff) OR row-editor unsaved input from MasterDetailForm to the ModalForm/DrawerForm close guard, and the ModalForm subform arm now routes X/Escape/backdrop through attemptClose and the discard AlertDialog (beforeunload follows). Exported surface byte-identical (index.tsx diff empty, no export/interface line moved), so Clause-② no holds. BLOCKED before pr_create: overlap-check on the merged head exits 1 against open draft PR 34642 (claude/project-thread-a9r6j4, card 34605 section navigation, same seat lease o3-B): textual conflict in ui/packages/plugin-form/src/ModalForm.tsx. Needs the area to choose the landing order (claim said 34605 builds after 34599). No conflict dialog added: the subform save goes through the header form's submitHandler batch and never reaches useOccSave.",
      "tests": "head c367f82d and again on merged head 205f1d23: pnpm --filter @object-ui/plugin-form exec vitest run --root ../.. --maxWorkers=2 packages/plugin-form/ under the lock -> Test Files 233 passed (233), Tests 2604 passed | 1 skipped (2605), VERDICT command-exit 0. New pins: subformHosts.test.tsx describe 'master-detail Save bar is pinned to the host scroll frame' (3: modal/drawer/page), discardGuard.test.tsx describe 'master-detail overlay unsaved-changes guard' (8). Ablations via scripts/ablation-replace.mjs, each mutation proven on disk and restored to the HEAD blob (tests import source, no dist leg): drop 'sticky bottom-0' -> 3 failed; ObjectForm without the report -> 4 failed; drop linesDirty -> 1 failed; drop setHeaderDirty(false) in handleSaved -> first run green (create remounts header; redundant there), edit-save pin added, re-run 1 failed; subform Dialog back to schema.onOpenChange -> 2 failed. Chromium CSS probe: sticky stops at the scroller content edge (276 of 300 with 24px padding); 24px after-strip covers the strip, scrollHeight unchanged.",
      "gates": "local: dispatch-gates --commands (38) + pnpm check:changeset-fixed, all exit 0 at c367f82d; --ran reconciliation with exit codes: 38 derived, 38 run, 0 NOT-MEASURED (derived zero), 0 UNRUN, 1 outside derivation. pnpm --filter @object-ui/plugin-form run type-check exit 0 (c367f82d and 205f1d23). Re-run on 205f1d23: check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check:changeset-fixed, check:nul-bytes, check:type-check-coverage all exit 0. ui check:new-line-citations: 0 new, exit 0. eslint on 8 changed files: 0 errors (warnings only, pre-existing no-explicit-any). overlap-check 205f1d23: VERDICT overlap exit 1 (PR 34642, ModalForm.tsx). CI: NOT MEASURED, no PR opened.",
      "dogfood_battery": "n/a — no PR title yet; planned title has no '!' and the claim carries no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 — this os-dev-report comment via post-stamped (git push x3 is not a REST write; pr_create not sent)",
      "open_questions": [
        { "question": "Overlap with draft PR 34642 (card 34605) in ModalForm.tsx: which lands first?", "options": ["A open this PR now as draft and let whichever lands second merge main and resolve ModalForm.tsx", "B hold this branch until 34642 lands, then merge main, resolve, re-run and open", "C 34642 waits for this one, per the claim's order 34599 -> 34605"], "recommendation": "C, because the claim's serial order already puts 34599 first and this branch is complete and green; 34642 then merges main once." },
        { "question": "Dispatch asks for an HTML-comment signed last line in the PR body; os-dev forbids dev-written HTML comments. Which wins?", "options": ["A keep the signed line last (seat standing rule)", "B drop it and sign in prose"], "recommendation": "A, placed last so the sanitizer can eat nothing after it; reported here rather than chosen silently." }
      ],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: none · DrawerForm's flat-arm footer sits inside the overflow-y-auto SheetContent, so the plain drawer's Save also scrolls away on a long form; observed by reading only, not reproduced, noted not filed", "carrier: none · RecordFormPage has no unsaved-changes guard for flat or master-detail forms; noted not filed (read-only observation)"],
      "deviations": ["git push of the merged head 205f1d23 ran in the same shell line as overlap-check and went out despite its exit 1; it pushes only this branch (main merged in, no force). No pr_create followed.", "New pins went into existing harness files subformHosts.test.tsx and discardGuard.test.tsx as top-level describes (AGENTS.md, ruling record 6583487846) instead of new card-named files the dispatch suggested.", "ui/AGENTS.md #2 docs-driven (package README, content/docs/frontend) not updated: outside the dispatched file surface."],
      "files_changed": [".changeset/34599-subform-sticky-save-bar.md", "ui/packages/plugin-form/src/formDirtyReport.ts", "ui/packages/plugin-form/src/MasterDetailForm.tsx", "ui/packages/plugin-form/src/ModalForm.tsx", "ui/packages/plugin-form/src/DrawerForm.tsx", "ui/packages/plugin-form/src/ObjectForm.tsx", "ui/packages/plugin-form/src/TabbedForm.tsx", "ui/packages/plugin-form/src/subformHosts.test.tsx", "ui/packages/plugin-form/src/discardGuard.test.tsx"]
    }
  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs

    Delivered · 2026-11-17T05:53Z

    • PR fix(plugin-form): pin the master-detail Save bar and guard the subform close #34657 merged (merge commit 119c82c84d9a55b7afdd6b3ece4e9890101a8f59); card closed by Fixes. L1 ACCEPT 6939477698, landing 6939498748.
    • Delivered: master-detail Save bar pinned to the host scroll frame in modal, drawer and page hosts (ADR-0035 §6 kept: the form owns its Save); subform modal/drawer close goes through the unsaved-changes discard guard; plugin-form exported surface unchanged.
    • Left to others: plain DrawerForm footer scrolling away and RecordFormPage's missing unsaved-changes guard were passed by the seat to the epic's filer; not part of this card.
    • State: pm:dispatched removed (card closed).
  8. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:uipriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions