You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Grid row selection is not cleared after a batch edit (data objects and assets) - #4256
After a batch edit in a data object or asset folder listing, the edited rows stayed selected, so they easily ended up in the next batch operation. Only batch delete cleared the selection.
RowSelectionProvider gets deselectRows(ids), a functional state update that removes only the given ids from the latest selection. This is an additive field on the SDK-exported RowSelectionData; setSelectedRows is unchanged.
Multi-row batch edit (DataObjectBatchEditJob, AssetBatchEditJob): pass onFinish: async () => { deselectRows(selectedRowsIds) }, using the ids submitted to that job. The window modal doesn't block the grid, so rows selected while the job runs stay selected. Clearing the whole selection could have turned the next batch edit into a folder-wide one.
Single-row patch: on success, deselect the submitted row (response.error === undefined). For data objects, the grid invalidation moved from an effect gated on selectedRowsCount === 1 to right after the successful patch, so deselecting can't skip it.
AbstractBatchEditJobOptions.onFinish is widened to () => void | Promise<void>, so the modals can pass plain callbacks (Sonar S7503). handleCompletion() already awaits it, so existing async callers keep working.
Folder-wide batch edit (no selection) is unchanged.
data-object/.../batch-edit-modal.tsx was already at 299 lines on 2026.3, so I added a file-level /* eslint-disable max-lines */, the same as tags.ts and install-core-services.ts, instead of reformatting unrelated code.
Additional info
Verified locally:
ESLint on the changed files.
tsc --noEmit reports no errors in the touched code.
New row-selection-provider.test.tsx (3 tests), including the case where the selection changes before the job completes.
execution-engine and element listing jest suites pass (167 tests).
Not verified: the modal wiring has no automated test, because rendering the modals in jest is blocked by the @sdk/components → antd ESM import. Not exercised in a running Studio.
Manual test, in a data object folder grid and an asset folder grid:
Select 2 or more rows, run a batch edit, wait for the job to finish: those rows are deselected.
Select rows A and B, start a batch edit, then select C while the job runs: after it finishes, only C stays selected.
Select exactly 1 row and run a batch edit: it's deselected and the grid shows the new value.
Make a failing single-row asset edit: the selection should stay.
The multi-row batch edit jobs for data objects and assets now get an
onFinish callback that clears the selection, and the single-row patch
path clears it on success. Previously the edited rows stayed selected
and easily slipped into the next batch operation.
Resolvespimcore/platform-version#565
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verdict: Needs changes. This PR addresses stale row selections after batch edits in asset and data-object listings.
Changes:
Adds selection resets to multi-row job completion callbacks.
Clears selection after successful single-row requests, preserving the data-object invalidation order.
Adds a file-level max-lines exemption to the data-object modal.
The changes address missing cleanup, but asynchronous selection handling still needs correction. Both listing types are covered; the shared selection provider is the appropriate boundary for an atomic update. No public API signatures change.
No regression tests or documentation changes are included. A focused selection-lifecycle test is needed; running-Studio behavior and partial-failure completion remain unverified.
Batch edit jobs finish in the background while the window modal leaves
the grid usable, so clearing the whole selection on completion could
erase rows selected in the meantime and turn the next batch edit into a
folder-wide one. The row-selection provider now exposes deselectRows(ids),
a functional update that removes only the given ids, and both batch edit
modals use it with the ids they submitted.
The data-object single-row path invalidates the grid right after a
successful patch instead of in an effect gated on the selection count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Typing onFinish as () => Promise<void> forced the batch edit modals to
pass async callbacks with nothing to await (Sonar S7503). handleCompletion
already awaits the callback, so widening the option to
() => void | Promise<void> keeps existing async callers working and
matches the ownership and recycle-bin jobs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adding a required member breaks the public SDK context contract: RowSelectionData and RowSelectionContext are exported from assets/js/src/sdk/modules/element/index.ts:326. An extension providing the previous four-field context value will no longer type-check. Keep the previous context shape accepted and expose the new capability through a backward-compatible extension, adapting consumers without losing the atomic selection update. Reserve a required member for a major API change; simply making it optional is insufficient while the modals call it unconditionally.
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
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.
Changes in this pull request
Resolves pimcore/platform-version#565
After a batch edit in a data object or asset folder listing, the edited rows stayed selected, so they easily ended up in the next batch operation. Only batch delete cleared the selection.
RowSelectionProvidergetsdeselectRows(ids), a functional state update that removes only the given ids from the latest selection. This is an additive field on the SDK-exportedRowSelectionData;setSelectedRowsis unchanged.DataObjectBatchEditJob,AssetBatchEditJob): passonFinish: async () => { deselectRows(selectedRowsIds) }, using the ids submitted to that job. The window modal doesn't block the grid, so rows selected while the job runs stay selected. Clearing the whole selection could have turned the next batch edit into a folder-wide one.response.error === undefined). For data objects, the grid invalidation moved from an effect gated onselectedRowsCount === 1to right after the successful patch, so deselecting can't skip it.AbstractBatchEditJobOptions.onFinishis widened to() => void | Promise<void>, so the modals can pass plain callbacks (Sonar S7503).handleCompletion()already awaits it, so existing async callers keep working.data-object/.../batch-edit-modal.tsxwas already at 299 lines on 2026.3, so I added a file-level/* eslint-disable max-lines */, the same astags.tsandinstall-core-services.ts, instead of reformatting unrelated code.Additional info
Verified locally:
tsc --noEmitreports no errors in the touched code.row-selection-provider.test.tsx(3 tests), including the case where the selection changes before the job completes.Not verified: the modal wiring has no automated test, because rendering the modals in jest is blocked by the
@sdk/components→ antd ESM import. Not exercised in a running Studio.Manual test, in a data object folder grid and an asset folder grid:
🤖 Generated with Claude Code