Repository navigation
feat(automation): the stage confirms name the flows a move would start (#35928) - #36316
Conversation
… update starts (#35928) [wip] Claude-Session: https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF Co-authored-by: Claude <noreply@anthropic.com>
…5928) [wip] Claude-Session: https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF Co-authored-by: Claude <noreply@anthropic.com>
…35928) The list cell's state-machine confirm and the record page's stage confirm (path press and header stage menu) read one shared hook in plugin-detail, useRecordUpdateStarts, and draw StageChangeStarts under their sentence. activeFlowsBundle moves from app-shell into @object-ui/i18n so the confirms translate flow labels as the flow runner does. Changesets and docs. Claude-Session: https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF Co-authored-by: Claude <noreply@anthropic.com>
…35928) api-surface, export-origins, declaration-map, the strictness-ledger api count and the automation-api reference page; the route-ledger census sentence; the trigger package's spec/automation test alias; the door test pays its metadata load at collection. Claude-Session: https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF Co-authored-by: Claude <noreply@anthropic.com>
…ss file Per the shared-harness rule (ruling record 6583487846): the list cell's pins join ObjectGrid.autosave-35685, the record page's join record-path.stageChange-28199 and RecordStageMenu-35891, each as a top-level describe. Claude-Session: https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF Co-authored-by: Claude <noreply@anthropic.com>
…-y48lf1 # Conflicts: # ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx
Claude-Session: https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 5 package(s): 80 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 18 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 184 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2e6540d20ab56429595fea7eba0260e137b26c90 && git checkout 2e6540d20ab56429595fea7eba0260e137b26c90
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin cd7ea2e355c3829ff1b3da93f046308ee6f6eb16 41487226fa0c4be52fa3085a09e0cd806434b563 && git checkout -B drift-repro cd7ea2e355c3829ff1b3da93f046308ee6f6eb16 && git merge --no-ff 41487226fa0c4be52fa3085a09e0cd806434b563
node scripts/docs-audit/affected-docs.mjs --json cd7ea2e355c3829ff1b3da93f046308ee6f6eb16
|
Claude-Session: https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 Co-authored-by: Claude <noreply@anthropic.com>
…rd keys it adds Claude-Session: https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: PR #36316, card #35928, ruling record 7073655354, claim amended 7076933558. Read: the card and all 9 comments, the PR body, the 60-file net diff against base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentM1 (must-fix) — the door accepts a S1 (should-fix) — the preview is the live gate's function over a narrower context, and the contract says otherwise. S2 (should-fix) — the ledger row fills N1 (nit) — N2 (nit) — the module note of Held, sentence by sentence: the request and response docblocks against the handler (order: query set, body, 501, caller-scoped read, engine); the ledger note against the handler; the contract docblock's "enabled, armed, record-change, this object, token binds an update" against Escalations for the adopting seat:
Implemented-by: VERDICT: FAIL |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK · head 维护者速读
要改的(2 项)
席位核对(本轮已读,下一轮增量时只核上面两项加 CI)
|
… of the object The door refuses a change key that is not a declared field of the object, and a read that answers no record, before the engine is asked; the request schema holds each change key to the field-name grammar. The ledger row is pinned to the schemas the suite parses with, and the preview's binding of the caller (user and tenant only) is stated in the contract and the docs. Claude-Session: https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 REWORK(增量)· head 维护者速读
要改的(2 项)
增量核对(
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review of PR #36316, card #35928, ruling record 7073655354. The prior record is 7077575603, a FAIL at M1: closed ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. N3 (nit) — the stated limit names one direction only. The request schema docblock, Held, sentence by sentence, in the delta:
Escalations for the adopting seat:
Implemented-by: VERDICT: PASS |
…ller limit reads both ways Claude-Session: https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 Co-authored-by: Claude <noreply@anthropic.com>
…eads the record (objectstack-ai#36394) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbVF7sWPNE4HmjkgyaVxQYif)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA Fixes objectstack-ai#36309 Clause-②: yes (widening) — measured: the claim expected `no`; `RecordContextValue` gains the optional member `reread` (built `dist/context/RecordContext.d.ts` carries `reread?: () => void | Promise<void>;`, exported through `@object-ui/react`'s root); nothing removed or renamed. The seat amends the claim. Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:在列表抽屉(以及记录页上打开的抽屉)里改阶段被「别人刚改过」拒绝后,记录会重新读取,再点一次「移动」就能成功;抽屉里依旧没有「刷新」按钮,整页记录页不变。 - 为什么做:修的是阶段菜单在抽屉里的一个缺陷(之前只修好了整页),属于记录页阶段推进这条线。 - 出错会怎样:最坏是抽屉里阶段被拒后仍要关掉抽屉重开才能移动,和改前一样;改动可直接撤回。 - 要你做什么:无 ## What changes The card's step 1, measured: the record header's stage menu **does** draw in a drawer. `RecordDetailView` mounts the header's stage slot with no `embedded` gate, and the new pin below finds the menu trigger, opens it and writes a Move in an `embedded` view. The "split preview" no longer exists (`NavigationOverlayMode` lists `page | drawer | new_window | none`; the split face retired), so the embedded surfaces today are the list's record drawer (`objectViewRecordOverlay`'s `RecordStackDrawer`, and `NavigationOverlay` in `ObjectDataPage` / `InterfaceListPage`) and the drawer a record page opens over itself (`RecordPageDrawerHost`). All mount `RecordDetailView` with `embedded`. Step 2, as ruled ("separate 'show a refresh button' from 're-read the record' instead of overloading `refresh`"): - `@object-ui/react` — `RecordContextValue` gains `reread`, the record re-read with no affordance of its own; `refresh` is documented as what it is, the host's opt-in to the header's Refresh entry. `reread` joins the provider's memo dep list. - `@object-ui/plugin-detail` — the stage path (`useStageChange`, shared by the header's `RecordStageMenu` and `record:path`'s stage press) re-reads after a move and after a 409 through `ctx.reread`, and through `ctx.refresh` when the host gives no `reread` (so a host that provides only `refresh` behaves as before). - `@object-ui/app-shell` — `RecordDetailView` hands the header's provider `reread` on the page and in a drawer alike (the same `'*'` notice the Refresh entry publishes: a 409 is a write this client never saw); `refresh` stays `undefined` when embedded, so the drawer still draws no Refresh entry. On the record page the stage path's behaviour is byte-for-byte what it was. ## Tests - New block `RecordDetailView.embeddedStageReread-36309` in the shared harness `RecordDetailView.harness.test.tsx` (the file's rule for new `RecordDetailView` pins): - in a drawer, a 409 on Move re-reads the record and the second Move carries the new version (`ifMatch` of read 2); - CONTROL: the drawer draws no Refresh entry; - CONTROL: on the record page the same 409 re-reads, the second Move carries the new version, and the Refresh entry is still offered. - Red on the base before the fix (commit 4253dfd, test only): `× in a drawer, a 409 on Move re-reads the record …` failing at the `findOne` second-call assertion; both controls green. Green after. - Fixture spelling: `RecordStageMenu-35891.test.tsx` and `record-path.stageChange-28199.test.tsx` handed the stage path `refresh={refresh}`; they now hand `reread={refresh}` (they only used the member the path called). - New block in `RecordStageMenu-35891.test.tsx` (`objectstack-ai#36309 a host with only refresh still re-reads; reread wins where both are given`): a provider with only `refresh` calls it after a 409 on Move; CONTROL: with both, `reread` is called and `refresh` is not. - `RecordContext.valueShape.pin.test.tsx` lists `reread` (its compile-time half red the react type-check until it did, which is the pin working). <details><summary>Local readings on head 6e09b30 (round 1; round 2 readings are in the os-dev-report comment on the card)</summary> - `pnpm --dir ui exec vitest run packages/react/src/context/__tests__/RecordContext.valueShape.pin.test.tsx packages/app-shell/src/views/RecordDetailView.harness.test.tsx packages/app-shell/src/views/RecordDetailView.headerRefresh.test.tsx packages/plugin-detail/src/__tests__/RecordStageMenu-35891.test.tsx packages/plugin-detail/src/renderers/__tests__/record-path.stageChange-28199.test.tsx packages/components/src/__tests__/page-header-refresh.test.tsx`: `Test Files 6 passed (6)`, `Tests 160 passed (160)`. - `pnpm --filter @object-ui/react type-check`: exit 0. `@object-ui/plugin-detail`, `@object-ui/components`, `@object-ui/app-shell` `type-check`: exit 0 each (on 7341588, after a build of the app-shell dependency closure; the later head changes only a react test file). - `pnpm --dir ui exec vitest run scripts/`: `Test Files 172 passed | 2 skipped (174)`. - Derived gate families (`dispatch-gates.mjs --commands`): 38 run, all exit 0; `--ran`: `38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED`. Ratchets re-run on 6e09b30: `check:type-check-coverage`, `check:type-check-debt`, `check:cross-package-test-inputs`, `check:test-source-alias`, `check:nul-bytes`, `check:published-files`, `check:undeclared-dep-imports`, `check:tier-file-adoption`, all exit 0. - Red on the base (4253dfd, pin only): `1 failed | 2 passed`; the failure is the drawer case at its `findOne` second-call assertion. </details> ## Acceptance notes - `RecordContextProvider` has two other producers, `RecordDetailPanel` (the board/calendar record panel) and `recordBinding`; neither passed `refresh`, so neither re-read after a stage write before, and neither draws a stage surface that writes (the panel draws the inline save bar, which takes its own `refresh` prop; the binding is `canEdit={false}`). Unchanged. - No narrowing: a host that passes only `refresh` keeps its re-read (the stage path falls back to it); `reread` is the added, optional member. Within this repo `RecordDetailView` is the only producer of either. - `content/docs/frontend/` and the react README document no `RecordContext` member, so there is no docs page to update. - Overlap: `overlap-check.mjs` clean against objectstack-ai#36343 (shares `RecordDetailView.tsx`) and objectstack-ai#36316 (shares the stage files; it adds no `refresh` call there). ## Verification Read first: `ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx` (the four `reread` calls), `ui/packages/app-shell/src/views/RecordDetailView.tsx` (`headerReread` beside `headerRefresh`), `ui/packages/react/src/context/RecordContext.tsx` (the two members' contract). Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/views/RecordDetailView.harness.test.tsx -t embeddedStageReread` — expect 3 passed. Browser screenshot: NOT MEASURED (no dev app driven in this run; the harness pin renders the real `RecordDetailView` embedded). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jRaJbQ4vqdv4J5peqA <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
…t grid (objectstack-ai#36414) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbGyo1s5XDjcEx7u8WDqbFTx)_ Fixes objectstack-ai#36360 Part of objectstack-ai#35155 (item 3 only, the two "(empty)" doc comments; items 1-2 stay on that card) Clause-②: no Metadata-protocol: none ## 维护者速读 - 读文档的开发者:说明从"富文本单元格都在格子下方面板里编辑"改为分开写清"选中优先表格"与普通表格两种行为;用户界面无感。 - 属于列表单元格编辑富文本那项工作的收尾,替照着文档挂载普通表格的人纠正误导。 - 只改文字与注释,出错只是说明不准,可直接撤回。 - 要你做什么:无。 ## What changes Text only, no code or behaviour change. Each text that described the rich-text cell panel now names the select-first grid (`cellSelection`) for the panel and its keys, and says in one sentence what a grid without `cellSelection` does: - `ui/packages/plugin-grid/README.md` (ships in the npm tarball): panel sentence scoped; adds the non-select-first sentence. - `ui/packages/fields/README.md` (ships): same. - `content/docs/frontend/plugins/plugin-grid.mdx`: panel sentence scoped (its keys sentence already was); adds the non-select-first sentence. - `ui/packages/fields/src/FieldEditWidget.tsx`: jsdoc on `IN_CELL_PANEL_EDIT_WIDGETS` only. - `.changeset/36023-rich-text-cell-panel.md` (pending, not yet consumed by a release): the "Before" line now says the "This field can't be edited in a list" notice was the select-first grid's. - `.changeset/36360-rich-text-panel-wording.md`: new patch note for the two published READMEs. - Second commit (rider, objectstack-ai#35155 item 3): `GroupRowProps.label` in `ui/packages/plugin-grid/src/GroupRow.tsx` and the doc comment in `ui/packages/plugin-grid/src/temporalCellFace.ts` now say an empty group key is labelled with the grid's `grid.empty` string ("Empty" in English, `useGroupedData.ts` `emptyLabel = t('grid.empty')`), not "(empty)". Comments only. **DELIBERATE CORRECTION** of the pending note `.changeset/36023-rich-text-cell-panel.md` (Check Changeset's foreign-changeset rule stays red by design). Corrected sentence: "Before, these cells opened no editor; on a select-first grid the cell said "This field can't be edited in a list"." Reason: the notice comes from `cellSelection.describeCell`, which only a select-first grid has (`factsOf` in `data-table.tsx`). Every clause was measured in `ui/packages/components/src/renderers/complex/data-table.tsx` at the base: - panel placement: `editsBelow = isEditing && selectFirst && editorBelow`, else `placement: 'cover'` (over the cell); - one click opens: the non-select-first `onClick` calls `startEdit` under `singleClickEdit`, which `ObjectGrid` defaults to `true`; - Ctrl/Cmd+Enter in the injected TEXTAREA commits only under `selectFirst && (ctrlKey || metaKey)`; - Esc: `exitEdit(true)` on both hosts; - click outside: the document `pointerdown` listener calls `saveEdit(true)`, which stages; without `autosaves` (`selectFirst && onRowSave`) the staged value waits for the save bar (`hasPendingChanges && !autosaves`). ## Tests No tested behaviour changed, so no tests and no ablation. ## Acceptance notes - The select-first panel sentence says "a click outside saves"; measured, an immediate save needs `autosaves` (`selectFirst` plus `onRowSave`); a select-first grid wired with `onBatchSave` alone keeps the save bar. Not changed here (outside the card's wording); noted only. ## Verification Two-minute check: `git diff origin/main...HEAD -- ui/packages/plugin-grid/README.md` shows the panel bullet now opening "on a select-first grid (`cellSelection`)" and a second sentence for a grid without it. Files to read first: `ui/packages/plugin-grid/README.md` (published), `.changeset/36023-rich-text-cell-panel.md` (the corrected pending note). <details><summary>Local gates at 83d66cf</summary> - `dispatch-gates --commands` derived 66 commands; 59 exit 0. - `check-empty-changeset --base origin/main` exit 1: the expected DELIBERATE CORRECTION refusal above. - NOT MEASURED, reason PREREQUISITE NOT MET (unbuilt workspace `dist/`, shared verify lock contended): `check:doc-formula-expressions` (3), `check:doc-security-posture` (3), spec `check:docs` (1), spec `check:skill-examples` (3), `check:docs-transcript-drift` (3), `pnpm --dir ui exec vitest run scripts/` (all 56 failures import the unbuilt `@objectstack/spec` dist). CI builds and runs them. - `overlap-check`: VERDICT clean exit 0 (objectstack-ai#36357, objectstack-ai#36316 merge cleanly). - `check-nul-bytes`: OK. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jTqAcPU4VyEPH7iVn2 --------- Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Contract reviewServed-tier: Delta review of PR #36316, card #35928, ruling record 7073655354. The prior record is 7078841748, a PASS at N3: closed ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Held, sentence by sentence, in the delta:
Observation, not a finding: the PR body counts 70 check-runs on this head, and the head now shows 74 (63 success, 11 skipped). The difference is a count taken earlier. No run failed. Escalations for the adopting seat:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf L1 ACCEPT(增量)· head 维护者速读
增量核对(
|
|
repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC Landing (seat 7, 2026-11-22T12:58Z): head |
… and group subtotals and the footer total follow a cell save (objectstack-ai#35689 slice B) (objectstack-ai#36476) Fixes objectstack-ai#35689 — slice B (groups and totals after a save). Slice A (touch, accessibility, checked rows) landed earlier on its own PR, so nothing else on the card is left. Clause-②: no Metadata-protocol: none ## 维护者速读 - 列表页按阶段分组时,把一条的阶段从甲改成乙:停在这一行时它不动,点到别的行后它出现在乙组,两组的条数和金额小计都对;改金额后分组小计和表尾合计马上更新。 - 列表行内编辑重做专题的最后一块(分组与合计随保存更新),这张卡至此做完。 - 出错时最坏是分组小计或表尾合计显示旧数字、或这一行要刷新后才换组,保存的数据本身不受影响;可以直接撤回。 - 无 ## What changes Measured first on `origin/main` 285ad8d, in a list that selects a cell first (the list page's grid), with the card-named pins below run against the unchanged source: | Card item | Server grouping | Browser grouping | Premise | |:---|:---|:---|:---| | A row whose stage changed moves to its new group after the user leaves the row | did not move | did not move | holds: broken | | Group counts and amount subtotals after the save | not refreshed | not refreshed | holds: broken | | Footer total, flat grid whose rows are the whole set | not refreshed | n/a | holds: broken | | Footer total, grid paged on the server (whole-set figure) | already re-read after a write | n/a | false: works on main, pinned only | Why: a select-first save redraws only its own row (the row patches of objectstack-ai#35685) and the list lets its own write go by on the bus, so nothing is read again. The groups, the group headers' numbers and the footer's row figures read the rows as loaded, not as saved. The whole-set footer listens to the bus itself, so it already re-asked. What this PR does, all in `@object-ui/plugin-grid`: - **The figures read the saved rows.** `rowsAsSaved` (in `objectGridRowPatch.ts`) gives the rows with each saved row in place of the one read, while that read is the one held. The footer reads it, so a flat grid's total includes the saved value at once. A grid that groups the rows it was handed buckets it, so its counts and subtotals follow the save. - **A row whose save changed a grouping field is held in its group until the row is left.** `writeRowInPlace` notes such a record in `heldInGroup`. The browser bucketing reads that record as it was loaded (it stays in its group, counted and summed there). `onCellSelect` on a cell of another row lets it go: the browser bucketing then moves it, and a server-grouped grid reads its group headers and open groups' rows again (`regroupNonce`). A cell of the same row does not let it go. Any later save on a held row waits with it. - **Any other save in a server-grouped grid re-asks only the headers** (`savedFigureNonce`), so subtotals update at once and no row is read again. `objectGridGrouping.ts` now keys the header query on that nonce and the row pages on `regroupNonce` alone. - A grid without the select-first model still reads everything again after each save, as before (control pin). Docs: `content/docs/frontend/plugins/plugin-grid.mdx` gains one bullet under the per-cell save section. Changeset: `@object-ui/plugin-grid` patch. ## Tests One new top-level describe in the component's existing select-first save harness, `ObjectGrid.autosave-35685.test.tsx`: "ObjectGrid — groups, subtotals and the footer total after a cell save (objectstack#35689)". It covers both grouping paths: the server, where the grid asks its own group headers and group pages, and the browser, where it buckets rows a host hands it. - Card line 「离开这一行后它出现在乙组,两个组的条数和金额小计正确」, on each path: a stage pasted from Prospect to Won keeps the row in Prospect, with both groups at their old figures. A click on another cell of the same row keeps it there too. A click on a cell of another row moves it to Won, and the groups read Prospect 1 · 100 and Won 2 · 80. - Card text 「分组小计…随保存更新」, on each path: an amount saved is in its group's subtotal at once. No row is read again. A server-grouped grid asks its headers exactly once more, and a browser-grouped one asks nothing. - Card line 「表尾合计在改了金额后更新」: in a flat grid whose rows are the set, the footer sum goes from 180 to 200. In a grid paged on the server, the whole-set footer is read again and reads 200 (this holds on main and is pinned only). - Control: without `cellSelection`, a write on the bus re-reads the grouped grid at once. Ablations: one run per leg through `scripts/ablation-replace.mjs`. Every anchor hit x1 and went to x0, and every restore came back to the HEAD blob `f5aebf14` with `git diff HEAD` empty. The suites import the grid by relative path (source), so no dist leg was owed: | Leg | Mutation | Red | |:---|:---|:---| | A1 | `onCellSelect` no longer lets a held row go | 2: the move pin on both paths | | A2 | no header re-ask on a save | 1: server subtotal | | A3 | the grouping reads the loaded rows | 2: browser move and browser subtotal | | A4 | the footer reads the loaded rows | 1: flat footer | | A5 | a held row is bucketed as saved | 1: browser hold before leaving | <details><summary>Readings (all through scripts/pm/os-verify-lock.sh)</summary> - On `origin/main` 285ad8d before any source edit, the new describe gave 5 failed and 2 passed (the paged footer and the control). The failures: Won expected Bolt and Cord, got Cord only (both paths); the subtotal stayed 2 · 150 (both paths); the footer stayed Sum: 180. - At e96aa67 (after merging origin/main with objectstack-ai#36332 and objectstack-ai#36396): `pnpm turbo run build --concurrency=2 --filter='@object-ui/plugin-grid^...' --filter='@objectstack/client-react...'`: 54 successful. Then `pnpm --filter @object-ui/plugin-grid run type-check` (script echoed): exit 0. Then `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-grid/`: Test Files 304 passed (304), Tests 2706 passed (2706). And `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/`: Test Files 172 passed, 2 skipped; Tests 5127 passed, 2 skipped; exit 0. - At 1285fe4 (the final head; it only moves the new describe above the state-machine block, so it does not collide with an open PR's append at the end of the file): the harness gave Test Files 1 passed (1), Tests 29 passed (29), VERDICT command-exit 0. `pnpm check:nul-bytes` exit 0. </details> <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at e96aa67 derived 72 families (6 paths vs merge base d8628ac). All ran with exit 0. Three needed a second attempt: `check:skill-examples` first exited 3 because client-react had no dist (built, then exit 0); `check:type-check-debt` first exited 3 because the lock was busy (run under the lock, exit 0, 0 raw tsc errors); the ui `scripts/` suite first got no turn on the lock (exit 99), and its reading is above. - `--ran`: 72 derived, 72 run, 0 NOT-MEASURED, 0 UNRUN, with every exit code recorded. - `node scripts/pm/overlap-check.mjs` at 1285fe4: VERDICT clean exit 0, against origin/main 7ae5e07 and 4 open heads (objectstack-ai#36453, objectstack-ai#36438, objectstack-ai#36357, objectstack-ai#36316). </details> ## Acceptance notes - "Leaving the row" means selecting a cell of another row (a click, the arrow keys, Tab across the row's end). Escape, or a click outside the grid, keeps the row selected, so it stays in its group until another row is selected or the list loads again. - When a server-grouped grid regroups on leaving a row, it reads the open groups' rows again, so a group pager turned past page 1 starts over at page 1, as on any refresh. - A held record stays noted after a later full load. The next time a row is left, the groups are read one extra time. That read is harmless. ## Verification Files to read first, by risk: 1. `ui/packages/plugin-grid/src/ObjectGrid.tsx`: `noteSavedPlace`, `leaveHeldRows`, and the `savedData` and `groupedData` memos. 2. `ui/packages/plugin-grid/src/objectGridGrouping.ts`: the header and row reload keys. 3. `ui/packages/plugin-grid/src/objectGridRowPatch.ts`: `rowsAsSaved`. Two-minute check: `pnpm --dir ui exec vitest run packages/plugin-grid/src/__tests__/ObjectGrid.autosave-35685.test.tsx`. Expect 29 passed, including the seven under "(objectstack#35689)". --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…steps in the reader's language (objectstack-ai#36335) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUq2j5tRRVo3TVY3wcS1Fdg)_ Part of objectstack-ai#35979 (Asked item 1 only. Asked item 2, a translation key for decision / notify / start / end node labels, was ruled option A on the card and is built on its own claim and branch, not in this PR; the card stays open for it) repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:非英文读者打开带流程嵌入的使用手册时,流程标题、审批步骤名,以及判断分支指向的审批步骤名,改用读者语言显示(例如「大额商机审批」「销售经理审核」);包里没有译文的地方仍显示原文。 - 为什么做:HotCRM 中文手册里的审批流程图标题和步骤全是英文,而包里已带中文译文;这是此前 Studio 流程设计器同类修复未覆盖的文档查看器。 - 出错会怎样:只影响显示,最坏情况是某个步骤仍显示原文;不改任何数据,可直接撤回。开始、判断、通知、结束这几类步骤的译文位置已裁定要补,由另一项单独完成,本次仍显示原文。 - 要你做什么:无。 ## What changes - **The docs viewer's flow embed reads the package's flow labels.** `FlowView` in `element:metadata_viewer` now draws the flow title from `flows.FLOW.label` and each `approval` step from `flows.FLOW.approvals.NODE_ID.label`, in the reader's language, and falls back to the authored label (then the name / node id) where the bundle has no entry. Two label reads changed (`flow.label`, `n.label`), through one hook call placed before the early returns. - **Branch targets too.** Since objectstack-ai#36327 landed, the business view lists each decision's branches and names the step each branch leads to. That name now takes the same translated step label (a `stepLabel` prop on `Branches`), so an approval step reached from a decision is not named in English beside its translated row. - **The flow-label resolution moved to `@object-ui/i18n`.** `ui/packages/i18n/src/flowLabels.ts` holds `flowLabelTranslations` and `useFlowLabelTranslations`, moved from the Studio module because `@object-ui/components` cannot import `@object-ui/app-shell`. It is built on `activeFlowsBundle`, which objectstack-ai#36316 already moved into `@object-ui/i18n` (`flowsBundle.ts`); this PR adds no second copy of that reader. The flow label still goes through the spec's `translateFlow`; the step label is still read for `approval` nodes only. The Studio module keeps its own parts (the Automations rail reader and the canvas context) and re-exports the moved ones, so its call sites are unchanged. - **Which steps can be translated today.** The spec's `flows.FLOW` group has a label key only for `approval` steps. A start, decision, notify or end step keeps its authored label until the Asked item 2 work adds its key. - No spec change, no server change. `GET /meta/flow` is unchanged; the embed reads the bundle the host already loads. ## Read first (by risk) 1. `ui/packages/components/src/renderers/basic/metadata-viewer.tsx`, the `FlowView` and `Branches` hunks: the hook sits before the early returns, beside the `business` flag from objectstack-ai#36327. 2. `ui/packages/i18n/src/flowLabels.ts`: the moved resolver; compare with the Studio original removed from `flow-label-translations.tsx`. 3. `ui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx`: what stays in Studio, and the re-export. Two-minute check: `pnpm --dir ui exec vitest run packages/components/src/__tests__/metadata-viewer.test.tsx`; expect 18 passed, including the three tests under "flow embed: package label translations". ## Tests <details><summary>Pins (one top-level describe in the existing viewer harness)</summary> `metadata-viewer.test.tsx`, describe "element:metadata_viewer flow embed: package label translations (flows.FLOW.label, approvals.STEP.label)", with a real `createI18n` instance loaded from a zh-CN `TranslationData` through `transformSpecTranslations`, inside `I18nProvider`: - an `opportunity_approval`-shaped flow draws 大额商机审批, 销售经理审核 and 销售总监签批, and none of the English approval labels; the start, decision, notify and end steps keep their authored labels; - a bundle entry without the flow label and without one step falls back to the authored text; a bundle that translates only another flow leaves everything authored; - a decision branch whose target is an approval step names it 销售总监签批, and the English label appears nowhere on the card. The Studio pins in `FlowCanvas.test.tsx` exercise the moved resolver unchanged. </details> <details><summary>Runs</summary> - At 78faa00, under the verify lock: `vitest run` of `metadata-viewer.test.tsx` and `FlowCanvas.test.tsx`: `Test Files 2 passed (2)`, `Tests 47 passed (47)`; then `pnpm --filter @object-ui/components run type-check` (both tsc programs); `VERDICT command-exit 0`. - At 10f5352 (first main merge), under the lock: turbo build of the `@object-ui/app-shell^...` and `@object-ui/components^...` closures (68 tasks successful), the same two files (`Tests 40 passed (40)`), and `pnpm --filter @object-ui/i18n --filter @object-ui/components --filter @object-ui/app-shell run type-check`: test exit 0, type-check exit 0. - Ablation at 78faa00 through `scripts/ablation-replace.mjs --delete`: anchor `(target && stepLabel?.(target)) ?? ` 1 to 0, blob e061084 to 1bcbe5a1bdbb. Result: `Tests 1 failed | 17 passed (18)`, the branch-target pin red. Restored: blob equals HEAD and `git diff HEAD` is empty. A first attempt with `--replacement ''` was refused by the tool before any test ran (it cannot count an empty replacement), so it measured nothing. The test resolves the viewer through `src`, so no dist preflight applies. - Earlier ablation of the two label reads (seat 4, at 1ffd047): both original pins red, restored clean. </details> ## Acceptance notes - **Merges.** This branch merged `origin/main` twice. First merge (c261a7c, objectstack-ai#36316, already on main): objectstack-ai#36316 moved `activeFlowsBundle` into `@object-ui/i18n` at the same path this branch had used. Resolution kept main's `flowsBundle.ts` byte-for-byte, dropped this branch's duplicate move, and kept `flowLabels.ts` and its export. `git grep` on the merged tree: one `function activeFlowsBundle` (`ui/packages/i18n/src/flowsBundle.ts`), no app-shell copy, no `utils/flowsBundle` import left. Second merge (e605773, objectstack-ai#36327): kept its branches and entry-condition code and its tests, and added the two label reads plus the branch-target label. - **Measurement for Asked item 2 (built elsewhere).** hotcrm `opportunity_approval` (hotcrm 01d3ec4): 13 nodes; 11 drawn at the default business altitude; 2 have a key (`approval`), 9 do not: 1 start, 3 decision, 4 notify, 1 end. - The embed's subtitle is the authored `flow.description`. The spec's `flows` group has no description key, so it stays authored. - No `content/docs` page documents the viewer (only its ADR, a governed surface), so no docs page changed. - Changeset: `@object-ui/components` and `@object-ui/i18n` patch. `@object-ui/app-shell` is private and its behaviour is unchanged. ## Verification <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at 78faa00: 38 families, the same list as at 10f5352. At 10f5352 all 37 non-vitest families exited 0, each exit code captured before any pipe, and `pnpm --dir ui exec vitest run scripts/` under the lock gave `Test Files 172 passed | 2 skipped (174)`, `VERDICT command-exit 0`. The re-run at the final head is in the report on the card. - `node scripts/pm/overlap-check.mjs` at 5999753: `VERDICT clean exit 0` (origin/main e605773 merges cleanly, no open PR head overlaps). - CI at 10f5352: all eleven required contexts success. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jV3scu6UYPb42n5okQ)_ <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jV3scu6UYPb42n5okQ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…, and object-grid singleClickEdit is retired (objectstack-ai#36357) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb2rJZB694pnkwLCMmCEJ3ev)_ Fixes objectstack-ai#36270 repo:objectstack#7 · zhuangjianguo · session_01QsR2jSHfkSrXZxbdWoQxnW Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: none — skills/ never names singleClickEdit, keyboardNavigation or object-grid's editing gestures (git grep at the head) ## 维护者速读 - 用户看到的变化:所有「可编辑」的表格(对象视图自己画的表格、页面里放的 object-grid 表格,和列表页一样)都改成「先选中、再编辑」:单击选中单元格,双击、回车、F2 或直接打字进入编辑,改完一格立刻保存;「全部保存 / 全部取消」那条保存栏不再出现。不可编辑的表格不变,单击仍然打开记录。元数据里的 `singleClickEdit`(单击即编辑)作废:写了会报错并提示删掉,`os migrate meta` 能自动删除。 - 为什么:按您的裁定 A「统一新编辑方式」。新方式里单击是「选中」,`singleClickEdit` 已经没有可切换的东西,按 ADR-0049「要么执行、要么删除」退役;`keyboardNavigation` 的说明也改成实际行为(可编辑表格上方向键导航始终开启)。 - 最坏情况:有人在页面元数据里写了 `singleClickEdit`,升级后该页面校验失败,需要删掉这个键(提示里写明了怎么做,迁移工具可自动删);或者某张可编辑表格的使用者习惯了单击就编辑,现在要多一次双击。本仓、hotcrm、gallery 中没有任何地方写过这个键。 - 需要您做的:无(L2 由席位在最终提交上做)。 ## What changes The ruling A on objectstack-ai#36270 (record 7076617499): one editing model. Every grid that renders editable uses the list page's select-first cell model, and the key that only made sense in the old model is retired. - **`ui/packages/plugin-grid/src/ObjectGrid.tsx`** (the one behaviour hunk): `hostCellSelection = cellSelectionProp ?? inlineEditable`. Absent a host's `cellSelection`, a grid that renders editable (`editable` AND the object's inline-edit verdict AND the reader's `update` grant) is select-first; a read-only grid keeps click-to-open. A host's `true` (`ListView`, the related tab) or `false` still wins. The data table is handed `singleClickEdit: true` unconditionally: it is inert under select-first, and it is the staged model's old default for a host that passes `false`. - **`@objectstack/spec`**: `ComponentPropsMap['object-grid'].singleClickEdit` is a `retiredKey()` tombstone; D2 conversion `object-grid-single-click-edit-removed` (strip, whatever the value; order 83), D3 `object-grid-single-click-edit-retired`, `RETIRED_KEYS_BY_MAJOR[18]` row `ui/ObjectGridProps:singleClickEdit`, a `STEP18_RATIONALE` fragment (order 123), ledger `page.json` regions note [122] plus the narrowed [43]. `keyboardNavigation`'s describe narrows to what is enforced: always on for a grid that renders editable, `true` turns it on for a read-only grid. - **`@object-ui/types`**: `ObjectGridSchema.singleClickEdit?: never` with a `retirementTombstone()` zod twin; the `object-view` `table` slot inherits it (`TABLE_INHERITED_TOMBSTONES`, as `defaultSort`). `DataTableSchema.singleClickEdit` (host-paired) is unchanged. - **`@object-ui/plugin-view`**: `table.singleClickEdit` leaves `OBJECT_VIEW_TABLE_RELAY_KEYS`. The earlier host-level `cellSelection` spread is gone: `ObjectGrid`'s default covers the object-view grid, authored nodes and react pages in one place. - **`object-grid` inputs, `sdui.manifest.json`, `content/docs/ui/components/*`**: the `singleClickEdit` input is gone and the `editable` / `keyboardNavigation` descriptions say what the grid does. Docs and READMEs (`plugin-grid.mdx`, `plugin-view.mdx`, both packages' READMEs) describe select-first everywhere and the staged model as a host's `cellSelection={false}`. - BREAKING changeset `.changeset/36270-object-grid-single-click-edit-retired.md` (`@objectstack/spec` minor plus the three ui packages), with the FROM → TO table and `<!-- adr-0087: registered … -->`. ## The card's Done-when: the five grid families - **The object-view grid** (Studio view preview, a page placing an `object-view`) and **the authored `object-grid` node**: changed here. Pinned by `ObjectView.perCellSave-36270.test.tsx` and `authoredGridPerCellSave-36270.test.tsx`, with the ablation below. - **The related tab**: already select-first. `RelatedList.tsx` passes `cellSelection: true`, pinned by `RelatedList.tab-35892.test.tsx`; unchanged. - **The record picker and the designer grids** (`RecordPickerDialog`, `ObjectManager`, `FieldDesigner`): they render `ObjectGrid` without `editable`, so they are read-only and unchanged. - **Dashboard tables**: they are `data-table` / `object-data-table` nodes, not `ObjectGrid`, and have no save path. The card's dashboard-table pin therefore has no subject: there is no editable dashboard grid to pin. A bare `data-table` that a host hands `editable` still stages edits and draws its bar; that is the table primitive, which no in-repo grid host reaches. - So every grid that renders editable through `ObjectGrid` selects a cell first, and no in-repo host passes `cellSelection={false}`. - **The card's second Read-first question** (a child list inside a parent form saved together, objectstack-ai#35590): no in-repo host draws such a list through an editable `ObjectGrid`. The form's line items are the `GridField` widget, which this PR does not touch, and no in-repo host passes `cellSelection={false}` or its own `onBatchSave`. So no saved-together list loses its staging here. - **A React host's `onBatchSave`**: a host that passes `onBatchSave` alone on an editable `ObjectGrid` now has it bypassed (each cell writes through `onRowSave` or the grid's own `dataSource.update`). No in-repo host passes it. The changeset carries a FROM → TO row for it and `ObjectGridComponentProps.onBatchSave` is marked `@deprecated`. ## Tests - New: `packages/spec/src/ui/object-grid-single-click-edit.pin.test.ts` (tombstone at both channels for `true` / `false`, `editable` control, the narrowed describe, the conversion's delete and its controls, the step-18 wiring), `object-grid-single-click-edit-retirement.test.ts` (tree-scoped absence, `repo` project), `ui/packages/plugin-grid/src/__tests__/authoredGridPerCellSave-36270.test.tsx` (an authored editable node saves one cell with no Save All; read-only and host-`false` controls), and the earlier `ObjectView.perCellSave-36270.test.tsx`. - Migrated to the enforced contract: `ObjectGrid.keyboardNavigation-11068.test.tsx` (editable grids read the select-first pattern and `false` no longer turns it off; a host `cellSelection={false}` control keeps the old roving-focus reading), `ObjectGrid.cellSelection-35684.test.tsx`, `rowContextMenu-28434.test.tsx`, the types slot/round-6 tests, the ObjectView relay test. - 25 plugin-grid inline-edit files that pin the staged path now pass `cellSelection={false}` and no longer author `singleClickEdit`; two that passed `cellSelection={x || undefined}` pass `cellSelection={x}` (under the new default `undefined` means select-first). - `retired-key-removal-version.pin.test.ts` joins the new conversion. ## Acceptance notes - Select-first only where a grid renders editable, per the ruling; read-only grids keep click-to-open (pinned by the controls above). - `Clause-②: no (narrowing)`: the house spelling for a retirement; the seat re-amended the claim to it (7077058264). - Census of authored `singleClickEdit` in this repository's examples, hotcrm and gallery: zero, so the conversion is for stored rows and outside authors. - `check-governed-merges --pr 36357`: NOT governed (0 of 60 paths), 1,355 changed lines, under the 3,000 human-merge threshold. - With objectstack-ai#36332 (seat delta review 7077725274): once both land, a touch never edits in place on any editable grid. The one exception is a host that passes `cellSelection={false}`, which keeps the staged click-to-edit, so there a touch edits in place. Whichever of the two lands second re-runs overlap-check against the other's head. - objectstack-ai#35827 (retire `onBatchSave`) is unblocked by this: no authored or ObjectView grid reaches the batch save any more; only a host's explicit `cellSelection={false}` does. ## Verification Two-minute check: author `{ "type": "object-grid", "properties": { "objectName": "<any>", "editable": true } }` on a page; click a cell (it is selected, nothing opens), press Enter, type, press Enter: the value saves at once and no "Save All" bar appears. Add `"singleClickEdit": true`: the page refuses it with the prescription. Files to read first, by risk: `ui/packages/plugin-grid/src/ObjectGrid.tsx` (two hunks), `packages/spec/src/ui/component.zod.ts`, `packages/spec/src/conversions/entries/18/object-grid-single-click-edit-removed.ts`, `ui/packages/types/src/zod/objectql.zod.ts`. <details><summary>Local runs (final head 493b6a0)</summary> Final head `493b6a01` = `2bd02429` plus a merge of main `0b2118f4` after objectstack-ai#36478 landed (`719e8674`: main's side of `scripts/sdui-manifest.record.json`, and `component.mdx` regenerated with main's new `mobileMaxVisible` describe), then the regenerated manifest record (`493b6a01`, one `sha256` line). No rebase. - Dogfood battery on head 493b6a0: os-verify-lock `VERDICT command-exit 0` · `Test Files 485 passed | 3 skipped (488) · Tests 4108 passed | 68 skipped (4176)`, no failures. - Derived gate families on 493b6a0: 132 run, 0 NOT-MEASURED, every exit 0. `check-sdui-manifest` intact; `check-regen-pending` clear. - `overlap-check` on 493b6a0: clean against main `43916f3a` and every open PR sharing files. - CI at 493b6a0: 61 success, 9 skipped, 0 failed. Runs at 2bd0242: Final head `2bd02429` = a merge of `67fe4551` and main `dda5e74f`, made after the merge queue dropped the PR on a conflict in the generated `content/docs/references/ui/component.mdx`. The merge's only own change is that file, regenerated (main's new `showStar` describe). The code auto-merged, and `check-regen-pending` reports every deferred artifact current. - Dogfood battery on 2bd0242 (superseded by the run on 493b6a0 above): os-verify-lock `VERDICT command-exit 0` · `Test Files 485 passed | 3 skipped (488) · Tests 4108 passed | 68 skipped (4176)`, no failures. - Derived gate families on 2bd0242: 132 run, 0 NOT-MEASURED, every exit 0. - `overlap-check` on 2bd0242: clean against main `70194ffc`; the known conflict with draft objectstack-ai#36478 on `scripts/sdui-manifest.record.json` stands. Runs at 67fe455: Final head `67fe4551` = `4e94a273` plus the S4 changeset fix (the touch sentence, and one comment's wording). That commit changes only the changeset and that comment. - Dogfood battery on head 67fe455 (`pnpm --filter @objectstack/dogfood test`, closure built under the lock): os-verify-lock `VERDICT command-exit 0` · `Test Files 485 passed | 3 skipped (488) · Tests 4108 passed | 68 skipped (4176)`, no failures. - Derived gate families on 67fe455: 132 derived; `--ran` reconciles 132 run, 0 NOT-MEASURED, every exit 0. - `overlap-check` on 67fe455: clean against main; one conflict with draft objectstack-ai#36478 in `scripts/sdui-manifest.record.json` (the regenerated manifest record both PRs carry): whichever lands second merges main and regenerates it. `4e94a273` = the review rework (`3894ea44`: TSDoc and comments, `onBatchSave` `@deprecated`, changeset rows, docs) plus a merge of main after objectstack-ai#36332 landed (no rebase, no conflicts). - Dogfood battery on 4e94a27 (superseded by the run on 67fe455 above) (`pnpm --filter @objectstack/dogfood test`, closure built under the lock): os-verify-lock `VERDICT command-exit 0` · `Test Files 485 passed | 3 skipped (488) · Tests 4108 passed | 68 skipped (4176)`, no failures. - Derived gate families on 4e94a27: 132 derived; `--ran` reconciles 132 run, 0 NOT-MEASURED, every exit 0 (also 132/132 exit 0 on `3894ea44` before the merge). - After the merge: `@object-ui/plugin-grid` `Test Files 305 passed · Tests 2705 passed`; `@object-ui/plugin-view` `Test Files 67 passed · Tests 732 passed`. `type-check` for `@object-ui/types` and `@object-ui/plugin-grid` exit 0 on `3894ea44`. - `overlap-check --exclude-pr=36357` on 4e94a27: clean against main and the eight open PRs sharing files (objectstack-ai#36439, objectstack-ai#36438, objectstack-ai#36435, objectstack-ai#36411, objectstack-ai#36392, objectstack-ai#36351, objectstack-ai#36343, objectstack-ai#36316). objectstack-ai#36332 is merged and is in this head. Earlier runs (head 579f99a; suites on 1c2a16b): - `@object-ui/plugin-grid` whole package: `Test Files 298 passed | 3 failed (301) · Tests 2676 passed | 6 failed`; the 6 (keyboardNavigation ×4, cellSelection ×1, rowContextMenu ×1) were fixed and those three files re-run green (8 + 28 + 18). - `@object-ui/plugin-view` whole package: `Test Files 67 passed (67) · Tests 732 passed (732)`. `@object-ui/types`: `Test Files 389 passed · Tests 10498 passed`. - `type-check` for `@object-ui/types`, `@object-ui/plugin-grid`, `@object-ui/plugin-view`: exit 0. - `@objectstack/spec` test under the verify lock: 1 failed of 27,924 (`retired-key-removal-version.pin`, the JOIN row this PR then added; that file re-run 63 passed). `test:repo`: `Test Files 93 passed · Tests 1564 passed`. - Derived gate families (`dispatch-gates --commands`): 132 derived; `--ran` reconciles 132 run, 0 NOT-MEASURED. Six first read exit 3 on a stale spec dist and `check:generated` exit 1 on the same stamp; after `pnpm --filter @objectstack/spec build` all seven re-ran exit 0. `check-plugin-teardown-shape --self-test` needed its pinned fixture commit fetched into the shallow clone, then exit 0. - `node scripts/gen-sdui-manifest-node.mjs` under the lock, then `gen-sdui-reference.mjs`; `check-doc-component-types.mjs` green. - `overlap-check --exclude-pr=36357`: clean against main and the six open PRs sharing files (objectstack-ai#36392, objectstack-ai#36380, objectstack-ai#36351, objectstack-ai#36343, objectstack-ai#36332, objectstack-ai#36316). - Earlier dogfood battery on 1c2a16b (superseded by the run on 4e94a27 above): `Test Files 484 passed | 3 skipped (487) · Tests 4107 passed | 68 skipped (4175)`. The one commit after it (579f99a) touches two docs snippets only. - `pnpm --dir ui check:doc-snippets` after a scoped build: 544 of 544 blocks judged, 0 failed (the Lint UI red on 1c2a16b was the new staged-model snippet missing its import, fixed in 579f99a). </details> <details><summary>Ablation (`scripts/ablation-replace.mjs`, restored to the HEAD blob, `git diff HEAD` empty)</summary> - `cellSelectionProp ?? inlineEditable` → `cellSelectionProp` (the base's behaviour): 3 failed of 6 — the object-view `table.editable` and named-view `inlineEdit` per-cell saves and the authored-node per-cell save; the three controls (read-only object-view, read-only node, host `false`) stay green. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jSHfkSrXZxbdWoQxnW)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jSHfkSrXZxbdWoQxnW <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jSHfkSrXZxbdWoQxnW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…enu, and a lane statistic (objectstack-ai#36411) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jRKaa4gJCNNF5QMd8t Fixes objectstack-ai#36370 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: carried by objectstack-ai#36422 Claim: 7076741092 ## 维护者速读 - 改了什么:看板视图的「视图设置」换成看板自己的一套——分列字段(只列单选/单选按钮字段)、显示哪几列(「5 / 7」,可拖动排序、可隐藏)、卡片上显示的字段(拖动排序、隐藏、「+ 添加字段」)、「显示字段名」「隐藏空字段」两个开关、列底统计(无 / 计数 / 数字字段求和);表格的「显示的列 / 分组 / 行高 / 行颜色」在看板上不再出现。每列表头加「+」(新建并预填该列的值,空列另有「+ 新建」行)和「⋯」(折叠这一列、隐藏这一列)。 - 规则:除折叠外,所有改动沿用 objectstack-ai#35955 的草稿规则——立即生效、出现「放弃 / 保存」、保存前不写任何东西;「保存到这个视图」「另存为我的视图」都带上看板设置。折叠只记在本浏览器,按「用户 : 对象 : 视图」分开(localStorage 键 `objectui:kanban-lanes-collapsed:<用户 id>:<对象>:<视图 id>`)。隐藏一列沿用 objectstack-ai#28211 `lanes` 的含义:这一列的卡片移到「未分类」,菜单和「显示哪几列」页都写明这一点。 - 协议:`KanbanConfig` 加三个可选键:`summary`(新的 `KanbanLaneSummary`,只收 `{type:'none'}` / `{type:'count'}` / `{type:'sum', field}`,`sum` 必须写字段;优先于 `summarizeField`)、`showFieldLabels`、`hideEmptyFields`(两者缺省为 true,即现在的卡片),均无 spec 默认值,旧视图不变;L2 看 schema 面。lint 检查 `kanban.summary.field`(字段名、以及求和字段的类型;是 / 否字段不能求和,和设置面板一致)。另修 Console 一直丢掉 `kanban.lanes` 的转发(objectstack-ai#28211),并让 Studio 预览(plugin-view)也转发三个新键(即 objectstack-ai#36426 要的转发,由座位关闭该卡)。 - 未做:列底求和现在只算已加载的卡片(列未加载完时写明「仅已加载的卡片」),整列求和、平均 / 最小 / 最大要等服务端按列聚合,另立 objectstack-ai#36520;查找 / 人员 / 主从 / 树形字段分列另立 objectstack-ai#36430(卡片验收里「换成商机负责人」这一条随它走,本 PR 用另一个单选字段「审批状态」验收);卡片底部图标开关另立 objectstack-ai#36423;新增列选项、卡片布局、Studio 设计器、手机看板不在本卡范围。 ## What changes **1. The board's own 视图设置 (`plugin-list`).** `ViewSettingsPopover` takes a `kanban` prop (`ViewSettingsKanban`); `ListView` builds it on a board, and the panel then draws, in place of the table's columns, Group, Row height and Row colour: | Row | What it writes | |---|---| | 分列字段 (lane field) | `groupByField`, from the object's `select` and `radio` fields, and drops `lanes` with it | | 显示哪几列 `5 / 7` | `lanes`: hide, show (at the end), drag to reorder, 「显示全部」; the last shown lane has no eye; `undefined` when the list is every option in its own order | | 卡片上显示的字段 | `columns`: drag, hide in place, 「+ 添加字段」 adds at the end | | 显示字段名 / 隐藏空字段 | `showFieldLabels` / `hideEmptyFields`: `false` when turned off, absent when on | | 列底统计 | `summary`: none, count, or the sum of a field the aggregate table's `sum` row accepts (a number or currency; no percent, formula or yes / no field); None over a view with `summarizeField` writes `{ type: 'none' }` | `ListView` gains `onKanbanChange(patch)` (`null` in a patch means the key leaves the block) and `laneCollapseKey`. The phone settings sheet shares `ViewSettingsContent`, so it shows the same board rows. `FieldList` gains `hiddenTitle` and `typeIcons` so the lanes list reads 「隐藏的列」, draws no field-type icon, and carries the line 「隐藏的列里的卡片会显示在「未分类」。」 **Lane fields left out.** A lookup, user, master-detail or tree field draws no sensible lanes yet: the board keys a lane on the stored value, and an expanded reference is an object (measured live: `[object Object]` lanes). A boolean has no options to title its lanes. So the picker offers `select` and `radio` only, and objectstack-ai#36430 carries the reference lanes. An authored lookup `groupByField` draws wrong today, independently of this PR. **Hiding a lane.** `lanes` keeps its objectstack-ai#28211 meaning: it picks lanes, not records, so the cards of a hidden lane show under 「未分类」. The 「⋯」 item reads 「隐藏这一列」 with 「这一列的卡片会移到「未分类」」 under it, and the lanes level says the same. **2. Lane header 「+」 and 「⋯」 (`plugin-kanban`).** `ObjectKanban` takes the host's `laneMenu` request (`KanbanLaneMenuRequest`: `collapseKey`, `onHideLane`, `onCreateInLane`), relayed to `KanbanImpl` over a package-private context (the `KanbanColumnSummary` pattern; never a node key). Without it no header draws either control. 「+」 reports its lane; an empty lane also gets a 「+ 新建」 row. 「⋯」 holds 折叠这一列 / 展开这一列 and 隐藏这一列; the `Uncategorized` lane offers collapse only. Collapse is kept per browser under `objectui:kanban-lanes-collapsed:<collapseKey>`, written only after a user toggle; `ListView` passes `<user id>:<object>:<view>`, the view named by the host's `laneCollapseKey` (the Console passes the view's id), else the schema's `id`, else `-`; a signed-out reader is `-`. A collapsed lane's heading opens it again, and an open lane keeps its bare title. `ListView` wires create as `onEdit({ [laneField]: value })`, the seeded-record create the calendar already uses (objectui#12291), and hide as unticking the lane (at least one lane stays). **3. The lane statistic and the card toggles (`plugin-kanban`).** `summary` draws at each lane's foot (`[data-kanban-lane-statistic]`, 「计数 2」, 「合计 · 金额 ¥40」) and replaces the `summarizeField` header total; `{ type: 'none' }` draws neither. `laneStatistic(cards, field, type)` counts or sums. `count` is the lane's own count, the server's where the board pages the lane, and a windowed count reads `+`. **`sum` totals the cards the lane has loaded, not every record of the lane**: a windowed lane's sum says so, 「合计 · 金额 · 仅已加载的卡片」 (`data-kanban-lane-statistic-partial`), rather than a `+` on a sum, and the `summary` docblock and `.describe()` say the same. **Why no push-down here:** the board has no lane aggregate read today, and adding one (one grouped `sum` over the view's filter, answering every lane) is the next stage. Per the maintainer's ruling of 13:52Z (「还没开工的不应该开工啊,分多个阶段的只做完当前阶段」) and seat 7's ruling on L2 S3, this PR ships the current stage only and objectstack-ai#36520 carries the server lane statistic: the whole-lane sum, then average, minimum and maximum. Those three are not admitted by the schema meanwhile: over the loaded cards of a windowed lane they would be wrong with no honest marker. `showFieldLabels: false` draws card values without their names (`KanbanCardDisplayContext`); `hideEmptyFields: false` keeps an empty field's line with a dash. Without the keys, boards draw as before. **4. The draft (`app-shell`).** The board's changes are a list-draft part: `ListDraft.kanban` holds only the changed keys (`nextKanbanDraft` drops a key changed back to the view's own as the board draws it, `kanbanViewOptions`, so an auto-detected lane field picked back is no change; `null` = removed). `objectViewListRenderer` lays it over the view's block (`layKanbanDraft`) and wires `onKanbanChange`; `ObjectView` hands it to 「保存到这个视图」 and 「另存为我的视图」 as `display.kanban`, and Discard drops it. On a board whose view declares no `kanban` block (or one without `groupByField`), the lane field is auto-detected, so the draft holds no lane; `kanbanDraftToSave` lays the lane the board draws under the draft, so a saved block carries the `groupByField` `KanbanConfigSchema` requires whenever the board draws one (a view naming no lane on an object with no detectable lifecycle field draws no lanes, and a save there is refused by the server as before) (found in the L2 of 7258985; red without the fix on both save paths, pinned). `ListDraftActions` lists the part as 「看板设置」. **5. In-surface fixes: both producers relay the board block.** `kanbanViewOptions` (Console) relayed the lane field, title, card fields and `summarizeField` but never `lanes`, so a Console board drew every option whatever the view declared (objectstack-ai#28211). It now relays `lanes` (a non-empty array) and the three new keys, each only when declared. `plugin-view`'s `ObjectView#generateViewSchema` (Studio preview, SDUI `object-view`) relays `summary`, `showFieldLabels` and `hideEmptyFields` the same way, so `summary: { type: 'none' }` hides the header total there too. This is the relay objectstack-ai#36426 asks for; objectstack-ai#36426 holds no claim naming this branch, so the seat closes it. **6. Lint (`@objectstack/lint`).** `validate-list-view-field-refs` walks `kanban.summary.field` as a field reference (`error`, the `columns[].summary.field` level: a stale name draws nothing, so the statistic the author asked for is gone without a word), and refuses, under `list-view-summary-field-type-refused` at `kanban.summary`, a `sum` over a field the aggregate table's `sum` row refuses **and over a `boolean` or `toggle` field**, which the table admits but the board does not add (the picker leaves them out the same way). `os explain` names the position. **7. Spec widening (`@objectstack/spec`).** `KanbanConfigSchema` gains `summary: KanbanLaneSummarySchema.optional()`, `showFieldLabels: z.boolean().optional()`, `hideEmptyFields: z.boolean().optional()`, no defaults. `KanbanLaneSummarySchema` is a discriminated union of `none`, `count` and `sum` with a required non-empty `field` (exports `KanbanLaneSummary` and `KanbanLaneSummaryParsed`). Regenerated: `authorable-surface/ui.json`, `api-surface`, `export-origins`, the strictness ledger, `content/docs/references/{ui/view,api/protocol,data/object,index}.mdx`. `variant-docs.json` gains the union's row (`generated-reference-only`; the teaching is objectstack-ai#36422). Liveness: the `kanban` row of `liveness/view.json` names each key's read points on both producers. ## Seat rulings this PR follows Both from seat 7 (`domain:objectstack` seat 7, thread session `session_01QsR2jTeURPvEm465RcoYEC`), in the objectstack-ai#36370 card thread at 2026-11-22T11:19Z, answering this PR's two questions: - **A (lane fields):** 「the lane-field picker offers only option-backed fields (select and radio, plus boolean only if it draws sensibly). Say in the body that lookup, user, master_detail and tree lanes are out, and I will file a card for them: distinct-value lanes, FK bucketing, FK lane queries and FK writes on drag. Also say that an authored lookup groupByField draws wrong today, independent of this PR.」 The card is objectstack-ai#36430 (seat 7, 11:24Z). The card's acceptance line 「把分列字段换成『商机负责人』」 names a user field, so it moves to objectstack-ai#36430; the live run below switches to the other select field, 审批状态. - **B (hiding a lane):** 「keep objectstack-ai#28211's meaning of lanes in this PR, because changing a published key's meaning is the maintainer's call. In the body, say plainly that hiding a lane moves its cards into 未分类, and use a menu label and help line that tell the truth about it.」 Also followed: seat 7 on L2 S3 (2026-11-22T16:41Z): carrier, no push-down in this PR, current stage only; objectstack-ai#36520 filed. ## Left out (stated) - **The whole-lane sum, and average, minimum, maximum lane statistics**: wait for a server lane read, objectstack-ai#36520 (above). - **Lookup, user, master-detail and tree lane fields**: objectstack-ai#36430. - **Card footer icons toggle**: no per-board data (no per-card comment or attachment count, no stage-entered timestamp). objectstack-ai#36423. ## Tests - `plugin-kanban/src/ObjectKanban.laneMenu-36370.test.tsx` (4): no controls without `laneMenu`; 「+」 and the empty-lane row report their lane, an open lane's heading is no disclosure; 「Hide column」 reports its lane, `Uncategorized` offers collapse only; collapse persists under the host key, reopens from the heading, another key is unaffected. - `plugin-kanban/src/ObjectKanban.laneStatistic-36370.test.tsx` (7): count, sum (in place of the header total), none (also over `summarizeField`), a partial sum worded as the loaded cards' with its CONTROL, the two toggles and their defaults; `laneStatistic` units. - `plugin-list/src/__tests__/ViewSettingsPopover.kanban-36370.test.tsx` (6) and `ListView.kanbanSettings-36370.test.tsx` (3): the board rows and none of the table's; the lane field picker offers select and radio only; the statistic offers number and currency sums and no percent, formula or boolean; lanes hide/show/keep-last with the 「Hidden columns」 heading and no type icon; card fields hide/add; toggles and statistic writes; the collapse key per reader, object and view; the zh pack names every row. - `plugin-view/src/__tests__/ObjectView.harness.test.tsx` (+1): the three keys reach the generated board node when declared, none when not. - `app-shell/src/views/kanbanDraft-36370.test.ts` (7) and `ObjectView.kanbanSaveAs-36370.test.tsx` (3; the first red without the save-as fix, the other two red without `kanbanDraftToSave`: 「另存为我的视图」 and 「保存到这个视图」 on a board with no `kanban` block store `groupByField`): the draft keeps changed keys only; lay with `null`; Save lays the draft into a body `ListViewSchema` accepts; 「另存为我的视图」 on a package board writes nothing before Save and stores the board's changes; the `kanbanViewOptions` relay and its omissions. - `packages/spec/src/ui/kanban-config-lane-summary.test.ts` (4) and `packages/lint` (+5 cases): the schema takes none, count and a field's sum and refuses avg/min/max, a fieldless sum and a stray key; lint's stale-field row, the sum-type verdict, and a sum over a `boolean` and a `toggle` refused at `kanban.summary`. - After the L2 of 7258985 (this head): `@objectstack/lint` `validate-list-view-field-refs.test.ts` 199 / 199; the 32 app-shell files naming kanban, the draft, personal views, save-as, shared-view save, the footer calculation draft, the stored row or view options, 269 / 269; `@objectstack/spec` `src/ui` 185 / 6568; `check:generated` all 14 up to date; eslint on the moved files 0 errors. - Suites on the earlier head: `plugin-kanban` 83 files / 546 tests, `plugin-list` 186 / 2027, `plugin-view` 66 / 730, `@object-ui/i18n` 106 / 1978, `@objectstack/lint` 225 / 9431, `@objectstack/spec` 964 / 29475, and the app-shell test files naming kanban, the list draft, personal views or the relay; type-check of `plugin-kanban`, `plugin-list`, `plugin-view`, `i18n`, `app-shell` and `lint` exit 0. `dispatch-gates --ran`: 121 derived, 121 run, 0 NOT MEASURED. `overlap-check`: merges cleanly with main; objectstack-ai#36435, objectstack-ai#36437 and objectstack-ai#36316 meet it only on generated counts and the de quote-pair pin, which the second to land regenerates. ## Verification (live) **Head `9f8726f1ec` is a merge of `main` (`65ce7983`) on top of `16a019dc05`, with no code change.** It resolves the de quote-pair pin to 127 (main's 125 plus this PR's two spans) and regenerates the deferred references and `authorable-surface/ui.json`. The test and live readings below stand from `16a019dc05`. On the merged tree, `ObjectView.kanbanSaveAs-36370`, `kanbanDraft-36370`, plugin-view `ObjectView.harness` and `de-quote-pairing-3876` were rerun (4 files, 139 tests, all green), `check:generated` reports all 14 artifacts up to date, and `overlap-check` is clean. **Head `dd9e0bb782` is a second merge of `main` (`84853fd1`), with no code change.** It clears the runner-shutdown cancel on `9f8726f1`'s Type Check · workspace. The merge was textually clean. `view.mdx` and `object.mdx` were regenerated, and `check:generated` is clean. On the merged tree, vitest over `i18n`, `plugin-kanban`, `ObjectView.kanbanSaveAs-36370` and `objectViewOptions` passed (190 files, 2527 tests). `overlap-check` is clean against main and open PRs. Local backend (`objectstack dev --seed-admin --fresh`) and the Console in zh (CNY), signed in as the seeded administrator, at the code of 16a019d. Two boards: the CRM example's pipeline (a view the read-only CRM package ships) and a **self-built app** made through the administrator's own doors (`POST /api/v1/packages` for package `com.qa.board36370`, then `PUT /api/v1/meta/object/qab_task`, `PUT /api/v1/meta/view/qab_task.board` and `PUT /api/v1/meta/app/qab_app` into it, five records by `POST /api/v1/data/qab_task`; lane field 阶段 = 待办 / 进行中 / 评审 / 完成, card fields 名称 / 工时 / 备注, 备注 empty on three cards). **Screenshots are not inline.** GitHub has no API that uploads an image into a PR body (the `user-attachments` upload is the browser's only), and AGENTS.md's 「Delete temporary artifacts — screenshots…」 rule keeps them out of the branch. They are in the project folder `issue-36370/` under the names given below; the seat weighs this against the card's 「PR 正文附视图设置和列菜单的截图」. Writes are read off the browser's network log. The only writes not listed are the reader's recent-items rows (`sys_user_preference`, written when a page opens, before any change). CRM pipeline (first run): - 视图设置 shows 分列字段 阶段, 显示哪几列 5 / 5, the card fields, both toggles and 列底统计; no 显示的列, 分组, 行高 or 行颜色. The lane field picker offers 阶段 and 审批状态 (both select). The statistic offers 无, 计数, 合计 · 金额 and 合计 · 产品合计. (`settings.png`, `settings-lane-field.png`, `settings-summary.png`) - On the package view: hiding 输单, turning 显示字段名 off and picking 计数 apply at once (4 lanes plus 未分类, no `dt`, 计数 1 / 2 / 1 / 7 / 1) with **no write**; 放弃 restores every lane, label and the header total with no write. Save offers 另存为我的视图 alone. (`settings-lanes.png`, `board-sum-nolabels.png`) - 另存为我的视图: one `POST sys_personal_view`; the new view opens with the changes and keeps them after a reload. **This run found the path dropped the board part**; fixed in `ObjectView#handleSaveAsMyView` and pinned. (`board-saved-reload.png`) - On that own view: 合计 · 金额 at each foot; 保存到这个视图 writes one `PATCH sys_personal_view`, kept after a reload. (`save-menu-own.png`) - 「⋯」 on 需求确认 offers 折叠这一列 and 隐藏这一列 with its 未分类 line; collapse is stored under `objectui:kanban-lanes-collapsed:<user id>:crm_opportunity:<view id>` and holds after a reload. (`lane-menu.png`, `board-collapsed.png`) - 「+」 on 方案报价 opens 新建商机 with 阶段 = 方案报价. (`lane-create.png`) - **This run also found the statistic offering a sum of the two percent fields**; the picker now asks the aggregate table's `sum` row, as lint does. CRM pipeline (supplement for the acceptance lines the first run did not walk): - **Lane field swap, then 放弃.** 分列字段 → 审批状态: the board re-lanes at once to 待审批 / 已批准 / 已驳回 / 已撤回 / 未分类 (all 12 opportunities in 未分类, none has an approval status), 放弃 / 保存 appear, **no write**. 放弃: back to 初步接洽 / 需求确认 / 方案报价 / 赢单 / 输单, the bar gone, no write. (`sup-lane-field-picker.png`, `sup-relane-approval.png`) The card's line names 商机负责人, a user field, which ruling A moves to objectstack-ai#36430. - **Drag a lane to the front.** In 显示哪几列, dragging 方案报价 onto the first row (a mouse drag) orders the list 方案报价 / 初步接洽 / 需求确认 / 赢单 / 输单 and the board follows in that order, with 放弃 / 保存 and no write. (`sup-lanes-order.png`, `sup-board-reordered.png`) The pipeline has no 谈判 stage, so the lane is 方案报价. - **隐藏空字段.** With 审批状态 added as a card field (empty on every card): 隐藏空字段 on, 36 field rows and no dash; turned off, 48 rows, the 12 new ones each 「—」; no write. (`sup-hide-empty-on.png`, `sup-hide-empty-off.png`) - **Another browser.** With 需求确认 collapsed in one browser, a second browser context signed in as the same reader (its own local storage) draws 需求确认 open with its two cards and holds no collapse key. (`sup-other-browser.png`) Self-built app (`com.qa.board36370`), administrator: - The board draws 待办 / 进行中 / 评审 / 完成 with 7 field rows (empty 备注 takes none). 视图设置 shows the same board rows; the statistic offers 无 / 计数 / 合计 · 工时. (`self-board.png`, `self-settings.png`) - 合计 · 工时 picked and 隐藏空字段 turned off: 10 rows, three 「—」, feet 合计 · 工时 8 / 8 / 2 / 1. 隐藏空字段 back on and 评审 dragged to the front: 7 rows, lanes 评审 / 待办 / 进行中 / 完成, feet follow. No write. (`self-empty-off.png`, `self-changed.png`) - **保存到这个视图 as an administrator**: Save offers 保存到这个视图 and 另存为我的视图; the confirmation reads 「保存到这个视图?所有用「任务看板」的人都会看到这些改动。」; confirming writes `PUT /api/v1/meta/view/qab_task.board?mode=draft` with `kanban: { groupByField: 'phase', columns: [...], summary: { type: 'sum', field: 'hours' }, lanes: ['review','todo','doing','done'] }` (no `hideEmptyFields`: it was turned back to the view's own) and `POST …/publish`. After a reload the board draws 评审 first with the 合计 · 工时 feet and no draft bar. (`self-save-menu.png`, `self-save-confirm.png`, `self-after-reload.png`) NOT MEASURED live: the partial-sum wording (no lane here holds more than it loaded; pinned in the unit test), and the Studio preview relay (pinned in plugin-view). The board with no `kanban` block was measured in tests only (both save paths), not live. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jRKaa4gJCNNF5QMd8t --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
repo:objectstack#7 · zhuangjianguo · session_01QsR2jVTYADzVWfarACx5j3
Fixes #35928
Clause-②: yes (widening: one new public read,
POST /api/v1/automation/_record-starts, and the UI exports that read it)Metadata-protocol: added
Skills-docs: none — no skill under
skills/**teaches the console's stage confirms;content/docs/automation/flows.mdxandcontent/docs/frontend/plugins/plugin-grid.mdxdocument the read and the list in this change.Ruling-ref: 7073655354
维护者速读
What changes
Server (one new read).
@objectstack/spec/api:RecordUpdateStartsRequestSchema({ object, recordId, changes }, strict),RecordUpdateStartSchema({ name, label, startsApproval }),RecordUpdateStartsResponseSchema, and the contract entrylistRecordUpdateStarts(POST /api/v1/automation/_record-starts)._record-startsjoins the/automationdomain's reserved position literals (underscore-led, so the package-namespace install gate is not narrowed).@objectstack/spec/contracts:RecordUpdateStartsInputand the optionalIAutomationService.listRecordUpdateStarts.@objectstack/spec/automation:recordChangeTriggerHookEvents/recordChangeTriggerFiresOnUpdate, the record-change token grammar MOVED out of@objectstack/trigger-record-change(whosetriggerTypeToHookEventsnow delegates to it), so the trigger and the preview read one rule.@objectstack/service-automation:AutomationEngine.listRecordUpdateStarts(record-update-starts.ts). A flow is asked only when it is enabled and armed on arecord_changetrigger for this object whose token binds an update; whether it starts isstartConditionHolds, the one start-condition gate every run attempt passes, over the variablesseedRunVariablesseeds (record, its flattened fields,previous). The approval mark is the presence of anAPPROVAL_NODE_TYPEnode (ADR-0019). A condition that throws is not listed. Hooks are never listed (ADR-0077 §2).@objectstack/runtime: the/automationdomain's_record-startsdoor, mounted in the dispatcher plugin and recorded in the route ledger. Order: query parameters refused400 VALIDATION_ERROR; body parsed through the request schema (400 VALIDATION_FAILED);501when the engine has no preview; the record read AS THE CALLER through the/datadoor's ownget(callData), so an unreadable record answers404 RECORD_NOT_FOUNDexactly like an absent one and the engine is never asked; a read that answers no record is refused the same404; everychangeskey must be a declared field of the object (else400 VALIDATION_FAILEDonchanges.KEY, the engine never asked); then the engine is handedprevious= the record read,record= that record withchangesapplied, and the caller'suserId/tenantId. Anonymous401.@objectstack/client:client.automation.listRecordUpdateStarts(request).UI (two confirms, one reader).
@object-ui/plugin-detail:stageChangeStarts.tsx—useRecordUpdateStarts(ask)(asks the route once per pending move through the host'sapiFetch, parses the answer throughRecordUpdateStartsResponseSchema, answers[]while in flight, refused, failing, malformed or empty) andStageChangeStarts(the list under the sentence: each flow by its label translated throughactiveFlowsBundle+ the spec'stranslateFlow, the flow runner's reading; an approval flow marked). Exported for the grid.recordPathStageChange.tsxdraws it in both confirmations (the path'sAlertDialogand the header stage menu'sRequiredFieldsDialog, via a new optionalnoticeslot in@object-ui/fields).ObjectGrid's state-machine confirm draws it;StateChangeConfirmgains an optionalask(the row's record id and the move).@object-ui/i18n:activeFlowsBundlemoves here from@object-ui/app-shell's module-internalutils/flowsBundle(its three app-shell importers repointed), since the confirms' packages do not depend on the console; two keys in all eleven packs:detail.stageChangeStartsHeading,detail.stageChangeStartsApproval.Docs:
content/docs/automation/flows.mdx(§ Which flows a record update would start),content/docs/frontend/plugins/plugin-grid.mdx(the confirm now names the flows). Changesets:35928-record-update-starts-read.md,35928-stage-confirm-names-flows.md, both carrying the Clause-② and Metadata-protocol lines.Tests
record-update-starts.test.ts(8): condition holds / does not hold; approval mark CONTROL (an approval flow and a plain flow side by side); no condition; create / delete / other object / obsolete never named whilerecord-before-writeis; an unevaluable condition not named; an unarmed engine answers nothing;current_userevaluated as the writer named.automation-record-update-starts.test.ts(13): a member is answered (body parsed through the response schema) and the engine is handed exactly the record read as the caller; empty list; unreadable record404 RECORD_NOT_FOUNDwith the engine never asked; unreadable and absent answer alike; anonymous401before any read; malformed body400 VALIDATION_FAILED; query parameter400 VALIDATION_ERROR;501without the preview; a GET of the literal is not this door.; a change key that is not a field400 VALIDATION_FAILEDon that key (an undeclared key, a key off the field-name grammar, an inherited member name), the engine never asked; a change on an object the registry does not declare refused alike; a read that answers no record404 RECORD_NOT_FOUND, never previewed; and the ledger row namesRecordUpdateStartsRequestSchema/RecordUpdateStartsResponseSchema, as the clone and publish-drafts suites pin theirs.automation-api.zod.test.ts: contract count and the new entry's method/path; request strictness; a leakedcondition/nodesdropped by the response parse. Eachchangeskey is held to the field-name grammar (refused: a dotted, an upper-case, a digit-initial, a spaced and an empty key).ObjectGrid.autosave-35685.test.tsx(new top-level describe, 3): list (request body pinned, labels, approval mark under the unchanged sentence), empty, failure (and Change still saves the move).record-path.stageChange-28199.test.tsx(the path's confirmation) andRecordStageMenu-35891.test.tsx(the header stage menu's dialog): list, empty, failure (a refused read, a network error and a malformed envelope each draw no list).stageChangeStarts-label-35928.test.tsx(2): a flow named by its translation where the app'sflowsbundle has one, by its authored label where not; nothing drawn for no flows.git diff HEADon both sources empty): removing theStageChangeStartsrender fromObjectGrid.tsxand from both confirmations inrecordPathStageChange.tsxturns exactly the threelist:pins red (Tests 3 failed | 6 passed); empty and failure pins stay green, as they should.Acceptance notes
flows.mdx: the preview binds the caller's user id and tenant only, not their positions, request params or expand as a live run does, so for a condition reading those the preview can differ from the save in either direction (it can miss a flow, or list one a negated test of the writer would stop); the seat files the follow-up for positions.flows.mdx.changes.RecordStageMenu-35891,record-path.stageChange-28199) now stubfetchwith a501answer inbeforeEach, so the new read does not leave for the network under test; no existing assertion changed. Across the touched UI packages the run shows 0ECONNREFUSED.showcase_project_closurereaches its sign-off approval through asubflownode (the approval node lives inshowcase_closure_signoff), so the preview lists it withstartsApproval: false. Following subflow references for the mark is a reading beyond the ruling: filed Stage-change confirm: a flow that reaches an approval through a subflow is listed without the approval mark #36322.overlap-check.mjsat the head below, exit 1, reported and not merged around): fix(plugin-detail): after a 409, the stage menu asks what the re-read record needs #36296 and feat(spec): an object extension places the fields, groups and child lists it brings (place) #36236 have landed and are merged in. fix(components): the docs flow embed names the flow and its approval steps in the reader's language #36335 (part of Doc metadata embed: atype: flowblock draws its title and steps in the authored language — the viewer does not read the package's flows translations, and a decision or notify step has no key #35979) movesactiveFlowsBundleinto@object-ui/i18ntoo and conflicts inui/packages/i18n/src/flowsBundle.ts,ui/packages/i18n/src/index.tsandui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx; it lands after this PR and drops its copy of the move. Every other open PR that shares a file merges cleanly.Metadata-protocol: none, but the three new@objectstack/spec/apischemas enter theapiauthorable-surface shard (10 keys), whichCheck Changesetreads asadded(none-baseline-moved). The line isaddedand@objectstack/specis gradedminor, as feat(spec): a batch dataset-query request and answer beside the single dataset door, each query answered or refused on its own #32251, feat(messaging): Slack DM delivery — slack channel, per-person link store, approval requests by DM (Part of #34730) #35789 and feat(app-shell): a row-table page block lists the rows a page api binding answers #31883 were for new api request/response schemas. No flow or other metadata key is added, so the ruling's "no new authorable key" still holds.Verification
Read first:
packages/runtime/src/domains/automation.tsrespondToRecordUpdateStarts(the order of refusals and the caller-scoped read that admits the engine), thenpackages/services/service-automation/src/record-update-starts.ts(which flows are asked and the one gate they pass).Live, on a fresh showcase (
pnpm dev -- --fresh), as a member created by the admin (role: user, not an admin):Website Relaunchstatus: active → completed:200 {"flows":[{"name":"showcase_project_closure","label":"Project Closure with Sign-off (nested pause)","startsApproval":false}]}→ on_hold(CONTROL):200 {"flows":[]}budget 150000 → 250000:200 {"flows":[{"name":"showcase_budget_approval","label":"Project Budget Approval","startsApproval":true}]}404 RECORD_NOT_FOUND; anonymous:401 UNAUTHENTICATED; a body withoutchanges:400 VALIDATION_FAILEDnamingchanges.GET /api/v1/meta/flow(200, 33 flows with labels, the admin's set) andGET /api/v1/meta/flow/showcase_closure_signoff(200, its nodes).Local, all under
scripts/pm/os-verify-lock.sh(shared box):plugin-detail,plugin-grid,fields,i18n):Test Files 1131 passed | 2 skipped·Tests 13186 passed | 38 skipped; after folding the pins into their harness files the three files plus the label file:Tests 77 passed (77).tsc --noEmit(src and test projects) fori18n,fields,plugin-detail,plugin-grid, and src forapp-shell;service-automation,runtime,clientexit 0.route-ledger.conformance+automation-api-contract-mounts+http-dispatchergreen, client conformance 11, specautomation-api.zod+address-grammar87,trigger-record-change122.dispatch-gates.mjs --commands(129 families) run and reconciled with--ran:129 run, 0 NOT-MEASURED. First pass reds were all this diff's own owed artefacts, fixed and re-run green: specgen:api-surface/gen:docs/gen:export-origins/gen:declaration-map/gen:strictness-ledger(api count 533 → 536: the three new schemas), the route-ledger census sentence (149 → 150), andcheck:test-source-alias(a spec/automation alias in the trigger package's vitest config; the door test pays@objectstack/metadataat collection).Re-verified after the hand-over (seat 7), main
b3bcfefcmerged in at472457d9, the generated surfaces regenerated at6bd111ff(gen:schema→ spec build →gen:api-surface→gen:export-origins→gen:declaration-map→gen:docs→gen:strictness-ledger;check-regen-pendingclear), the changeset correction at99bfd857. Under the verify lock at6bd111ff:@object-ui/i18n,fields,plugin-detail(src and test; the hand-over's stale-dist red is gone after the closure build),plugin-grid,app-shell;@objectstack/spec,runtime(src and test layer, after building@objectstack/driver-turso),service-automation,client,trigger-record-change.runtimeTests 11745 passed | 25 skipped;service-automation4224 passed;client820 passed;trigger-record-change122 passed; specautomation-api.zod+address-grammar87 passed;plugin-detail+plugin-grid+fields+i18nTest Files 1135 passed | 2 skipped, Tests 13300 passed | 38 skipped.dispatch-gates.mjs --commands(129 families): run at99bfd857(the six that started before that commit re-run on it) and reconciled with--ran:129 derived, 128 run, 1 NOT-MEASURED, 0 UNRUN. The one NOT-MEASURED ischeck:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: it needs every package's dist, which this container does not build); CI runs it in its Lint jobs, green at this head.CI at
99bfd857: every check-run green or skipped by design. Check Changeset shows two runs: thesynchronizerun (09:07Z, before the body saidadded) red, theeditedrun (09:08Z) green.Contract review rework (L2 at
99bfd857), at3ba211dcandd2279e6c(head):flows.mdx;_record-startsjoins the address module's literal list.ablation-replace.mjs, restored by trap, blob == HEAD andgit diff HEADempty after each): the declared-field refusal disabled →Tests 2 failed | 11 passed(the two refusal pins); the no-record refusal disabled →Tests 1 failed | 12 passed(its pin).runtimeTest Files 637 passed, Tests 11749 passed | 25 skipped; door suite 13/13 at the head; specautomation-api.zod+address-grammar88 passed; type-check exit 0 forspec,runtime(src and test layer, atd2279e6c),service-automation,client,plugin-detail.dispatch-gates.mjs --commandsat3ba211dc:129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN; the 37 families that read test files re-run atd2279e6c(a one-line test-type fix), all exit 0.d2279e6c: 70 check-runs, 61 success and 9 skipped by design, Check Changeset green.Delta round (L1-d 7078831268, L2 nit N3 from 7078841748), at
41487226(head): the 401 and 501 pins assertbody.error.code(UNAUTHENTICATED,NOT_IMPLEMENTED) beside the status; the spec changeset names the undeclared-change-key400 VALIDATION_FAILEDand the no-record404among the door's refusals; the caller-binding limit reads "can differ from the save in either direction" in the request schema's docblock,RecordUpdateStartsInputandflows.mdx. Door suite 13/13; type-check exit 0 forspecandruntime(src and test layer);dispatch-gates.mjs --commandsat41487226:129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN; CI at41487226: 70 check-runs, 61 success and 9 skipped by design.https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF
https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3
🤖 Generated with Claude Code