Content
View differences
Updated by Alexander Coles 6 days ago
**As** a user of OpenProject's OpenProject's Backlogs module
**I want to** use drag and drop to move items
**so that** can manage my backlogs, buckets and sprints effectively.
--- **Acceptance criteria**
### Acceptance Criteria (Refined) _Reorder and move_
#### Scenario 1: Reordering within the same list
* **Given** a A user with "manage permission to manage backlog/sprint items" permissions
* **When** they drag items can reorder a Work Package package card up or down within a Backlogs list (changing its current list
* **Then** a visual drop indicator (highlighted gap) appears at valid drop positions.
* **And When** they drop Position); the card
* **Then** the card instantly moves to the new position (optimistic update).
* **And** the new order is persisted to the server.
persists.
* **And** refreshing the page confirms the new order.
#### Scenario 2: Moving between lists
* **Given** a A user with "manage backlog/sprint items" permissions
* **When** they drag can move a Work package card from between Backlogs lists — an Inbox backlog
* **And** hover over backlog, a Backlog bucket, or a Sprint — including into an empty Sprint list
* **Then** Backlogs list; the empty Sprint list visually indicates it can accept the drop.
move persists.
* **When** they During a drag, a Highlighted gap drop indicator marks the card
candidate Position, shown as the gap above or below a Work package card.
* **Then** the A scrollable Backlogs list auto-scrolls when a card instantly appears in the Sprint list.
is dragged near its top or bottom edge.
* **And** the move Each Backlogs list either accepts dropped Work package cards or does not — drop is persisted to the server.
#### Scenario 3: Missing Permissions
enabled per list, not filtered per card. _(To confirm: acceptance is all-or-nothing per Backlogs list.)_
* **Given** a A user **without** "manage without permission to manage backlog/sprint items" permissions
* **When** they attempt to click and drag a Work Package card
* **Then** the card items cannot be picked up (no drag state is initiated). cards.
_Optimistic behaviour_
#### Scenario 4: Optimistic Update Failure (Server Error)
* **Given** a user drags and drops a On drop, the Work package card moves to a its new position
* **When** Position immediately, before the server returns an error (e.g., network failure or concurrent edit)
confirms.
* **Then** If the reorder or move fails, the card reverts returns to its original position.
* **And** Position and an error flash notice is displayed explaining the failure.
#### Scenario 5: Card Visibility After Move
shown.
* **Given** If a user's current view filters out closed items
* **When** they drag a card into a Sprint where a workflow rule automatically closes it
* **Then** the card disappears from the view.
* **And** a notification/toast is shown informing the user that the moved item Work package is no longer visible in the current view. view after the move, the user is notified.
_Gestures_
#### Scenario 6: Auto-scrolling
* **Given** a Backlogs list Drag works with a vertical scrollbar
mouse and trackpad on desktop.
* **When** a user drags a card to the top 10% or bottom 10% of the list container
* **Then** the list automatically scrolls Touch (mobile / tablet) drag is supported. The touch-initiation gesture and technical approach are tracked in that direction. #AGILE-293.
_Accessibility (baseline)_
#### Scenario 7: Accessibility (Keyboard/Non-Drag Fallback)
* **Given** any A Work Package package card
* **When** a user opens can be moved without drag, via the card's context menu / move dialog
* **Then** they can move it (to Sprint / to a different Sprint or Backlog Bucket without using drag and drop.
bucket).
* **And** Backlogs lists expose `aria-busy` while a reorder or move is processing, the target list has the `aria-busy="true"` attribute set. being persisted.
**Technical notes**
---
### Gap Analysis & Implementation Notes
1. **Drop Rejection Feedback:** If an item cannot be dropped (e.g., restricted type), the drop indicator (gap) must not appear.
2. **Concurrent Modifications:** Handled via Scenario 4 (Revert + Notification).
3. **Visual Source State:** While dragging, the original card should remain in the list with reduced opacity (0.4) to act as a "ghost" placeholder.
4. **Auto-scrolling Threshold:** Defined as the top/bottom 10% of the list's viewport.
5. **Pagination:** Items can only be dropped into currently loaded regions of the list.
### Technical Notes
* Migrating Backlogs DnD from dragula to Atlassian Pragmatic DnD (#AGILE-251).
* Reusable `sortable-lists` Stimulus primitive in `frontend/src/stimulus/controllers/dynamic/`; Backlogs is the first consumer.
* **Mobile/Touch Support:** Verified that native Controller topology under discussion in #AGILE-292 — recommendation: single root + first-class `list`/`item` leaf controllers via outlets. Not yet a final decision.
* Touch (mobile / tablet) drag is not provided by Pragmatic's element adapter (native HTML5 DnD (Pragmatic's default adapter) does not fire `DragEvents` for finger-touch. This requires either polyfilling or a Pointer Events implementation (tracked DnD); delivery is tracked in #AGILE-293).
#AGILE-293.
* Controller topology: Direction so far: single root per page + leaf controllers for list/item.
= whole interaction surface; type-driven drop acceptance (per-list, multi-valued); elements can be both list and item; root holds a `type → move-URL` map; collection move endpoint per type with `ids[]` in the body (single = `[id]`); multi-select state as a root-owned `Set<itemId>`.
* Related: #AGILE-175, #AGILE-181, #AGILE-278, #AGILE-284. #AGILE-175 (draggable buckets/sprints), #AGILE-181 (multi-select + batch move), #AGILE-278 (bulk move action), #AGILE-284 (optimistic reordering).
**Permissions and visibility considerations**
* Reordering and moving require permission to manage backlog/sprint items.
**Translation considerations**
* _Key terms and phrases in the key languages_
**Out of scope**
* Multi-select and batch move (#AGILE-181).
* Reordering whole Backlogs lists, buckets, or sprints (#AGILE-175).
* Long-press and advanced gestures beyond basic touch drag.
* Keyboard-operable drag-and-drop and screen-reader drag/drop announcements.
<br>
**I want to** use drag and drop to move items
**so that** can manage my backlogs, buckets and sprints effectively.
---
### Acceptance Criteria (Refined)
#### Scenario 1: Reordering within the same list
* **Given** a
* **When** they drag
* **Then** a visual drop indicator (highlighted gap) appears at valid drop positions.
* **And When** they drop
* **Then** the card instantly moves to the new position (optimistic update).
* **And** the new order is persisted to the server.
#### Scenario 2: Moving between lists
* **Given** a
* **When** they drag
* **And** hover over
* **Then**
#### Scenario 3: Missing Permissions
* **When** they attempt to click and drag a Work Package card
* **Then** the card
_Optimistic behaviour_
#### Scenario 4: Optimistic Update Failure (Server Error)
* **Given** a user drags and drops a
* **When**
* **And**
#### Scenario 5: Card Visibility After Move
* **When** they drag a card into a Sprint where a workflow rule automatically closes it
* **Then** the card disappears from the view.
* **And** a notification/toast is shown informing the user that the moved item
_Gestures_
#### Scenario 6: Auto-scrolling
* **Given** a Backlogs list
* **Then** the list automatically scrolls
_Accessibility (baseline)_
#### Scenario 7: Accessibility (Keyboard/Non-Drag Fallback)
* **Given** any
* **When** a user opens
* **Then** they can move it
**Technical notes**
---
### Gap Analysis & Implementation Notes
1. **Drop Rejection Feedback:** If an item cannot be dropped (e.g., restricted type), the drop indicator (gap) must not appear.
2. **Concurrent Modifications:** Handled via Scenario 4 (Revert + Notification).
3. **Visual Source State:** While dragging, the original card should remain in the list with reduced opacity (0.4) to act as a "ghost" placeholder.
4. **Auto-scrolling Threshold:** Defined as the top/bottom 10% of the list's viewport.
5. **Pagination:** Items can only be dropped into currently loaded regions of the list.
### Technical Notes
* Migrating Backlogs DnD from dragula to Atlassian Pragmatic DnD (#AGILE-251).
* Touch (mobile / tablet) drag is not provided by Pragmatic's element adapter (native
**Permissions and visibility considerations**
**Translation considerations**
* _Key terms and phrases in the key languages_
<br>