Repository navigation
feat(app-shell): the ban dialog says how many records the user holds and offers an optional hand-over - #30652
Draft
objectstack-fleet[bot] wants to merge 10 commits into
Draft
objectstack-fleet[bot] wants to merge 10 commits into
objectstack-fleet[bot] wants to merge 10 commits into
Conversation
…and offers an optional hand-over The sys_user ban_user dialog gains a host-composed companion above its params: the user's owned and assigned record counts from security.assignedWork.count (truncated and unreadable said as the server answers them), and an optional bulk hand-over through security.assignedWork.transfer whose report shows what moved, what failed and what remains. Confirm stays the ban and never waits on the panel. Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
…and-over report Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
…format-string keys as legitimate identities Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
…rk vocabulary in its own module Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
…count runs Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
…, removed by the next commit Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
… that read at 1 Review follow-up on the ban dialog's assigned-work panel (objectstack#30205). - The panel names each object through `servedObjectLabel` (objectstack#30486): the label the server served is drawn as given, and the client bundle is asked only when none is served, so a renamed object shows its new name. A new case pins a served label that differs from the bundle's. - en, de, fr, es and pt now say the summary (and, in de, fr, es and pt, the hand-over report) as "label: number", the form ru, ko and ja already use, so a count of 1 is not a plural noun. No plural keys. The eager English pack stays at 60,325 gz, the same +374 B over main as before. Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
The ban dialog's assigned-work panel (objectstack#30205) took every object definition off `useMetadata().objects`, which pulls the whole object registry back when the dialog opens and which the open-path census of object readers did not classify. It now asks `readObjectsByName` for the objects the count and the hand-over report name, as `ActivityObjectLabel` does, and the census lists it as a `byName` reader. A new case pins that the counted objects are asked by name and the whole list is never read. Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
Fixes #30205
Clause-②: no
Metadata-protocol: none
维护者速读
sys_user的ban_user动作出现,由宿主判定,不读任何作者元数据,其他动作的对话框不变。首屏英文语言包增加 374 B gz,超过该块的 60,000 上限,须排在 PR perf(i18n, app-shell)!: the marketplace pages' strings leave the eager language packs for a lazymarketplacenamespace #30640 之后合并(那之后余量约 2.6 KB)。回滚即还原本 PR。ui/packages/app-shell/src/views/UserAssignedWorkPanel.tsx(面板与交接流程)、ui/packages/app-shell/src/views/actionDialogCompanion.ts(哪个对话框带面板)、ui/packages/app-shell/src/views/ActionParamDialog.tsx的 companion 渲染处。pnpm --dir ui exec vitest run packages/app-shell/src/views/ActionParamDialog.banAssignedWork-30205.test.tsx,预期 12 个用例全绿(计数与拥有/指派拆分、读不到与截断、交接完成/部分失败/被拒、交接进行中仍可封禁)。marketplacenamespace #30640 之后)。What changes
ParamDialogStategains an optionalcompanion, drawn at the top of the dialog's scrolling region. The host decides it from the platform action being run: the pureresolveParamDialogCompanion(objectName, actionName, row)(views/actionDialogCompanion.ts) answers{ kind: 'user-assigned-work', userId }forban_useronsys_user, with the user id read from the row the action runs on, and nothing for any other action. No authored key selects it, sosys-user.object.tsand the spec are untouched. Both param-collection handlers,useConsoleActionRuntime's andRecordDetailView's, call that one function, so the two runtimes cannot drift.UserAssignedWorkPanel(app-shell internal, not exported). On open it callssecurity.assignedWork.count(userId)of@objectstack/clientthrough the console adapter, as the signed-in administrator, and shows:owner_id) and assigned (every other user field), then one row per object and field with its count, using the object's and field's translated labels;truncatedas a note that this person may hold more,unreadableas the named objects that were not counted, andtransferable: falserows (multi-valued user fields) as counted but not handed over here;userpicker (the platform's person picker, which already leaves out banned users; the panel also leaves out the user being banned) and a Hand over button. One click is onesecurity.assignedWork.transfer(userId, { toUserId })call (the server moves at most 500 rows). The report shows moved / could not be moved / still held, and each failed record's object, id and reason as the server worded it. When rows remain, the button reads "Hand over the next batch". The counts are read again after each hand-over, and the previous counts stay drawn until the new ones arrive. A target the server refuses as banned (reference_user_banned) is said in the reader's language; any other refusal shows the server's message.console.assignedWork.*keys in all ten packs.rowandfailureare pure format strings and are added toLEGITIMATE_IDENTITIESinuntranslated-identity-4376.test.tswith their reason..changeset/ban-dialog-assigned-work-handover.md,@object-ui/app-shelland@object-ui/i18npatch.Branch: the harness-assigned
claude/project-thread-4vnhy6, notclaude/issue-30205-*; the card is #30205.Tests
views/actionDialogCompanion.test.ts(5): the ban dialog gets the companion for its row (string and numeric ids); CONTROL, anothersys_useraction (unban_user,set_password) gets none; CONTROL,ban_useron another object or with no object gets none; a row with no id gets none.hooks/__tests__/useConsoleActionRuntime.banCompanion-30205.test.tsx(2) andviews/RecordDetailView.banCompanion-30205.test.tsx(2): each handler hands the dialog the companion forban_userwithparams._rowRecord, and none forunban_user.views/ActionParamDialog.banAssignedWork-30205.test.tsx(12), with the client'scount/transferas recording doubles: one count for the dialog's user and the owned/assigned split;splitAssignedWorkcounts onlyowner_idas owned; truncated and unreadable notes; nothing readable means no hand-over offered; a refused count keeps Confirm enabled and Confirm still resolves; the hand-over button waits for a pick; a complete hand-over reports and recounts; a partial hand-over names each failure and offers the next batch, which calls transfer again; a banned target is the translated sentence; another refusal shows the server's reason; Confirm stays enabled and bans while a hand-over is in flight; no panel and no count without the companion.RecordDetailView.paramRuntimeParity-6431.test.tsx:companionjoinsDIALOG_READS, since both runtimes now write it.scripts/ablation-replace.mjs, on committed975b53ff, each restored by the tool: blob equals HEAD,git diff HEADempty):useConsoleActionRuntime.tsx,companion: resolveParamDialogCompanion(...)replaced bycompanion: undefined: its handler test went red, 1 failed / 2,expected undefined to deeply equal { kind: 'user-assigned-work', … }.RecordDetailView.tsx: its handler test red, 1 failed / 2, same message.ActionParamDialog.tsx, the companion render guarded off: the panel suite red, 10 failed / 12 (the two that stay green are the pure split and the no-companion case).Acceptance notes
system: truefields, and the platform-injectedowner_idissystem: true, so only objects that declareowner_idthemselves (in the showcase,showcase_announcement) count or move owned records. Measured on the live showcase: threeshowcase_projectrows owned by the user were not counted. The panel shows the server's answer as it came and does not compute owned records itself; once the server counts the injected field, the owned figure appears with no change here.owner_idare owned; every other user field (an app'sassignee,f_userin the showcase) is assigned.CI=true vite buildof the console,dist/eager-closure.json:i18n-locale-en59,951 gz withmain'sen.tsand 60,325 gz with this branch's, so +374 B, measured as two builds of the same tree that differ only in that file. That is over the chunk's 60,000 ceiling, andpnpm --dir ui check:eager-closureis red on this branch (i18n-locale-en 58.9 KB / 58.6 KB ceiling (OVER by 0.3 KB)). PR perf(i18n, app-shell)!: the marketplace pages' strings leave the eager language packs for a lazymarketplacenamespace #30640 moves the marketplace strings out of the pack (59,951 → 57,010 at its head), so this PR lands after it: mergemainonce perf(i18n, app-shell)!: the marketplace pages' strings leave the eager language packs for a lazymarketplacenamespace #30640 is in, rebuild, and the check clears with about 2.6 KB to spare. The ceiling is not raised here. The eager chunk count is 103 on both builds.main14c67d44, with the description and the ban reason only: en, zh-CN;f_userrows;44ce98c6and removed from the tree by the next commit.Verification
All on head
bfe597f0(the tree of3e306eff; the two later commits add and remove the screenshots) unless noted. Lock readings are the lock's own VERDICT lines.pnpm --dir ui exec vitest run packages/i18n/ packages/app-shell/src/views/ActionParamDialog packages/app-shell/src/views/RecordDetailView packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime packages/app-shell/src/views/actionDialogCompanion packages/app-shell/src/__tests__/onbbee3036: 266 files, 2928 passed, 13 skipped, 1 failed (the partial hand-over case, which the next commit3e306efffixed by keeping the previous counts drawn during the recount); that file on3e306eff: 12 / 12. The run includes every i18n suite walking the ten packs (key parity, untranslated identities) and the product-neutral renderer ratchet.pnpm --filter @object-ui/app-shell run type-check(source and tests): exit 0 onbbee3036; the last source commit changes one statement.--no-inline-configonUserAssignedWorkPanel.tsx,userAssignedWork.ts,actionDialogCompanion.ts: 0 problems. On the editedActionParamDialog.tsx: 0 errors, its existing warnings only.node scripts/pm/dispatch-gates.mjs --commands: 35 derived families, the same list atfb246487andbfe597f0. All 35 exit 0 onbfe597f0, includingpnpm --dir ui exec vitest run scripts/(170 files passed, 2 skipped; 4970 tests passed).--ranreconciles 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.bfe597f0:pnpm --dir ui run check:i18n-keys,check:i18n-dead-keys,check:eager-locale-catalogues,check:new-line-citationsexit 0.pnpm --dir ui check:eager-closureexit 1,i18n-locale-enover its ceiling by 0.3 KB, as the Acceptance notes say: it clears once perf(i18n, app-shell)!: the marketplace pages' strings leave the eager language packs for a lazymarketplacenamespace #30640 is merged in.!andClause-②has no(narrowing)arm.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgV7XEtNA8u7WA2q1XZ