Repository navigation
feat(app-shell): configure a list view's selection-bar actions in Studio (#30089) - #30339
Draft
objectstack-fleet[bot] wants to merge 5 commits into
Draft
objectstack-fleet[bot] wants to merge 5 commits into
objectstack-fleet[bot] wants to merge 5 commits into
Conversation
…panel The list-view panel gains a section for the grid's selection bar: pick the object's actions (and the built-in Delete) into `bulkActions`, and add, edit or remove field updates in `bulkActionDefs` (label, fields to ask, confirmation), each checked against the spec's BulkActionDefSchema before it is written. The section says whether the built-in Delete stays. Claude-Session: https://claude.ai/code/session_01WGufzhfh9quLdZYWtWEMLK Co-authored-by: Claude <noreply@anthropic.com>
…zation copy they go through Claude-Session: https://claude.ai/code/session_01WGufzhfh9quLdZYWtWEMLK Co-authored-by: Claude <noreply@anthropic.com>
… sentence
A saved def comes back with `confirmText` lifted to `{ dialect, source }`;
the section shows its source and keeps the envelope on an edit.
Claude-Session: https://claude.ai/code/session_01WGufzhfh9quLdZYWtWEMLK
Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-support-ai · session_01WGufzinedUGSXteN45poyo 维护者速读
席位意见:ACCEPT。 席位核对ACCEPT → PR #30339 @
|
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 Yibo Wang · project thread
Fixes #30089
Clause-②: no
Metadata-protocol: none
维护者速读
bulkActions),也可新增、修改、删除「字段更新」(bulkActionDefs:按钮文字、要填写的字段、确认提示)。ListViewBulkActionsSection.tsx(写入逻辑与「删除是否保留」的判定)、ObjectListViewInspector.tsx(只加了一处挂载)、ObjectListViewInspector.bulkActions-30089.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ObjectListViewInspector.bulkActions-30089.test.tsx,预期 11 条全部通过;或看截图30089-4(运行时选择栏出现「批量修改负责人」)与30089-7(成功 2 / 2)。What changes
A new section in the Studio list-view panel (
ListViewBulkActionsSection.tsx), mounted for grid views only, below Sort. It edits exactly the two keysListViewSchemaalready declares (packages/spec/src/ui/view.zod.ts, "Row & Bulk Actions"); no spec, server or new metadata key.bulkActions). A picker lists the object's actions by label (read from the draft-overlaid object, the same read the panel's field pickers make) plus the built-in Delete under its reserved namedelete. Picked names are listed with a remove button; a name the object does not declare is marked "Not an action of this object".bulkActionDefs,operation: 'update'). "Add a field update" opens a form held locally until it has a button label and at least one field; Add then writes one def:name(update_FIELDS, unique among the view's selection actions),label, onerequiredparam per field (named for the field so the value is patched there; a select's options and a lookup's object copied from the field; auserfield needs no object), and an optionalconfirmText. Before writing, the def is checked with the spec'sBulkActionDefSchema; a refusal is shown and nothing is written. Fields offered: writable fields of a type the bulk dialog can collect (text, number, date, select family, lookup/master-detail with a reference, user), no read-only, formula or platform-injected hidden field.confirmTextarrives as the parsed{ dialect, source }envelope, which is shown as its sentence and kept on edit. A def of another kind (delete, aggregatecustom) is listed with "Edited in metadata" and a remove button.[], so a view that declares neither key saves byte-for-byte as it was read.writeBodybuffer, so on a read-only base the first edit goes through the existing view customization copy (ListViewCustomization.writeTarget): saved as a draft in the.custompair withoverrides: { package, basedOn }. Nothing about that path is rebuilt.studionamespace'senandzh.The card's "Not measured" items, measured
bulkActionDefs? Yes. Read fromObjectGrid'seffectiveBulkActionsand confirmed live: with neither key declared the grid shows its built-in Delete; once the view declares either key, Delete stays only ifbulkActionsnamesdelete. The section states which of the three holds (data-state=default/kept/dropped) and offers "Delete (built-in)" in the action picker so the author can keep it. Live: shots30089-4(declared withdelete: bar shows 批量修改负责人 + 删除) and30089-10(deleteremoved: bar shows 批量修改负责人 only). Edge: the grid filters an update def out when the caller lacks the edit verdict, and then its implicit Delete comes back; the section describes the author's declaration, not a given user's bar.overridesdeclared), and the served effective view is that copy. Live oncom.example.crm4.0.0: after the first edit,GET /meta/view/crm_lead.all?state=draft&package=com.example.crm.customheldbulkActions,bulkActionDefsandoverrides: { package: com.example.crm, basedOn: 4.0.0 }; after publish,GET /meta/view/crm_lead.all/layers?package=com.example.crmanswered the effective view with both keys.Tests
ObjectListViewInspector.bulkActions-30089.test.tsx(new, 11 cases; the real hook and panel over a realMetadataClientwhose transport judges each view PUT with the installed spec'sviewschema): picking writesbulkActions; adding a field update writes one defBulkActionDefSchemaaccepts (user / select options / lookup object); add waits for a label and a field; edit label, fields, confirmation and remove round-trip, emptied key removed; served envelope confirmation edited as its sentence; removing the last action removesbulkActions; other-kind def and unknown name; read-only offers no edit; CONTROLS: a view with neither key saves byte-for-byte as read, an edit elsewhere adds neither key, a kanban has no section.InterfacesPillar.customize-28562.test.tsx(shared harness, new top-leveldescribe): on a read-only base, the first field update is written into the pair's copy with the override declared, pinned to "no draft there", the base untouched.Runs (head d8c1f11)
All under
scripts/pm/os-verify-lock.sh, from theui/root asui/AGENTS.mdprescribes.pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/InterfacesPillar packages/app-shell/src/views/studio-design/StudioDesignSurface packages/app-shell/src/views/studio-design/ObjectListViewInspectorond8c1f112: Test Files 149 passed (149), Tests 1036 passed (1036), lock VERDICT command-exit 0. Narrowed to the Studio pillar, surface and list-view panel files; the rest of Test UI is CI's.5baab8fe: 11 passed (11).studio-namespace,studio-namespace-lazy, componentsclickableNonControlCensus-13461,iconOnlyButtonCensus-12143, app-shellproduct-neutral-renderer.ratchet, plugin-formaffordanceGrantMap-12082): 6 files, 115 passed.pnpm --filter @object-ui/i18n run type-check && pnpm --filter @object-ui/app-shell run type-check: exit 0.npx eslinton the touched files: 0 errors (warnings are the existingreact-refresh/only-export-componentskind).node scripts/pm/dispatch-gates.mjs --commandsond8c1f112: 35 derived commands, each run, every oneexit 0;--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. Includesnode scripts/check-sdui-manifest.mjs(exit 0).pnpm --dir ui run check:new-line-citations: 0 new citations, exit 0.Ablation
Each mutation went through
scripts/ablation-replace.mjs(anchor hit 1 → 0, blob restored to HEAD,git diff HEADempty). The test imports resolve app-shell fromsrc(no dist involved), so no rebuild was needed between legs.writeNames(thebulkActionswrite) made a no-op, on07a2728e: 2 failed / 8 passed in the new file (the picking pin and the remove-last-action pin).writeDefs(thebulkActionDefswrite) made a no-op, on07a2728e: 4 failed / 32 passed across the new file and the customize harness (add, edit/remove round-trip, other-kind remove, and the pair-copy pin).envelope.source) replaced with an empty string, ond8c1f112: 1 failed / 10 passed (the envelope pin).Acceptance notes
bulkActionsbut notbulkActionDefs(ListView.tsxreads only predicates from it), so the section is withheld there rather than offering a field update that would never render. Not filed: a reading, no defect.required: true: the executor spreads params straight into the patch, so an empty optional value would clear the field on every selected record. An author who wants an optional field edits the def in metadata.rowActions(also in the "Row & Bulk Actions" block) is not part of this card's ruling and is untouched.Verification
Browser,
examples/app-crmdev boot from this branch (merged withmain), console on Vite, zh-CN, admin. Shots in the project'sui-orders/30089-shots/folder:30089-1-studio-new-field-update.png— 定制 pressed on the read-only 线索 view; the new field-update form filled: 批量修改负责人, field 分配给, confirmation.30089-2-studio-section-saved.png— the def saved, 删除(内置) picked; note reads that Delete is kept; header shows the pair override.30089-3-studio-reloaded.png— after reload the confirmation reads back as its sentence.30089-4-runtime-selection-bar.png— published; two rows selected; bar shows 批量修改负责人 and 删除.30089-5/30089-6— the dialog asks 分配给 (person picker), then confirms 「把 2 条线索改派给 Dev Admin?」 with the two records.30089-7-runtime-after-run.png— 成功 2 / 2;30089-8the list shows Dev Admin on both rows (API read agrees).30089-9/30089-10— 删除 removed in Studio (note: not shown), published; the bar shows 批量修改负责人 only.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzhfh9quLdZYWtWEMLK