Skip to content

[6.x] Refetch bulk actions when selections are replaced - #15674

Merged
jasonvarga merged 1 commit into
6.xfrom
15674-stale-bulk-actions
Oct 19, 2026
Merged

jasonvarga merged 1 commit into
6.xfrom
15674-stale-bulk-actions

Conversation

@jaygeorge

@jaygeorge jaygeorge commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Description of the Problem

The bulk actions toolbar can show the wrong actions for the selected items. After a bulk Move, for example, selecting other assets doesn't fetch their actions, so the toolbar keeps whatever it had before. If the last fetch was for an empty selection, you only get "Deselect".

What this PR Does

BulkActions watched props.selections directly, which only follows the array it was first given. Actions like Move send back a replaceInSelections callback, and the listing then swaps in a new array, so the watcher never fires again.

It now watches a getter instead, so it follows the prop when the array is replaced as well as when it's changed in place. I kept deep, because selecting and deselecting still edit the array in place.

The Listing tests now stub axios.post, as BulkActions correctly fetches actions there now.

stale-bulk-actions.mp4

How to Reproduce

  1. Go to Assets and open a folder with a few assets.
  2. Select an asset and move it with the bulk Move action.
  3. Select another asset. No request goes to actions/list, so the toolbar shows the previous item's actions.

BulkActions watched the array it was first given, so once a listing replaced its selections (e.g. via an action's replaceInSelections callback), selecting other items no longer fetched their actions and the toolbar kept showing stale ones.
@jasonvarga
jasonvarga merged commit 04286a7 into 6.x Oct 19, 2026
67 checks passed
@jasonvarga
jasonvarga deleted the 15674-stale-bulk-actions branch October 19, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants