# Feature AGILE-347 - Support drag and drop to external applications

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

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 17.8.0 |
| Sprint | Sprint 7 |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Frontend components and Primer design system, Modules and project features / Backlogs |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

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

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

## Context

Backlogs cards are draggable through the shared `sortable-lists` Stimulus controllers (Pragmatic drag-and-drop). Internal drags exchange only symbol-keyed payloads, so dragging a card out of the browser window hands external applications (chat, editors, other browser windows) nothing — Pragmatic's `getInitialDataForExternal` was deliberately left unset.

## Goal

Dragging a card out of the window carries the work package URL as native drag data (`text/uri-list` and `text/plain`), the same absolute URL as the card menu's "Copy URL to clipboard" action, so a card dropped into an external application yields a usable link. Rich-text targets (e.g. Apple Mail's composer) additionally receive a `text/html` anchor whose link text is the card's caption.

## Acceptance Criteria

*N.B. for QA: which of the offered data flavours (`text/uri-list`, `text/plain`, `text/html`) an external application consumes — and how it renders the drop — is decided by that application and the operating system, not by OpenProject. Some applications refuse browser drags altogether: Apple Notes, for example, accepts drags from Safari but not reliably from Chromium-based browsers — this is application-side behaviour outside OpenProject's control and not a defect. The drag preview platform note on <mention class="mention" data-id="AGILE-291" data-type="work_package" data-text="#AGILE-291">#AGILE-291</mention> applies here too.*

### Scenario 1: Dropping a card into a plain-text application

  - **Given** a user on the Backlogs page

  - **When** they drag a Work Package card out of the browser window

  - **And** drop it into a plain-text target (e.g. a text editor, terminal, or chat message input)

  - **Then** the absolute Work Package URL is inserted as bare text.

  - **And** the URL is identical to the one produced by the card menu's "Copy URL to clipboard" action.

### Scenario 2: Dropping a card into another browser window

  - **Given** a second browser window is open

  - **When** the user drags a card out of the Backlogs window and drops it onto the other window's address bar (or tab strip, where the browser supports it)

  - **Then** the browser opens the Work Package URL.

### Scenario 3: Dropping a card into a rich-text application

  - **Given** a rich-text capable target that accepts browser drags (e.g. Apple Mail's composer, a rich-text web editor in another browser window)

  - **When** the user drops a card into it

  - **Then** a hyperlink is inserted whose link text is the card's caption and whose destination is the Work Package URL.

### Scenario 4: Internal drag and drop is unchanged

  - **Given** a user drags a card within or between backlog lists on the same page

  - **Then** reordering and moving behave exactly as before (see <mention class="mention" data-id="AGILE-291" data-type="work_package" data-text="#AGILE-291">#AGILE-291</mention>).

  - **And** no URL text is inserted anywhere on the page.

### Scenario 5: Misdropped cards do not navigate the page

  - **Given** a user drags a card

  - **When** they release it over an area of the Backlogs page that is not a valid drop target

  - **Then** the card returns to its original position.

  - **And** the current tab does **not** navigate to the dragged Work Package URL.

### Scenario 6: Coverage of both list kinds

  - **Given** sprint lists and backlog bucket lists

  - **Then** cards from both list kinds expose the external drag data (Scenarios 1–3 hold for either origin).

## Out of scope

  - No caption text in `text/plain` (bare URL string).

  - No accepting inbound external drags (`dropTargetForExternal`).
