Skip to content

feat(console): a footer calculation is a part of the list draft; a package view's refused save says why in the reader's words - #36212

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-8r2qm4
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-8r2qm4

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgX7ez5A7JDsmzTy9Ks

Fixes #36194
Fixes #36195

Clause-②: yes (widening) — two new keys in every @object-ui/i18n locale pack (console.objectView.personalizedParts.summaries, console.objectView.saveRefused.packaged); zh-Hant regenerated; nothing removed or renamed. ListView / ObjectGrid props unchanged (doc comments only).
Metadata-protocol: none

维护者速读

  • 列表底部选、换、去掉一列的统计:马上显示结果,不再写进视图或个人视图;和筛选排序一样算草稿,出现「放弃」「保存」,「保存」菜单的未保存列表多一项「统计」。「放弃」还原;「保存到这个视图」(自己的视图)和「另存为我的视图」把统计一起存进去。
  • 包里带的视图(比如 HotCRM「全部客户」)、没有权限改的共享视图:照样能选统计,进草稿,「保存」里只有「另存为我的视图」。任何时候都不会再出现卡上那段英文报错。
  • 服务端拒绝保存包里带的视图时,提示改成一句中文(11 种语言都有):「这个视图来自应用包,不能直接修改,可以另存为我的视图。」其它拒绝照旧显示服务端那句话(那些是写给人看的,已有测试钉着)。
  • 卡上那段报错的来历:包可写的判断要等包列表读回来,列表为了不和页面抢网络,要等页面请求安静下来(最多 8 秒)才读;这之前判断按设计放行,底部入口就直接写了视图。统计改成草稿后,这段时间里底部不再写任何东西。

What changes

A footer calculation is a draft part (objectViewListRenderer.tsx, listDraftStore.ts, columnSummaryWrite.ts, ObjectView.tsx)

  • ListDraft gains summaries (column → calculation, null = None over a column the view sums); an emptied part is no part. It lives exactly as the other parts (在列表上的改动都改成临时的(排序、筛选、分组、列的显示和顺序):立即生效但不保存,出现「放弃」和「保存」;列宽、行高、标签页顺序只记在浏览器里;退掉服务端的个人列表偏好 #35955 item 4: kept on a record round trip, dropped on another view or object and on a reload).
  • The renderer lays the draft's calculations over the columns it hands ListView (columnsWithSummaries), so the grid draws them at once, and onColumnSummaryPick only patches the draft and answers true. A pick equal to the column's own calculation (columnSummaryOf) drops the column from the draft.
  • The menu is offered (columnSummaryPickFields) on the columns the list draws, the reader's added fields included: the columns a saved body carries. Where the list holds no draft (an environment list, no open view) nothing is offered (listViewActions.draftsSummaries).
  • Removed: handlePickPersonalViewSummary (wrote the reader's own view at once) and handlePickSharedViewSummary (wrote the shared view's draft, PUT /meta/view/<name>?mode=draft). No footer pick writes anything now.
  • The Save menu's unsaved list names it: host-side part summaries (ListDraftActions' ListPersonalizationPart gains it; ListView's own vocabulary is untouched), pushed in objectViewListUrlState.ts like columns.
  • Saves carry it: PersonalViewListState.summaries, laid by buildPersonalViewConfig on the columns it keeps (after added fields, order and hidden columns). Callers: Save to this view (own view), Save as my view, the switcher's create card with "include current".

A view the reader cannot change in place — the same "can save in place" reading as the filter and the Save menu, no second rule: the Save menu offers Save to this view on the reader's own view only (on main), so a package's view and a non-admin's shared view get Save as my view alone. With #36123 merged in, its shared-view Save to this view keeps its own test (canSaveToSharedView, now waiting for the package list: small call 5) and stores the calculations too.

A refused save of a package's view (viewSaveRefusal.ts, objectViewViewCrud.tsx, ObjectView.tsx)

  • viewSaveRefusalText(err, t): code === 'NOT_OVERRIDABLE' (the door's close on an item a package ships, protocol-packaged-base-refusal.ts) → console.objectView.saveRefused.packaged; anything else → formatMetadataError as before. Used at every view-write toast on the object page except delete (view settings save, create, rename, pin, set default, personal create / save / save as).

Docs: content/docs/ui/views.mdx § "A user's list state never writes the view". Changeset 36194-footer-calculation-draft.md.

Small calls made in this thread (Sales 22:19:27Z rule; seat agreed 22:51Z)

  1. The menu is offered on every column the list draws, not only the ones the view declares: the draft can carry a calculation on any column the saved body keeps (列表底部计算行:常驻一行,用户点列底下的格子选计算(合计、平均、计数等),存到视图上 #35702's declared-only limit existed because the pick wrote the view).
  2. A reader who is no admin gets the menu on a shared view too (their pick is their draft; Save as my view keeps it). The card's "no entry for a reader without permission" acceptance line predates the fold; the brief settles it as "into the draft, Save as my view alone".
  3. Only NOT_OVERRIDABLE is reworded. Other refusals (403 permission, 422 field issues, pin / default / rename) keep the door's message, which objectui#11583 / feat(spec): retire contributes.routes (ruled Option B) and redirect its last two teaching sites to the http.server mount #12417 pin as worded for the person saving.
  4. The switcher's create card carries the calculations only with "include current", as it does the filter and sort.
  5. Done after feat(console): Save to this view on a shared view asks once, then saves and publishes it; layout and row colour join the list draft (#35955 PR 2) #36123 merged: its 「保存到这个视图」 on a shared view stays hidden while the package list is unread, and for a package listed read-only (usePackageSaveRead: the same session-held read as usePackageRefusesSaves, with the in-flight state told apart; a failed read or an unlisted package still offers it, as today). Reason measured below: the unread window is where the card's error came from.

Root cause of the card's error (measured, client-side)

HotCRM 6.5.0 on main (fa304140), console from this tree's ui/ against it: the server's package list reports app.objectstack.hotcrm writable: false, and crm_account.all_accounts's row carries _packageId: app.objectstack.hotcrm. The reading is right once read; but fetchSessionPackages waits for the page's own requests to go quiet (up to 8 s) before it reads, and until then usePackageRefusesSaves fails open by design. Measured at 1440: the list drew with 「+ 添加统计」 at 7.2 s, the package list answered at 8.0 s, and the entry went. A pick inside that window sent the PUT ?mode=draft the card shows. With this PR the pick writes nothing in any window.

Tests

  • ObjectView.footerCalculationDraft-36194.test.tsx (7, renamed from ObjectView.readOnlyPackageView-35933.test.tsx; real ObjectView, ListView stand-in that draws the condition row's end, every non-GET fetch recorded): a pick is drawn, writes nothing, Save names it, picking None again drops it; Discard takes it off; the reader's own view stores it only on Save to this view; a view that declares no columns gets the menu on the drawn columns and Save as my view stores it; a package's view: drawn, no write, Save offers Save as my view alone, which stores it; the package list unread: still a draft; a non-admin on a shared view: a draft, Save as my view alone.
  • __tests__/footerCalculationDraft-36194.test.ts (9): columnsWithSummaries / columnSummaryOf; the draft store's empty part; buildPersonalViewConfig stores calculations on kept columns (added kept, hidden dropped) in a body ListViewSchema accepts; viewSaveRefusalText (package refusal reworded, a 403 keeps the door's words, issues keep the list).
  • AppContent.draftSaveKeepsList-35932.test.tsx (8, adapted): the pick no longer writes, so the refresh pulse a draft save announces is announced by the test (emitMetadataRefresh); no skeleton, no remount, picks drawn through it; a reader's pick is offered (their draft).

Verification

Local at head (claude/project-thread-8r2qm4):

  • pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView packages/app-shell/src/views/__tests__ packages/app-shell/src/views/ListDraftActions packages/app-shell/src/views/personalViews packages/app-shell/src/console/__tests__/AppContent packages/i18n packages/plugin-list/src packages/plugin-grid/src/__tests__ → 797 files, 8404 passed / 13 skipped; the 7 failures of that run were the first version of the refusal helper (it also reworded every 403) and a stale zh-Hant; both fixed, and the three files re-run green (ObjectView.viewWriteRefusal-11583, ObjectView.createViewRefusal-11578, packages/i18n 106 files).
  • @object-ui/app-shell type-check (both tsc --noEmit and tsconfig.test.json): exit 0.
  • eslint on every changed file: 0 errors.
  • The whole app-shell package is left to CI's shards.

Since the first L1-b read (ef54913f → efa7c4f0)

Evidence (HotCRM 6.5.0, 1440×900, /mnt/project-files/build-seat1/36194-36195/)

  • Before: before-1440-{light,dark}-hotcrm-pick-refused.png — 「全部客户」, the package list held 15 s to show the window, a 「去重」 pick: PUT …/crm_account.all_accounts?mode=draft, the English refusal toast.
  • After (same hold): after-1440-{light,dark}-hotcrm-pick-in-draft.png (「去重 9」 drawn, 「放弃」「保存」, no write), after-1440-{light,dark}-hotcrm-save-menu.png (「未保存的改动: 统计」, 「另存为我的视图」 alone), after-1440-light-hotcrm-discarded.png, after-1440-light-saved-as-my-view.png (「全部客户 副本」 keeps 「去重 9」), after-1440-light-my-view-save-menu.png (own view: 「保存到这个视图」 offered), after-1440-light-my-view-after-reload.png (saved 「非空 9」 survives a reload; the only write of the run: PATCH /api/v1/data/sys_personal_view/<id>).

Overlap

overlap-check.mjs @ efa7c4f0: merges cleanly with main (af2361ee, #36123 and #36128 in); textual conflict with #36133 only (listDraftStore.ts, objectViewListRenderer.tsx).

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgX7ez5A7JDsmzTy9Ks

Picking, changing or removing a column's footer calculation applies at
once and writes nothing: it joins the list's draft (Discard / Save, one
line in Save's unsaved list) and Save to this view / Save as my view
store it on the columns the saved body keeps. A view the reader cannot
change in place offers Save as my view alone, so no pick reaches the
door that refuses a package's view. That refusal (NOT_OVERRIDABLE) is
said in the reader's words in every locale instead of the door's text.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX7ez5A7JDsmzTy9Ks
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — ACCEPT, first read (L1-b)

Head-sha: ef54913f248f9f8ab2b24114b95c80dcf27a001a · merge-base with main fa304140 · 28 files +738/−376 · read 2026-11-21T23:26Z

维护者速读

  • 列表底部选统计(「+ 添加统计」)现在和排序、筛选一样只是草稿:马上显示,不写服务器;出现「放弃 / 保存」,保存菜单的未保存列表多一项「统计」。「保存到这个视图」(自己的视图)和「另存为我的视图」会把统计一起存进去。
  • 包里带的视图、没权限改的共享视图:也能选统计,进草稿,「保存」里只有「另存为我的视图」。卡上那段英文报错不会再出现;服务器拒绝保存包里视图时,提示改成 11 种语言的一句话,其它拒绝照旧。
  • 代码第一遍看下来没有必须改的问题。这个 PR 要等 feat(console): Save to this view on a shared view asks once, then saves and publishes it; layout and row colour join the list draft (#35955 PR 2) #36123 合并后再合 main、把统计接进「保存到这个视图(共享视图)」并在包列表没读回前先隐藏那个入口,那一版我再看一次。CI 在这个提交上还没有跑起来。

Must-fix

None.

Should-fix

None.

Nits (ride or drop, seat's call)

Checked

Owed

…-8r2qm4

# Conflicts:
#	ui/packages/app-shell/src/views/objectViewListRenderer.tsx
…-8r2qm4

# Conflicts:
#	content/docs/ui/views.mdx
#	ui/packages/app-shell/src/views/ObjectView.tsx
#	ui/packages/app-shell/src/views/listDraftStore.ts
#	ui/packages/app-shell/src/views/personalViews.ts
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-22T00:33Z. The brief handed to the isolated declaration-face reviewer for PR #36212 (owed by Clause-②: yes (widening): two new @object-ui/i18n keys). The record follows as its own comment.

Contract review brief — PR #36212 @ efa7c4f000bcfcbe403953270561bf59bd61c1d5 (cards #36194 and #36195)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· cards #36194 and #36195: its body and EVERY comment (rulings and earlier records included)
· also epic #35547 (body) and merged PR #36123 (#35955 PR 2, its body only) for context; the seat claims 7070351344 on #36195 and 7070357165 on #36194; ruling A on changeset levels (level follows the Metadata-protocol line; a Clause-② widening alone ships patch). Also judge the PR body's listed small decisions (footer stats go to the draft only; 保存到这个视图 hidden until the package list is read, with a read failure or an unlisted package still allowed): neither may widen what the server writes.
· PR #36212: its body, its file list, and the net diff against main at efa7c4f000bcfcbe403953270561bf59bd61c1d5
· the check-runs on efa7c4f000bcfcbe403953270561bf59bd61c1d5: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36212/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4

席位核对 — delta ACCEPT (L1-b)

Head-sha: efa7c4f000bcfcbe403953270561bf59bd61c1d5 · range ef54913f..efa7c4f0 (merges 6e6e07fe over main 1d060265, efa7c4f0 over main af2361ee) · read 2026-11-22T00:35Z · prior record 7070880897 @ef54913f

维护者速读

Must-fix

None.

Should-fix

None.

Nits

None new. Prior N1 is closed. Prior N2 (CI not started) is closed: CI is green at this head.

Checked

  • Both commits in the range are merges carrying edits. I diffed each against its own git merge-tree result, so every resolution and every added line is accounted for below.
  • 6e6e07fe (main 1d060265, which brings feat(grid): a lookup chip in a list cell opens its record in the side drawer; lookup cells draw an edit button (#36015) #36128):
    • One conflict: the useMemo deps line in objectViewListRenderer.tsx.
    • It resolves to main's line with openReferencedRecord kept, and with this PR's summaryPickKey removal kept.
    • The merge also carries prior N1: viewSaveRefusal.ts now reads errorCodeIs(err, 'NOT_OVERRIDABLE').
  • efa7c4f0 (main af2361ee, which brings feat(console): Save to this view on a shared view asks once, then saves and publishes it; layout and row colour join the list draft (#35955 PR 2) #36123). Four conflicts, each resolved by keeping both sides:
    • ObjectView.tsx:
      • Save to this view (own view) carries summaries + display.
      • Save as my view carries summaries + the draft rowColor.
      • PersonalViewListState carries both summaries and display.
    • listDraftStore.ts: the doc lists both the calculations and the layout / row colour.
    • personalViews.ts: both members are present.
    • views.mdx: no conflict markers remain anywhere in ui/packages/app-shell/src or content/docs.
  • The calculations reach the shared save:
    • columnsWithSummaries now sits in layListStateOverView (personalViews.ts:279), the body both saves build. handleSaveToSharedView passes summaries: listDraft.draft.summaries beside display.
    • The shared save still passes preference: { ...pref, rowHeight: undefined }, so the reader's row height stays out (F5).
    • Pinned in sharedViewSave-35955:
      • The pick makes no client.save.
      • The schema draws { field: 'amount', summary: 'sum' }.
      • The save publishes, and the body carries that column with rowHeight: 'short' (the view's own).
  • Small call 5 (usePackageSaveRead, useStudioDesignGate.ts):
    • usePackagePostureRead returns undefined until the list read for this id and session has answered.
    • usePackageSaveRead maps that to unread, a read-only listing to refuses, and everything else to takes. "Everything else" covers null id, a failed read, and a package the list leaves out or marks kernel.
    • canSaveToSharedView now requires takes, read off the open saved view's row (admin, not personal).
    • usePackageRefusesSaves keeps its fail-open answer, because usePackagePosture maps undefined to null.
    • Pinned: not offered while unread and offered once the list says takes; a failed read still offers it. A read-only package not offering it was already pinned by feat(console): Save to this view on a shared view asks once, then saves and publishes it; layout and row colour join the list draft (#35955 PR 2) #36123.
  • Changeset: the shared-view Save to this view now stores the calculations, and the new "offered only once the package read says it takes saves" paragraph is added.
  • CI at this head: 54 success, 12 skipped. git merge-tree against current origin/main af2361ee is clean.

Owed

  • The seat's declaration L2 on this head (running in parallel).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: efa7c4f000bcfcbe403953270561bf59bd61c1d5
Local-runs: none

Inputs read: cards #36194 and #36195 (bodies and every comment, the claims 7070357165 and 7070351344 included), epic #35547 (body), merged #36123 (body), this PR's body, file list (30 files) and net diff against main (merge base af2361ee), and the 66 check-runs on the head.

① Derived judgments

② Semver level

  • Clause-②: yes (widening): right. The new i18n keys are a widening of a published object. The text is the same in the PR body and the changeset, and the PR body also says the ListView / ObjectGrid props are unchanged.
  • Metadata-protocol: none: right. No spec, protocol or server write shape changes.
  • Level: under ruling A, the level follows the Metadata-protocol line, and a Clause-② widening on its own ships as patch. So the changeset 36194-footer-calculation-draft.md is right at patch for @object-ui/app-shell and @object-ui/i18n. @object-ui/plugin-list and @object-ui/plugin-grid change only doc comments and need no entry. Check Changeset is green on both runs.

③ Boundary flags

Findings:

  • N1 (nit). A NOT_OVERRIDABLE refusal from the view settings panel, rename, pin or set-default now tells an admin "save it as your own view". The door's remedy for that admin, the .custom customization pair, now appears only in the console. The card asked for this sentence, so the finding does not affect correctness or the contract.
  • N2 (nit). The claim's scope line said "NOT_OVERRIDABLE and other 403s", and card 只读视图的列表底部不显示「添加统计」:现在包里带的视图上照样显示,点了保存失败并弹出英文工程报错 #36195 item 3 says in general terms that a refused save never shows the server's English text. The PR rewords only the package refusal (small call 3, which the seat agreed at 22:51Z). The card's acceptance check on the package view still holds. The maintainer's acceptance read should know about the narrower scope.
  • N3 (nit). During the unread window, an admin on a writable shared view sees Save as my view alone for up to about 8 s. It is disclosed, and it is the cost of never offering a save the server would refuse.
  • N4 (nit). Both cards' acceptance asks for the before and after screenshots in the PR body. The body names them by project-folder path (/mnt/project-files/build-seat1/36194-36195/) and does not attach them.

There is no must-fix and no should-fix.

Check-runs on the head: 66 completed, 54 success, 12 skipped by path, none failed or pending. The PR is still a draft, and its merge state is clean.

Implemented-by: claude/project-thread-8r2qm4
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-22T00:38Z · #36194 + #36195: a footer calculation picked in a list goes to the list's draft and no longer writes to the server on its own; on a shared view it publishes only through the confirmed 「保存到这个视图」 (with the view's own row height and widths untouched). A reader of a read-only view can pick calculations too, into the draft only. A packaged view the server refuses to save in place now gets a plain refusal message, and 「保存到这个视图」 stays hidden until the console has read the package list (a failed read or an unlisted package still offers it, as before).

Reviews:

  • L1-b: first read ACCEPT 7070880897; delta ACCEPT 7071653097 on this head, final.
  • Declaration-face L2 (owed by Clause-②: yes (widening): two @object-ui/i18n keys): brief 7071631220, record 7071677832 on this head, PASS, no must or should. Nits N1–N4 left as accepted deviations; N2 for the acceptance read: the PR rewords only the package refusal, not every 403.

Gates on this head (efa7c4f0):

  • check-governed-merges --pr 36212 reads NOT governed (1,224 changed lines).
  • K = 0; no translations/ or skills/ path.
  • 52 check-runs are success, 10 skipped on their latest runs. Mergeable is clean.

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36194 and Fixes #36195. #36133 (#35955 PR 3) resolves its overlap after this merges.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 00:38
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 5e8e243 Nov 22, 2026
67 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-8r2qm4 branch November 22, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants