# Bug OP-20333 - Keyboard context menu includes an unselected work package in bulk actions

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-20333

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Work packages, Frontend components and Primer design system |
| Target versions | 18.0.0 |
| Observed in versions | 18.0.0, 17.9.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Alexander Coles |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Before filing a report

Reproduced locally on 2026-09-26 while reviewing <mention class="mention" data-id="DREAM-864" data-type="work_package" data-text="#DREAM-864">#DREAM-864</mention> / PR <mention class="mention" data-id="25618" data-type="work_package" data-text="#25618">#25618</mention>. Searched existing work packages for “context menu selection” and “keyboard menu”; no matching report identified. Reproduced on both QA edge and stage on 2026-09-26.

### Steps to reproduce

Preconditions: sign in as a user who can view and edit two work packages A and B in the same table. QA verification used the signed-in account; its exact role was not inspected. No other user is required.

1.  Open [edge: Demo project work packages](https://qa.openproject-edge.com/projects/DP/work_packages), or [stage: work packages](https://qa.openproject-stage.com/work_packages). Use any two editable work packages A and B.
2.  Select B by clicking unused space in its subject cell.
3.  Move keyboard focus to row A without selecting it, using **Tab** / **Shift+Tab**.
4.  Press **Alt+Shift+F10** to open A's context menu.
5.  Note the visible selection and choose **Bulk edit**. Inspect the form without submitting it.

### What is the buggy behavior?

Only B remains selected, but the menu offers bulk actions and the bulk-edit form includes both A and B.

On edge, selecting DP-2 (21779) and using **Shift+Tab** to focus unselected DP-5 (21782) produced `/work_packages/bulk/edit?ids%5B%5D=21779&ids%5B%5D=21782`. On stage, selecting AAA-1 (9781) and focusing unselected A3-4 (14178) produced `/work_packages/bulk/edit?ids%5B%5D=9781&ids%5B%5D=14178`. Stage row focus was placed on the existing tabbable row through browser automation; the full keyboard tab sequence was additionally verified on edge.

The unselected origin row silently becomes an additional action target. Other bulk actions use the same target construction; no destructive action was executed during verification.

### What is the expected behavior?

Menu action targets must agree with visible selection or an explicitly communicated context target. Opening a keyboard menu must not silently add an unselected row to a bulk operation.

The target policy is the <mention class="mention" data-id="DREAM-846" data-type="work_package" data-text="#DREAM-846">#DREAM-846</mention> context-actions criterion: if the row the menu is opened on is part of the selection, the menu acts on the whole selection; if it is not, the selection is replaced by that row first. This matches right-click today. The context-menu button in the actions column has the same defect and follows the same rule.

### Important note

Reproduced on QA edge (`dev`, reported version 18.0.0) and QA stage (`release/*`, reported version 17.9.0) on 2026-09-26. These are browser reproductions on shared QA deployments, independent of the unmerged test stack. No work-package data was changed.

### **Logs**

No console exception is required to observe this bug. The selected-row state, menu labels and bulk-edit URL/form demonstrate the target mismatch. Source investigation points to `WorkPackageViewContextMenu#getSelectedWorkPackages`, which appends the origin work package; keyboard entry does not perform the right-click selection gesture.

### Screenshots and other files

No screenshot attached. The QA links and steps above allow manual reproduction. Browser evidence is also recorded in the DREAM-863–865 review notes.

### Environment information

**OpenProject installation type**

Other: OpenProject QA edge and QA stage deployments; underlying deployment packaging not checked. Also reproduced on a local Rails/frontend development server.

**OpenProject version**

Local branch `implementation/dream-865-backfill-table-lifecycle-configuration-coverage`, commit `6928f2108014e94ddadd8417c1d7d59fa2b399d6`, tested 2026-09-26. This local result is supplementary to the QA reproductions.

Confirmed on [QA edge](https://qa.openproject-edge.com/) (`dev`, API reports **18.0.0**) and [QA stage](https://qa.openproject-stage.com/) (`release/*`, API reports **17.9.0**), tested 2026-09-26. Exact deployed commit SHAs were not established.

**Browser**

- [x] Chrome — reported version 153.0.0.0
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other

**Operating System**

- [ ] Windows
- [x] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux
- [ ] Chrome OS
- [ ] Other

**Language**

Browser: en-GB. OpenProject interface: English (`html lang=en`).
