Repository navigation
Labels
area:uxdomain:uiDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3
Description
coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff
立卡门类别:④ 协调节点的子单,承父单 #35590(专题:记录详情页重做,维护者直派)。⛔ 不是认领。优先级 p2(维护者 2026-11-19:「这一批卡p2」)。
维护者 2026-11-19 原话:「编辑的时候也要能一起编辑和保存」「这个你要具体调研合理性和代码能实现的可行性」。
图是深色稿,只表达结构和尺寸,颜色沿用现有主题变量。参照对象 Twenty 是 AGPL,只参照结构,⛔ 不抄代码。代码读数取自 origin/main 7ece0204a6。外壳(顶栏、左侧栏)不动。
现状
- 带子表的表单已经支持:
ui/packages/plugin-form/src/MasterDetailForm.tsx,子对象外键声明inlineEdit时自动启用(ui/packages/app-shell/src/providers/MetadataProvider.tsx:714-756)。新建和编辑都能增、改、删子表的行(:1928-1985)。 - 保存走一次
POST /api/v1/batch,服务端是同一个事务,全成或全不成(packages/rest/src/batch-routes.ts:218-520)。批次里每个对象都要开bulk(:373-376);没开就保存失败(照技能声明inlineEdit得到一张存不了的表单:父对象的apiMethods没有bulk时,带行保存被 405 拒绝,技能没写这个前提,编写期也没有任何提示 #34566、项目预算带行项目新建时保存失败:API operation 'bulk' is not allowed on object 'crm_project_budget'(内嵌子表走 /api/v1/batch,对象的 apiMethods 没有 bulk) hotcrm#2565 记过)。 - 记录页有两条编辑路径:逐字段就地改(
InlineEditProvider,只覆盖关键字段和明细,InlineEditSaveBar只对主记录发一次更新,RecordDetailView.tsx:5665);「编辑」按钮打开表单弹窗或表单页(ui/packages/app-shell/src/console/AppContent.tsx:1120-1165)。记录页上不能和主记录一起改子表的行。 - 审批锁定:客户端
resolveApprovalLock(RecordDetailView.tsx:2307-2312)禁用编辑;服务端是主记录上的beforeUpdate钩子抛RECORD_LOCKED(packages/plugins/plugin-approvals/src/lifecycle-hooks.ts:615, 224)。没有找到锁子表行的逻辑:商机在审批中,产品明细仍可改。
要做的
- 点「编辑」后,记录页概览进入编辑状态:字段变成输入控件,概览里的主从子表变成可编辑的行(可加行、删行、改行)。头部右边换成「取消」「保存」。
- 一次保存:主记录的改动和所有主从子表的增、改、删打成一个批次提交,复用
MasterDetailForm的批次构造,走POST /api/v1/batch,同一个事务。失败时什么都不落,逐条显示错误并定位到对应字段或行。 - 多张主从子表都在同一次保存里。
- 「取消」放弃全部改动;有未保存改动时离开页面要确认。
- 父对象或子对象没开
bulk时,不出现「能编辑但存不了」:要么平台在声明了主从正文表格时自动放行这条批量路径,要么进入编辑状态前就提示并只允许改主记录。由实现方选一种并写进 PR。 - 抽屉里同样适用。
裁决
- A. 审批锁定也锁主从子表的行——已裁决:锁。 维护者 2026-11-19 原话:「一起锁」(问的是「审批中的记录,它的主从子表的行也一起锁住吗?」)。主记录因审批锁定时,它的主从子表不能增、改、删,客户端禁用,服务端在子对象的写入钩子里检查父记录的锁。理由:审批人批的是「这条记录连同它的明细」,批的过程中明细能改,等于批的内容会变。这一项要动服务端。
- B. 逐字段就地改是否保留——待维护者裁决,裁决前先按建议做。 协调席建议:保留给没有主从子表的对象和简单字段;有主从子表的对象统一走「编辑 → 保存」,避免同一页上两种保存方式并存。
不做的
- 不改新建表单;不改表单弹窗本身。
- 普通关联子表的行不在这次一起编辑的范围内。
验收
- HotCRM 报价单:点「编辑」,改一个主记录字段、改一行数量、加一行、删一行,点「保存」:只发一次批量请求;刷新后四处改动都在,合计正确。
- 同样的操作里把某一行改成不合法的值:保存失败,主记录和其他行都没变,错误定位到那一行。
- 点「取消」后页面回到编辑前的样子。
- 审批中的商机,直接调接口改它的产品明细被拒绝,返回
RECORD_LOCKED。 - 验收条款
records-forms.master-detail-atomic-save同笔更新,覆盖记录页这条路径。 - 一次合入、一次验收。PR 正文列出迁移和作废的测试,以及同笔修改的
docs/qa/platform-checklist条款。
Reader: domain:ui 车道;另需 plugin-approvals 的服务端改动(裁决 A:锁)。ui/packages/app-shell/src/views/RecordDetailView.tsx、InlineEditSaveBar.tsx、ui/packages/plugin-form/src/MasterDetailForm.tsx、packages/rest/src/batch-routes.ts、packages/plugins/plugin-approvals/src/lifecycle-hooks.ts。依赖子卡「主从子表」。
Dedupe: 记录页 编辑 子表 一起保存、record page edit master detail batch save(objectstack,open)→ 0;相关:#34566(已关闭)。
正文最后更新:2026-11-19T21:51Z
Metadata
Metadata
Assignees
Labels
area:uxdomain:uiDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3
Activity
objectstack-fleet commentedon Nov 19, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:ui·pm:queue; rationale: area:ux · Feature (header fields and master-detail rows edit together and save in one transaction) · a child of the maintainer's record-page topic #35590 (his words for this batch: 「这一批卡p2」) → p2 as he set it.objectstack-fleet commentedon Nov 19, 2026
coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff
裁决 A 已定,正文已同步。
维护者 2026-11-19 原话:「一起锁」。问的是:「审批中的记录,它的主从子表的行也一起锁住吗?」
落到本卡:
RECORD_LOCKED。packages/plugins/plugin-approvals,不只是界面。裁决 B(逐字段就地改是否保留)仍待定,先按正文里的建议做。
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
Claim: PM loop round 20 · area ux-2, second dev (maintainer direct dispatch: epic #35590; seat split names #35599 third in the ux-2 lane; its dependency #35597 merged as
9b6db730b2; seat 5 cleared a parallel start beside #35601 on a clean file overlap) · 2026-11-20T03:29ZArea: ux-2
Session:
session_01Utp6CZrgaiMgTJCnswR6jQAccount:
os-billBranch:
claude/issue-35599-record-edit-saveWorktree:
objectstack-issue-35599Domain:
domain:ui(+plugin-approvalsserver guard, ruling A)Seat:
repo:objectstack#5File surface:
ui/packages/app-shell/src/views/RecordDetailView.tsx(ux-2's regions only: the approval-lock read ~2307-2352, thecanEditconjunction ~5536-5543, the save-bar mount ~5831, and the overview edit-state swap for body tables; the header's Cancel/Save swap through the existing action-bar props, no header layout change),ui/packages/plugin-detail/src/InlineEditSaveBar.tsx(and the inline-edit provider it pairs with),ui/packages/plugin-form/src/MasterDetailForm.tsx(reuse its batch construction; export a helper if needed),packages/plugins/plugin-approvals/src/lifecycle-hooks.ts(child insert/update/delete guards), their tests,docs/qa/platform-checklistitemrecords-forms.master-detail-atomic-save, root.changeset/. ⛔ Notui/packages/plugin-detail/src/RelatedList.tsx,RelatedRecordActionsBridge.tsx,useOpenRecordList.ts,record-related-list.tsx,RecordPickerDialog.tsx,RecordPagePreferencesContext.tsx(#35601 in flight on those); notpackages/rest/src/batch-routes.tswithout reporting first; notRecordDetailView.tsx's tab region (~5610, another area's #35595),containers.tsx,RecordPageColumns.tsx,recordPageColumns.ts,record-reference-rail.tsx,DetailView.tsx,buildDefaultPageSchema.ts; nopackages/spec/**, nodocs/adr/**without reporting first. Stop on breach and report.Container & model:
L,mode:subagent,model: default — no path-derived mandate,effort: xhigh(server write guard, approval semantics)Clause-②: no (measure; a REST or spec contract change makes it yes — report first)
Metadata-protocol: none (measure)
Responsibility: ui
app-shell/plugin-formrecord-page edit and save, and serverplugin-approvalslock enforcement in objectstack; every record page with master-detail body tables, and every write to a locked record's detail rowsThread-read: none
Premise: holds as filed (card readings at
7ece0204a6; the save bar now mounts at ~5831 and thecanEditconjunction sits at ~5536-5543 on current main; re-read first)Serial constraints cleared: no open PR touches the listed files (live read of all open PRs' files at claim time); #35601's branch touches
RelatedList.tsx,RecordPickerDialog.tsx,RecordPagePreferencesContext.tsxand react context, none of this surface; #35593 (header) mergedPre-claim lane:
domain:ui+plugin-approvalsPre-claim deps: none open (#35597 closed)
Prior rulings read (
check-prior-rulings --card 35599 --paths RecordDetailView.tsx,MasterDetailForm.tsx,lifecycle-hooks.ts,batch-routes.ts): ruling A on the card (Bill 2026-11-19 「一起锁」) binds: a locked parent's detail rows refuse insert/update/delete withRECORD_LOCKED; ruling B is open on a decision card, built on the recommended option (inline edit off on objects with master-detail body tables) as ONE isolatedcanEditterm; ADR-0098 §7 (hook-bypassing write paths) binds the guard's coverage — the batch and bulk paths must not bypass it; ADR-0058 D4 (RLS write check) and ADR-0148 D6 read;lifecycle-hooks.ts~:750 ruling (2026-08-31) and its exemptions (system writes, the opening flow run ~658-664) carried;RecordDetailView.tsx~:3303 ruling untouched; whether ADR-0019 needs a note is unverified (anydocs/adredit makes the PR Tier H)objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ
Ruling B recorded: keep per-field inline edit on every object (maintainer, 2026-11-20T04:24Z).
Asked: 「记录页是否保留逐字段就地编辑?」 Answer: 「全部保留」.
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
os-dev-report
{ "issue": 35599, "status": "done", "branch": "claude/issue-35599-record-edit-save", "pr": "https://github.com/objectstack-ai/objectstack/pull/35755", "head": "9cb0d100", "session": "session_01Utp6CZrgaiMgTJCnswR6jQ", "premise_still_valid": true, "summary": "Resumed after a container restart and finished Ruling B 「全部保留」. Inline edit now stays on every object, those with body tables included; the provisional canEdit term is gone, and inline edit saves the master alone through the save bar. Edit, then Save, sends the master and its rows in one atomic batch. Only one mode runs at a time: (a) the edit state takes the record's single inline session, so it draws no pencil and no save bar; (b) pressing Edit with unsaved inline changes opens an AlertDialog, never window.confirm. Gate reds that came from the earlier commits are fixed: the erasure ratchet and the system-context census (server half), the editor's registration sitting outside the sideEffects chain plus a stale KNOWN_SCHEMA_TYPES, and zh-Hant needing a regeneration. origin/main was merged in cleanly. Ruling A is unchanged.", "rulings": { "A": "settled (lock), committed a0e58e3b; unchanged", "B": "「全部保留」: both modes on every object, one at a time; the provisional term inlineEditOffForBodyTables was removed and its test retired" }, "tests": "Run under os-verify-lock with --maxWorkers=1 --pool=forks. (1) On head 9cb0d100: RecordDetailView.harness.test.tsx (all 70), recordEditState.helpers-35599.test.ts, RecordBodyTableEditor.recordEditBatch-35599.test.ts, scripts/__tests__/check-side-effects-array.test.ts and scripts/__tests__/known-schema-types-derivation-5115.test.ts gave 'Test Files 5 passed (5) · Tests 141 passed (141)'. (2) On the merged tree d0bdc9da: the three edit-state files plus packages/i18n/ gave 'Test Files 108 passed (108) · Tests 2039 passed | 13 skipped (2052)'. plugin-approvals detail-row-lock.integration.test.ts gave 'Tests 10 passed (10)'; no approvals or i18n file changed after d0bdc9da. (3) Type checks: app-shell and @object-ui/cli type-check exit 0 on 9cb0d100; plugin-form, i18n and app-shell type-check, and plugin-approvals typecheck, exit 0 on d0bdc9da. (4) Ruling B pins in block recordEditState-35599: save-bar-alone (one update of {summary}, no batch) and, in the edit state, zero pencils and no save bar; discard confirm (Keep editing keeps the draft, Discard enters over the stored values, window.confirm stub not called); CONTROL (no unsaved changes, so no dialog). (5) Ablation through scripts/ablation-replace.mjs (source-resolved, no dist leg): requestEnter's setConfirmDiscard(true) changed to enterNow() moved the anchor 1 to 0, and the one-mode cell went red ('Tests 1 failed | 6 passed'); restored with blob == HEAD b0b0e192465c and an empty git diff HEAD. The earlier run's server-guard ablation (7 failed | 3 passed, restored to blob def2d354757a) and its client-gate mutation are cited in the PR.", "gates": "dispatch-gates --commands derived 121 families on the final tree, and all 121 ran locally. 108 ran on d0bdc9da; the 13 the package.json edit added ran on 9cb0d100, all exit 0. --ran reconciliation: '121 derived famil(ies) accounted for — 121 run, 0 NOT-MEASURED'. Non-zero exits: 'pnpm --dir ui exec vitest run scripts/' exit 1 on d0bdc9da, all four failures from this diff (sideEffects chain, KNOWN_SCHEMA_TYPES); fixed in 9cb0d100, and the two files re-ran green. check:query-options-erasure and check:system-context-census were red on the earlier run's tree and are fixed, exit 0. NOT MEASURED because a prerequisite is missing in this box: check:dts-closure exit 1 (unbuilt packages' dist), check:dual-build-cjs-loads exit 3, spec check:skill-examples exit 3 (client-react not built), check-plugin-teardown-shape --self-test exit 3 (shallow checkout). check-sdui-manifest exit 0 on 9cb0d100. check-platform-checklist --changed-from origin/main OK (0 anchors lost). check:nul-bytes exit 0. CI check-runs had not concluded when this was written: in_progress.", "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm", "browser_reading_A5": "NOT MEASURED: the container restart killed the dogfood build, and the resume was limited to affected test files; the PR states this", "item5_choice": "option 2, UI-only (bodyTablesSaveTogether: a missing bulk keeps the tables read-only with a notice; the record saves through a plain update). No batch-routes.ts or contract change.", "client_gate": "done through the existing RelatedRecordActionsBridge serve prop (withDetailWritesWithheld); RelatedList.tsx and the bridge are not edited", "line_budget": "29 files, +2027 / -16 against origin/main merge-base (under 2500)", "files_changed": "see PR #35755 file list (29)", "mcp_calls": "0", "api_writes": "3 REST requests in 2 relay strokes — pr_create (POST /repos/objectstack-ai/objectstack/pulls + its assignee leg POST /repos/objectstack-ai/objectstack/issues/35755/assignees, run 44681446436); os-dev-report comment via post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/35599/comments). git push is not a REST write.", "deviations": [ "Mechanism assumption (a) is wrong. Adding !recordEditState as a canEdit term would break the edit state: the controller enters the record-level inline session, and the provider's enter() refuses when canEdit is false. The old term carried !recordEditState as an exemption inside the edit state, not as a gate against it. (a) holds structurally: the edit state is that single session (every field an input, no pencils) and the save bar is unmounted while it is on. So no term was added; the PR explains why, and a test pins zero pencils and no save bar in the edit state.", "Edit's disableDuringInlineEdit read a ref written later in the same render, so it could lag a render. It is now state set during render (setRecordEditEligible); the hooks-below-early-returns constraint rules out an effect.", "Files outside the claim's surface: content/docs/permissions/system-context.mdx (census row, required by the gate for the new isSystem read); ui/packages/app-shell/src/index.ts, package.json and a new record-body-table-editor-renderer.tsx (sideEffects chain); ui/packages/cli/src/utils/known-schema-types.ts (regenerated); the i18n locales and plugin-form (from the earlier run).", "origin/main (5 commits) was merged in as one merge commit before the PR opened, per AGENTS §10. The merge was clean, and builds and affected tests were re-run after it.", "A5 browser dogfood was not run (see browser_reading_A5).", "The resume order's trailer spelling is 'Co-authored-by: Claude' plus Claude-Session, and the commits use it; the harness reminder's model-named trailer was not used." ], "uncovered_write_paths": "see security_findings", "open_questions": [], "security_findings": "withheld", "out_of_scope_findings": [ "none" ] }objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
Claim amendment · area ux-2 · 2026-11-20T06:31Z · amends claim 7029471192 (answers L1-a R1, 7032276125)
File surface, added (all already in PR #35755; nothing new is edited by this amendment beyond the R2 guard commit, which stays in
lifecycle-hooks.tsand its integration test, both already claimed):packages/plugins/plugin-approvals/src/approvals-plugin.ts(the onebindDetailRowLockHookbind line) andcontent/docs/permissions/system-context.mdx(the census row the system-context gate requires for the guard's SYSTEM read of a row's FK columns).ui/packages/app-shell/src/views/recordEditState.tsxand the newrecordEditState.helpers-35599.test.ts.ui/packages/plugin-form/src/RecordBodyTableEditor.tsxand its test,formChrome.ts, andui/packages/plugin-form/src/index.tsx(the export).ui/packages/plugin-form/src/affordanceGrantMap-12082.test.tsx: the edit state's two save sites entered in the write census.ui/packages/i18n/src/locales/: 3 new keys each (the discard confirm and the read-only body-table notice).ui/packages/plugin-detail/src/index.tsx,relatedListCompact.ts(RecordBodyTableEditorSlotContext),renderers/record-related-list.tsx(one wrapper;RelatedList.tsxuntouched) and the newrecord-related-list.editorSlot-35599.test.tsx. These were ⛔ in the claim only because 相关子表的页签:不放筛选排序,右上角只留「添加」和「在列表中打开」;批量添加要么全成要么全不成 #35601's PR fix(record-page): the related tab offers only open-in-list and one add entry; a multi-pick add is all or none #35725 was editing the same area; fix(record-page): the related tab offers only open-in-list and one add entry; a multi-pick add is all or none #35725 merged at 05:56Z (bae933b57c), so that reason is gone.Everything else in claim 7029471192 stands.
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
Closed-out · area ux-2 · 2026-11-20T07:41Z
1e018d6ede(Fixes #35599; this card closed completed)Delivered:
RECORD_LOCKED, with the record lock's exemptions. A reparent is checked at both ends, and an unresolvable write fails closed. The UI hides New, Edit and Delete on a locked record's lines.Browser reading (A4) was not measured; the PR body says so.
State:
pm:dispatchedremoved; card closed.