# Implementation AGILE-364 - Apply batch selection to contextual ActionMenus

Project: Stream agile
Status: closed
URL: https://community.openproject.org/work_packages/AGILE-364

## OPEN POINTS

_No work packages_

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Designer | Julia Racsko |
| Developers | Alexander Coles |

## Technical details

| Attribute | Value |
| --- | --- |
| Target versions | 18.0.0 |
| Module |  |
| Requires doc change | No |

## Belongs to

_No work packages_

## Previous chunks

| ID | Subject | Status | Assignee |
| --- | --- | --- | --- |
| AGILE-363 | Add positional actions for batch selections | closed |  |

## Next chunks

_No work packages_

## Estimates

| Attribute | Value |
| --- | --- |
| Effort (shirt size) |  |
| Work |  |

## Details

| Attribute | Value |
| --- | --- |
| Date | 2026-08-24 –  |
| % Complete | 100% |
| Category |  |
| Sprint | Sprint 13 |
| Backlog bucket |  |
| Priority | Medium |
| List |  |
| Pull preview |  |
| Labels |  |

## Description

## What to build

Connect the contextual ActionMenu presentation from <mention class="mention" data-id="AGILE-348" data-type="work_package" data-text="#AGILE-348">#AGILE-348</mention> to the complete Backlogs action scope. The More button, right-click, Context Menu key, and **Shift+F10** all apply one invocation policy. The server renders a menu with **either** single work package actions **or** batch actions, never both, for the settled selection.

## Acceptance criteria

- [ ] Invoking the menu on a selected selection-eligible card preserves the live ordered selection and anchor. Invoking it on an unselected selection-eligible card replaces the selection with that card and establishes it as the anchor.
- [ ] Invoking the menu on a fixed/non-orderable card preserves the current selection and anchor, shows singular actions only, and does not announce a rejected selection.
- [ ] The same policy settles the selection before the menu's `src` is set, from the More button, right-click, Context Menu key, and **Shift+F10**.
- [ ] For a true multi-card scope the server renders batch actions only: the applicable destination actions and **Move to position**. Single work package actions are omitted, and the menu shows no group heading, selection count, or other batch-specific chrome.
- [ ] Invalid batch actions are omitted. The batch menu remains when at least one batch action applies, including **Move to position** when no destination is valid.
- [ ] When a true multi-card scope has no batch action to present, the server renders the single work package actions rather than an empty menu.
- [ ] When the scope exceeds the batch cap (`MAX_BATCH_SIZE = 50`), the server renders the batch menu with its move actions disabled and an explanation reusing the drag refusal wording ("Cannot move %{count} work packages at once. Select no more than %{max}."). This is the one case where invalid batch actions are disabled rather than omitted. Selection itself stays uncapped.
- [ ] The More button's tooltip names the scope and doubles as the menu's accessible name: the batch and its count for a true multi-card scope, the singular name otherwise and after the menu closes. Singular and batch names are separate translatable strings, never a concatenation. Screen reader QA covers this before merge.
- [ ] A one-card scope keeps today's visible menu. Singular actions such as opening details, opening full screen, copying the URL, and copying the ID always target the invoking card.
- [ ] A menu restored from the Turbo cache, or morphed by a page refresh, loads its contents for the current selection.
- [ ] Contextual positioning, menu keyboard navigation, and focus restoration established by <mention class="mention" data-id="AGILE-348" data-type="work_package" data-text="#AGILE-348">#AGILE-348</mention> remain unchanged.

## Sequencing notes

  - Rebuilt from `dev` on top of <mention class="mention" data-id="AGILE-363" data-type="work_package" data-text="#AGILE-363">#AGILE-363</mention>; the user-facing integration point of the <mention class="mention" data-id="AGILE-362" data-type="work_package" data-text="#AGILE-362">#AGILE-362</mention>/#AGILE-363/#AGILE-364 release train for 18.0. Design QA evaluates the top of the stack.
  - Replaces the first implementation's client-side menu projection (`action-menu.ts`) with server-rendered contents.
  - Decide here whether `action-menu-morph-remount.ts` can be retired, using the <mention class="mention" data-id="AGILE-481" data-type="work_package" data-text="#AGILE-481">#AGILE-481</mention> adoption of inserted fragments.
