# Epic DREAM-672 - Replace Dragula with a modern, accessible, and extensible drag-and-drop foundation

Project: Stream Design System
Status: in development
URL: https://community.openproject.org/work_packages/DREAM-672

## Detailed specification

### Motivation and background information

The current drag-and-drop implementation is based on Dragula. While functional, it has become a limiting factor for evolving UI requirements and does not meet modern expectations for accessibility, extensibility, and mobile support.

Key limitations:

*   **Accessibility gaps** (no robust screen reader support, no clear path to WCAG 2.1 compliance)
    
*   **Limited extensibility** for emerging interaction patterns (e.g. multi-select drag, rule-based constraints, future gestures)
    
*   **Inconsistent mobile/touch behavior**
    
*   **Difficult to maintain and standardize** across different UI surfaces
    
*   **Fragmentation risk**, with alternative DnD solutions (e.g. Angular CDK) already used in parts of the application
    

This work aims to replace Dragula with a **modern, framework-agnostic drag-and-drop foundation** that:

*   Works with **Stimulus and plain JavaScript/TypeScript**
    
*   Supports current backlog and board use cases
    
*   Meets **accessibility expectations (WCAG 2.1)**
    
*   Provides a **consistent interaction model across the application**
    
*   Enables future interaction patterns without rework
    

This is not a direct library swap, but the introduction of a **shared DnD abstraction layer** that can be reused across features.

### Acceptance criteria

### Core drag-and-drop capabilities

  - Reorder within a list

  - Move items across lists/containers

  - Support dropping into empty containers

  - Auto-scroll within scrollable containers and viewport

  - Support both:
    
      - whole-item drag (see <mention class="mention" data-id="73473" data-type="work_package" data-text="#73473">#73473</mention> )
    
      - handle-based drag (configurable per context)

  - Provide visual feedback:
    
      - placeholder / insertion indicator
    
      - drag preview/ghost element (configurable)

### Advanced interactions

  - Multi-item selection and drag, with customisable drop indicators

  - Configurable constraints for allowed moves (e.g. type-based rules - needed for Boards)

  - Support for delayed drag start on touch (to preserve scroll usability)

### UI coverage

  - **Backlog UI supports:**
    
      - reorder within list
    
      - move across lists
    
      - empty-list drops
    
      - multi-select drag (see <mention class="mention" data-id="73729" data-type="work_package" data-text="#73729">#73729</mention> )
    
      - auto-scroll

  - **Board UI supports:**
    
      - whole-card drag
    
      - multi-select drag

  - **Project attributes UI supports:**
    
      - section reorder
    
      - item reorder across sections

UX Interactions for Backlogs and Boards are also documented here: <https://community.openproject.org/documents/207> 

### Accessibility

  - Screen reader announcements implemented for drag-and-drop actions

  - Non-DnD alternatives available for all operations (e.g. move up/down, move to container)

  - Interaction patterns aligned with WCAG 2.1 expectations

### Platform support

  - Works on:
    
      - desktop (macOS, Windows and Linux keybindings supported)
    
      - mobile
    
      - tablet

  - Supports mouse, touch, and pointer input

### Integration (tech requirements)

  - Implemented via Stimulus controllers (or custom elements)

  - Potential reusability for legacy Angular UI

  - Compatible with Turbo/morphing updates

  - Supports server-driven DOM updates without breaking DnD state

  - Supports optimistic UI updates with rollback on failure

### Architecture

  - Shared DnD abstraction layer defined

  - No direct library usage scattered across features

  - Library-specific implementation isolated behind abstraction

  - Extensible to support future interaction patterns (e.g. long-press, gestures)

### Definition of Done

  - Dragula is no longer used in migrated areas

  - Selected DnD solution is documented and agreed upon

  - Abstraction layer is documented with usage guidelines

  - At least one additional feature (beyond backlog/board) adopts the abstraction

  - Accessibility approach is validated (manual + tooling where applicable)

### Alternatives considered and rejected

#### 1\. Native HTML5 Drag and Drop (no library)

Rejected: meeting accessibility, multi-select, and cross-device parity without a library would require substantial in-house work that an off-the-shelf solution already provides.

#### 2\. Sticking with Dragula

Rejected: unmaintained upstream, no credible path to WCAG 2.1 compliance, and its API cannot cleanly support the rule-based constraints and multi-select patterns Boards require.

### Out of scope

Initially out-of-scope:

*   Full keyboard drag-and-drop parity (non-DnD alternatives will be provided)
    
*   Complex nested/tree interactions beyond 2-levels (e.g. section/item)
    
*   Virtualized list support

| Attribute | Value |
| --- | --- |
| Mockups |  |

## Planning

| Attribute | Value |
| --- | --- |
| Roadmap | 2026 Q4 |
| Date | 2026-04-21 |
| Votes |  |
| List |  |
| Target versions |  |
| Sprint |  |
| Backlog bucket |  |
| Relevance |  |

## Subitems

| ID | Type | Subject | Status | Assignee | Target versions | Project | Priority | Spent time |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| DREAM-678 | Open Point | Do we migrate Angular components using drag and drop? | decided | Alexander Coles |  | Stream Design System | Medium |  |

## Bugs and other work packages

| ID | Type | Subject | Status | Assignee | Target versions | Module |
| --- | --- | --- | --- | --- | --- | --- |
| DREAM-761 | Code maintenance | Team planner external drag on FullCalendar Draggable | closed |  | 17.8.0 | Frontend components and Primer design system, Modules and project features / Team planner |
| DREAM-756 | Code maintenance | WP table, cards, boards and BCF on Pragmatic DnD | closed |  | 17.8.0 | Frontend components and Primer design system, Modules and project features / Work packages, Modules and project features / Boards, Modules and project features / BIM |
| DREAM-755 | Code maintenance | Draggable autocompleter on Pragmatic DnD (new sortable-lists engine + directives) | closed |  | 17.8.0 | Modules and project features / Work packages, Frontend components and Primer design system |
| DREAM-671 | Code maintenance | Migrate generic-drag-and-drop-controller usages to Sortable Lists/Pragmatic DnD | in development | Lars Wassermann | 18.1.0 | Frontend components and Primer design system, Modules and project features / Backlogs |
| DREAM-787 | Code maintenance | Migrate custom field option sorting to sortable-lists client-only mode | new |  | Product Backlog | Frontend components and Primer design system |
| DREAM-785 | Code maintenance | Migrate reporting pivot configuration from Dragula to Pragmatic DnD | new |  | Product Backlog | Frontend components and Primer design system |
| DREAM-762 | Code maintenance | Remove dragula dependency and remnants | new |  | Product Backlog | Frontend components and Primer design system |
| DREAM-677 | Task | Define migration strategy & abstraction layer | closed | Alexander Coles |  |  |
| DREAM-674 | Idea | Evaluate Pragmatic Drag and Drop as Dragula replacement | closed | Alexander Coles |  | Frontend components and Primer design system |
| DREAM-673 | Idea | Evaluate dnd-kit as Dragula replacement (Stimulus / plain JS integration) | closed | Alexander Coles |  | Frontend components and Primer design system |
| DREAM-754 | Code maintenance | Migrate Angular drag-and-drop service from Dragula to Pragmatic DnD | rejected |  |  |  |
| DREAM-676 | Idea | Investigate SortableJS as Dragula replacement | rejected |  |  |  |
| DREAM-675 | Idea | Evaluate extending Dragula-based implementation (multi-select, UX improvements) | rejected | Alexander Coles |  |  |
| DREAM-678 | Open Point | Do we migrate Angular components using drag and drop? | decided | Alexander Coles |  |  |
| DREAM-777 | Task | Update designs for reimplemented Drag and Drop | in progress | Alexander Coles |  |  |

## Details

| Attribute | Value |
| --- | --- |
| Module | Frontend components and Primer design system, Modules and project features / Backlogs, Modules and project features / Meetings, Modules and project features / Project attributes, Administration |
| Enterprise plan |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee | Alexander Coles |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Designer | Julia Racsko |
| Developers | Alexander Coles |
| Requested by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |

## Description

**Replace the legacy Dragula-based implementation with Atlassian Pragmatic Drag and Drop as the application-wide drag-and-drop foundation, while preserving current workflows and enabling accessible, touch-capable, extensible interactions.**

The foundation must:

  - integrate with Stimulus, plain TypeScript, and legacy Angular migration paths;
  - support sorting within and between containers, empty destinations, and auto-scroll;
  - provide shared busy, error/rollback, drag preview, drop-indicator, and Turbo-morph behavior;
  - retain non-drag alternatives and screen-reader announcements where the surface supports them;
  - support rule-based target constraints and future multi-item interaction; and
  - prevent new Dragula consumers or feature-specific DnD foundations.

### Decisions and current state

  - **Library: Atlassian Pragmatic Drag and Drop.** Chosen after hands-on evaluation of dnd-kit (<mention class="mention" data-id="DREAM-673" data-type="work_package" data-text="#DREAM-673">#DREAM-673</mention>), Pragmatic Drag and Drop (<mention class="mention" data-id="DREAM-674" data-type="work_package" data-text="#DREAM-674">#DREAM-674</mention>, selected), extending Dragula (<mention class="mention" data-id="DREAM-675" data-type="work_package" data-text="#DREAM-675">#DREAM-675</mention>, rejected) and SortableJS (<mention class="mention" data-id="DREAM-676" data-type="work_package" data-text="#DREAM-676">#DREAM-676</mention>, rejected). The weighted KPI evaluation with methodology and per-criterion rationale lives in #PT-139 (internal).
  - **Stimulus foundation: the reusable `sortable-lists` suite** — root/list/item controllers, pure drop-intent resolution (`drag-and-drop.ts`), the DnD-agnostic `list-dom.ts` DOM contract, and the `pragmatic-dnd-morph-attributes.ts` Turbo morph guard. Shape decided in <mention class="mention" data-id="AGILE-292" data-type="work_package" data-text="#AGILE-292">#AGILE-292</mention>, implemented in <https://github.com/opf/openproject/pull/23218>.
  - **Backlogs: migrated.** <mention class="mention" data-id="AGILE-291" data-type="work_package" data-text="#AGILE-291">#AGILE-291</mention>; merged PRs <https://github.com/opf/openproject/pull/23218> and <https://github.com/opf/openproject/pull/24157>.
  - **Stimulus admin/settings rollout:** coordinated by <mention class="mention" data-id="DREAM-671" data-type="work_package" data-text="#DREAM-671">#DREAM-671</mention> and its six cluster children.
  - **Angular surfaces: migrate now.** Decided in <mention class="mention" data-id="DREAM-678" data-type="work_package" data-text="#DREAM-678">#DREAM-678</mention> (2026-07-13), restructured 2026-07-17: <mention class="mention" data-id="DREAM-755" data-type="work_package" data-text="#DREAM-755">#DREAM-755</mention> (shared sortable-lists engine + `opSortableLists` directives + draggable autocompleter), <mention class="mention" data-id="DREAM-756" data-type="work_package" data-text="#DREAM-756">#DREAM-756</mention> and its children <mention class="mention" data-id="DREAM-757" data-type="work_package" data-text="#DREAM-757">#DREAM-757</mention>/#DREAM-758/#DREAM-759/#DREAM-760, plus <mention class="mention" data-id="DREAM-761" data-type="work_package" data-text="#DREAM-761">#DREAM-761</mention> (team planner). The Angular drop intent keeps `{targetId, edge}` — a divergence from the Stimulus `prev_id` wire model accepted for now; moving the Stimulus controllers and the Angular engine onto one wire is a candidate follow-up.
  - **Final cleanup:** <mention class="mention" data-id="DREAM-762" data-type="work_package" data-text="#DREAM-762">#DREAM-762</mention> removes the dependency and remnants after every Dragula consumer is gone.

### Shared ordering and response policy

Stimulus sortable-list moves use `list_type` + `list_id` + `prev_id`; the destination and relative ordering coordinate remain distinct. Shared admin helpers reject unknown/out-of-scope/self anchors and persist cross-list movement transactionally.

The suite performs optimistic local placement. Backlogs explicitly opts into its event-only success response (<mention class="mention" data-id="AGILE-322" data-type="work_package" data-text="#AGILE-322">#AGILE-322</mention>); admin/settings surfaces reconcile the canonical server order through `method="morph"` on their existing update or replace component streams.

### Remaining work

  - <mention class="mention" data-id="DREAM-671" data-type="work_package" data-text="#DREAM-671">#DREAM-671</mention> — shared-controller consumers, including form configuration, meetings, and Resource Planner.
  - <mention class="mention" data-id="DREAM-785" data-type="work_package" data-text="#DREAM-785">#DREAM-785</mention> — direct Pragmatic migration for the legacy jQuery reporting pivot.
  - <mention class="mention" data-id="DREAM-787" data-type="work_package" data-text="#DREAM-787">#DREAM-787</mention> — client-only sortable-lists mode and custom field options.
  - <mention class="mention" data-id="DREAM-788" data-type="work_package" data-text="#DREAM-788">#DREAM-788</mention> — native hierarchy DnD onto the common foundation; not a Dragula-removal blocker.
  - <mention class="mention" data-id="DREAM-755" data-type="work_package" data-text="#DREAM-755">#DREAM-755</mention>, <mention class="mention" data-id="DREAM-756" data-type="work_package" data-text="#DREAM-756">#DREAM-756</mention> and its children, and <mention class="mention" data-id="DREAM-761" data-type="work_package" data-text="#DREAM-761">#DREAM-761</mention> — Angular and FullCalendar-related consumers.
  - <mention class="mention" data-id="AGILE-323" data-type="work_package" data-text="#AGILE-323">#AGILE-323</mention>, <mention class="mention" data-id="AGILE-324" data-type="work_package" data-text="#AGILE-324">#AGILE-324</mention>, and <mention class="mention" data-id="AGILE-293" data-type="work_package" data-text="#AGILE-293">#AGILE-293</mention> — accessibility and touch follow-ups.
  - <mention class="mention" data-id="DREAM-762" data-type="work_package" data-text="#DREAM-762">#DREAM-762</mention> — final dependency/remnant removal.

### Final Dragula-removal gate

<mention class="mention" data-id="DREAM-762" data-type="work_package" data-text="#DREAM-762">#DREAM-762</mention> waits for <mention class="mention" data-id="DREAM-785" data-type="work_package" data-text="#DREAM-785">#DREAM-785</mention>, <mention class="mention" data-id="DREAM-787" data-type="work_package" data-text="#DREAM-787">#DREAM-787</mention>, <mention class="mention" data-id="DREAM-671" data-type="work_package" data-text="#DREAM-671">#DREAM-671</mention>, <mention class="mention" data-id="DREAM-755" data-type="work_package" data-text="#DREAM-755">#DREAM-755</mention>, the <mention class="mention" data-id="DREAM-756" data-type="work_package" data-text="#DREAM-756">#DREAM-756</mention> family, and <mention class="mention" data-id="DREAM-761" data-type="work_package" data-text="#DREAM-761">#DREAM-761</mention>. Before closure, run a fresh repository-wide Dragula inventory and reduce it to zero. <mention class="mention" data-id="DREAM-788" data-type="work_package" data-text="#DREAM-788">#DREAM-788</mention> does not gate cleanup because its starting implementation is native HTML5 DnD.

### Remaining risks

  - Pragmatic has no first-class multi-drag; multi-item drag requires an application layer (see \#PT-139).
  - Screen-reader and touch behavior must be verified across migrated surfaces (<mention class="mention" data-id="AGILE-323" data-type="work_package" data-text="#AGILE-323">#AGILE-323</mention>, <mention class="mention" data-id="AGILE-324" data-type="work_package" data-text="#AGILE-324">#AGILE-324</mention>, <mention class="mention" data-id="AGILE-293" data-type="work_package" data-text="#AGILE-293">#AGILE-293</mention>).
  - Large-list performance must be verified, especially table and Resource Planner consumers (~100 items per container).
  - Legacy dynamically generated surfaces may require narrowly documented direct-Pragmatic adapters.
