Skip to content

fix(core, app-shell): the delete toast says the record went to the recycle bin; position Add holder leaves out holders - #39694

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-39439-setup-admin-polish-3
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-39439-setup-admin-polish-3

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread
Part of #39439 (PR 3 of the card: item 11 by route C, plus the same-family position holder picker. Items 1 and 5 stay with PR 2; the rest are decided or split on the card.)

repo:objectstack@os-tesla · os-tesla · session_01L9qibzbZZbDRcKrdCMMS2i

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在列表或记录页删除一条业务记录后,提示改为「已移入回收站」(服务器确实保留了记录时才这样说);后台给岗位添加成员时,已担任该岗位的人不再出现在候选列表里。
  • 为什么做:新公司演练(后台打磨卡)发现删除前后都没人告诉用户记录还能从回收站找回,此前只有有恢复权限的人能从「撤销」按钮间接得知;岗位成员选择器与权限集选择器的同类问题一并收齐。
  • 出错会怎样:最坏情况是提示文案说错(例如没有回收站的部署仍显示旧提示,这是预期)或候选列表漏掉人;删除本身的请求与结果不变,可直接撤回本改动。
  • 要你做什么:无。

What changes

Item 11, route C (settled record 7410394994; decision-thread reading 7410294142). The confirm question is not changed. After a one-record delete, the success toast now says the record went to the recycle bin when the delete's answer carries a recycle-bin entry id, for every caller:

Delete's answer Caller may restore own deletes Toast
no entry id either today's deletedNamed / deleteSuccess, byte for byte (CONTROL)
entry id no new movedToRecycleBinNamed / movedToRecycleBin, no action
entry id yes the same new sentence, plus Undo (unchanged behaviour)
  • recordDelete.run (the one core both the console list and the object-view renderer call) and the record page's own delete call now pass onRecycleBinEntry on EVERY one-record delete, not only when Undo can be offered. Authority: ruling 6629858351 (the toast is where a person learns of the bin), ADR-0148 D4, and the spec docblock on recycleBinEntryId (absent means nothing was kept). No restore-until date: the answer carries none.
  • Adapter check (the PM assumption, measured): ObjectStackAdapter.delete sends client.data.delete(resource, id, ifMatch ? { ifMatch } : undefined) whatever opts holds; onRecycleBinEntry is only called after a successful answer that carries a non-empty recycleBinEntryId. So the HTTP request is byte-identical with or without the callback. The other DataSource.delete implementations in the tree (ValueDataSource, the runner's mock, the types example) take two parameters and ignore a third argument.
  • Bulk deletes: out of scope and untouched. The batch path in recordDelete.run still calls delete(objectName, id) per row and keeps its summary toast (pinned as a CONTROL).
  • The list delete builds its toast inside recordDelete.ts, so useObjectActions.ts is not edited. DetailView.tsx / ObjectView.tsx are not edited.
  • The new sentence lives in a module-private recycledText, so the exported surface of @object-ui/core is unchanged. Two keys are appended at the end of objectActions in all eleven packs; the call sites carry the en value as their inline default (the call-site key gate checks they agree), so a host with no translations (the provider-less ObjectView) still reads English rather than a key.

Position holders (same family as item 7 of #39645, now on main). Setup, position page, Add holder: the picker leaves out people who already hold the position (the same set addHolders already skips), its title says holders are not listed, and when every member of the organization already holds it the picker stays shut and says so. Where no membership is judged, the filter is $nin over the holders; with no holder it stays undefined.

Tests

New pins are top-level describe blocks named for objectstack#39439 inside each component's existing harness file (root AGENTS.md: a new pin for a component with a shared harness file goes into that file):

  • recordDelete.test.ts: no-restore caller asked for the entry and told about the bin with no Undo; restore caller same sentence plus Undo; nameless record; CONTROL no entry id keeps today's toast for both callers; CONTROL batch unchanged; provider-less English default.
  • useObjectActions.deleteDialog-11695.test.tsx (real chain, shipped en and zh-Hans packs): the two sentences differ; no-grant caller reads the new sentence with no Undo; grant holder reads it with Undo; CONTROL no entry keeps today's toast.
  • RecordDetailView.deleteConfirmDialog-11001.test.tsx: the record page asks for the entry and reads the new sentence; CONTROL no entry keeps today's toast.
  • PositionHoldersSection.confirmAndMembers-13337.test.tsx: holders left out with the new title; all-members-hold keeps the picker shut with the sentence; CONTROL no holder and no membership leaves the picker unfiltered.

Existing pins that encoded the old behaviour, updated mechanically: one-record delete calls now carry { onRecycleBinEntry } (core, useObjectActions, the record page, and plugin-view's ObjectView.gridDelete-10383 and ObjectView.refreshInPlace-10035); the two #30239 Undo pins expect the new sentence; the #13337 picker pins expect the holder u_1 left out.

Test runs (final head c4b1b11)
pnpm --dir ui exec vitest run --maxWorkers=2 FILES
  (FILES = PositionHoldersSection*, AssignedUsersSection*, recordDelete.test.ts, useObjectActions deleteDialog-11695 and test.tsx, RecordDetailView.deleteConfirmDialog-11001, ObjectView.gridDelete-10383, ObjectView.refreshInPlace-10035, packages/i18n/src/)
 Test Files  130 passed (130)
      Tests  2051 passed | 13 skipped (2064)
os-verify-lock: VERDICT command-exit 0

Before the merge of main (head 9d1cc6f278), wider set incl. metadata-admin ResourceEditPage / setupHoldersGrant and RecordDetailView siblings:
 Test Files  183 passed (183)
      Tests  2838 passed | 13 skipped (2851)
type-check (tsc --noEmit && tsc -p tsconfig.test.json):
@object-ui/core, @object-ui/i18n, @object-ui/plugin-view  VERDICT command-exit 0
@object-ui/app-shell                                      VERDICT command-exit 0
Ablation (one per changed behaviour, via scripts/ablation-replace.mjs; tests resolve the src through the vitest alias, so no build leg)
(a) recordDelete.ts: `const message = recycledText(deps, record);` -> `recordDelete.successText(deps, record)`
    ok mutation landed: anchor 1 -> 0, blob 3b1ac779c6cf -> da29186491ee
    Test Files  3 failed (3) · Tests 14 failed | 50 passed (64) — every failure is a recycle-bin-sentence pin; no CONTROL failed
    ok restored: blob == HEAD (3b1ac779c6cf) and `git diff HEAD` is empty
(b) PositionHoldersSection.tsx: `const offered = ids.filter((id) => !held.has(id));` -> `const offered = ids;`
    ok mutation landed: anchor 1 -> 0, blob 60df77cb5257 -> dc3190fd0202
    Tests 4 failed | 7 passed (11) — the two 39439 pins and the two updated #13337 member-filter pins
    ok restored: blob == HEAD (60df77cb5257) and `git diff HEAD` is empty

Acceptance notes

  • The record page's own delete still lives in RecordDetailView.tsx rather than calling recordDelete.run; this PR only changes its request and keeps its toast on the shared successToast.
  • The comment above that record-page delete still says the body "says the delete is permanent", which has not been true since the ui: the admin recycle-bin page (list, restore, empty) and the 已删除 · 撤销 toast (#3146 slice 4) #30239 change; left as is (not this card's surface).
  • The confirm stays the question alone (decision 6731461337); the toast is the only place the bin is named.

Verification

Read first, by risk:

  1. ui/packages/core/src/actions/recordDelete.ts: successToast (the no-entry branch must stay byte-for-byte) and run (the one-record delete now always passes the callback).
  2. ui/packages/app-shell/src/views/RecordDetailView.tsx: the header Delete's dataSource.delete call.
  3. ui/packages/app-shell/src/views/metadata-admin/PositionHoldersSection.tsx: openPicker.

Two-minute check: pnpm --dir ui exec vitest run packages/core/src/actions/__tests__/recordDelete.test.ts shows the (objectstack#39439) describe passing; in a running console, delete one business record as a user without the restore grant and the toast reads OBJECT "NAME" moved to the recycle bin (zh-Hans: OBJECT“NAME”已移入回收站).

Local gates (dispatch-gates --commands, reconciled with --ran at c4b1b11)
Run reconciliation — 42 derived, 41 run, 1 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 42 derived famil(ies) accounted for — 41 run, 1 NOT-MEASURED (0 DERIVED from a recorded exit 3, 1 claimed).
NOT-MEASURED pnpm check:type-check-debt — timed out at 150s on the shared box (exit 124); a ledger ratchet this diff does not move; CI runs it.
ui: check:i18n-keys exit 0 · check:new-line-citations VERDICT 0 new citation(s) exit 0
overlap-check.mjs: VERDICT clean exit 0 (shares the locale packs with #39668, #39568, #39063; each merges cleanly)

Session: https://claude.ai/code/session_01L9qibzbZZbDRcKrdCMMS2i

🤖 Generated with Claude Code

…cycle bin; the position picker leaves out holders

Part of the setup admin polish card, PR 3 (item 11 route C and the
same-family position holders picker).

Claude-Session: https://claude.ai/code/session_01L9qibzbZZbDRcKrdCMMS2i
Co-authored-by: Claude <noreply@anthropic.com>
…and the position picker that leaves out holders

Claude-Session: https://claude.ai/code/session_01L9qibzbZZbDRcKrdCMMS2i
Co-authored-by: Claude <noreply@anthropic.com>
…xported surface stays the same

Claude-Session: https://claude.ai/code/session_01L9qibzbZZbDRcKrdCMMS2i
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 Dec 4, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibzbZZbDRcKrdCMMS2i

Final head for review · 2026-12-04T14:01Z · zone ot-ai · Head-sha: c4b1b1195431081bbf53e5c930c1c3bdfbcdd5f3

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxZ1DSpavkJARmHCQF

席位核对

L1-c · PR #39694 · Head-sha: c4b1b1195431081bbf53e5c930c1c3bdfbcdd5f3 · 2026-12-04T14:02Z

Verdict: ACCEPT. The zone lands this PR. It is Part of #39439, so pm:dispatched stays on the card at merge.

Face. Checks: 45 success, 15 skipped, 0 failed or pending. Relation is Part of, with no closing keyword. Amendments 7411077484 and 7413164173 cover all 22 files.

  • Flagged changeset item, judged here. Both @object-ui/plugin-view files are __tests__/*.test.tsx, which are outside files[], so no entry is owed.
  • The changeset itself (core, app-shell and i18n at patch, Clause-②: no, Metadata-protocol: none) is right.
    • The new toast keys are additions.
    • recordDelete's exported signature is unchanged; only its internal choice of toast moved.

Item 11, route C, as settled in 7410294142.

  • The confirm question is untouched.
  • The success toast says "moved to the recycle bin" only when the delete's answer carries an entry id. That holds for every caller.
  • With no entry, the toast is today's successText, byte for byte.
  • Undo is still offered only when the host passes restore, which it does only for allowRestoreOwnDeleted.
  • No restore-until date is shown, because the answer carries none.
  • Every one-record delete now passes onRecycleBinEntry. I checked the premise that the request does not change: ObjectStackAdapter.delete (data-objectstack/src/index.ts:5061-5093) builds the same client.data.delete call either way. It invokes the callback only after the mutation event, and only for a non-empty recycleBinEntryId.
  • Batch delete is unchanged.
  • Both new keys are present in all 11 locale packs, and English is the default.

Same-family carry-out from #39645. PositionHoldersSection now takes the same shape as AssignedUsersSection:

  • $in lists members minus holders;
  • $nin lists the holders when no membership is judged;
  • the picker stays shut with an allMembersHold alert when every member already holds the position;
  • held is in the deps;
  • the title copy is updated in both languages.

This closes the finding that the settled reading named at :273 and :309.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibzbZZbDRcKrdCMMS2i

Landing · 2026-12-04T14:03Z · zone ot-ai · head c4b1b1195431081bbf53e5c930c1c3bdfbcdd5f3

  • L1 ACCEPT 7413741169 (L1-c) on this head; no contract review owed (Clause-②: no, no spec or governed path).
  • check-governed-merges.mjs --pr 39694: NOT governed, 491 changed lines (≤ 3000).
  • K: landing-k.mjs cannot answer (no Test Core shard ran on this UI-only head); read instead from the merge base f7c60e5b86 to origin/main 8e4dda438d: 12 first-parent commits (< 15). Locale packs: two appended keys in objectActions, overlap-check clean at this head.
  • CI on this head: 45 success, 15 skipped, 0 red; mergeable clean.
  • Action: pr_ready + automerge_enable (merge queue). Part of #39439: the card stays pm:dispatched (PR 2 in rework, PR 4 in development).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 4, 2026 14:03
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 09a1d7b Dec 4, 2026
61 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-39439-setup-admin-polish-3 branch December 4, 2026 14:27
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/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants