Implementation/74970 backlogs pragmatic dnd#23218
Draft
myabc wants to merge 2 commits into
Draft
Conversation
8ac3e26 to
9994516
Compare
Deploying openproject with ⚡ PullPreview
|
9994516 to
4a84694
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates Backlogs drag-and-drop from the legacy approach to Atlassian’s Pragmatic Drag and Drop, moving Stimulus wiring onto the inner work package card and introducing new frontend helpers/controllers to compute drop targets and ordering.
Changes:
- Introduces Pragmatic DnD-based Stimulus controllers/helpers for Backlogs item dragging and list drop targeting.
- Moves Backlogs-specific data attributes (story + draggable item wiring) from BorderBox rows to the inner work package card, and updates Backlogs views/components accordingly.
- Adds Atlaskit Pragmatic DnD dependencies and updates Ruby/JS specs to reflect the new DOM + data attributes.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/components/open_project/common/work_package_card_component_spec.rb | Adds coverage for forwarding system arguments to the root card element. |
| modules/backlogs/spec/support/pages/backlog.rb | Updates test selectors to target the new draggable item data attribute on the card. |
| modules/backlogs/spec/requests/backlogs/backlog_spec.rb | Adds assertions for Backlogs controller wiring and list targets in rendered backlog HTML. |
| modules/backlogs/spec/components/backlogs/work_package_card_list_item_component_spec.rb | Adjusts expectations to verify Backlogs Stimulus wiring is on the card, not the row. |
| modules/backlogs/spec/components/backlogs/work_package_card_list_component_spec.rb | Updates list/component specs for new target attributes and card-level data wiring. |
| modules/backlogs/spec/components/backlogs/story_points_component_spec.rb | Adds expectation around wrapper positioning for SR-only label placement. |
| modules/backlogs/spec/components/backlogs/sprint_component_spec.rb | Updates sprint DnD expectations to use Backlogs list targets + card-level draggable attributes. |
| modules/backlogs/spec/components/backlogs/inbox_component_spec.rb | Updates inbox drop-target assertions to new Backlogs list target attributes. |
| modules/backlogs/spec/components/backlogs/bucket_component_spec.rb | Updates bucket drop-target + card wiring assertions for new DnD approach. |
| modules/backlogs/app/views/backlogs/backlog/show.html.erb | Removes legacy content_controller wiring for Backlogs. |
| modules/backlogs/app/views/backlogs/backlog/_backlog_list.html.erb | Replaces legacy generic-drag-and-drop wiring with data-controller="backlogs" root. |
| modules/backlogs/app/components/backlogs/work_package_card_list_item_component.rb | Moves Backlogs Stimulus wiring/data to the inner card; adds draggable card args. |
| modules/backlogs/app/components/backlogs/work_package_card_list_component.rb | Changes list target data attributes to data-backlogs-target="list" + id. |
| modules/backlogs/app/components/backlogs/work_package_card_component.rb | Forwards system arguments to the shared/common work package card. |
| modules/backlogs/app/components/backlogs/inbox_component.html.erb | Updates inbox list container data attributes to match Backlogs controller targets. |
| frontend/src/stimulus/controllers/dynamic/backlogs/item.controller.ts | Adds a Stimulus controller to make individual cards draggable + item drop targets. |
| frontend/src/stimulus/controllers/dynamic/backlogs/item.controller.spec.ts | Adds unit tests for item controller state rendering + preventUnhandled integration. |
| frontend/src/stimulus/controllers/dynamic/backlogs/drag-and-drop.ts | Adds helper utilities for resolving targets and computing prev_id for move requests. |
| frontend/src/stimulus/controllers/dynamic/backlogs/drag-and-drop.spec.ts | Adds unit tests for drag-and-drop helper logic (target resolution, ordering). |
| frontend/src/stimulus/controllers/dynamic/backlogs.controller.ts | Replaces HAL-events refresh behavior with Pragmatic DnD monitoring + move requests. |
| frontend/src/global_styles/primer/_overrides.sass | Updates styles for new drag/drop indicators and Box-card dragging visuals. |
| frontend/package.json | Adds Atlaskit Pragmatic DnD dependencies. |
| frontend/package-lock.json | Locks Atlaskit Pragmatic DnD dependencies and transitive packages. |
| app/components/open_project/common/work_package_card_component.rb | Allows forwarding system arguments; ensures Box-card class on root; adds card_arguments. |
| app/components/open_project/common/work_package_card_component.html.erb | Uses card_arguments to apply forwarded system arguments to the root element. |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
Comment on lines
+159
to
+165
| // .Box-row--focus-gray | ||
| // &:focus-visible | ||
| // background-color: var(--bgColor-muted) | ||
|
|
||
| .Box-row--focus-gray | ||
| &:focus-visible | ||
| background-color: var(--bgColor-muted) | ||
|
|
||
| .Box-row--focus-blue | ||
| &:focus-visible | ||
| background-color: var(--bgColor-accent-muted) | ||
| // .Box-row--focus-blue | ||
| // &:focus-visible | ||
| // background-color: var(--bgColor-accent-muted) |
695dcd0 to
cca6f5e
Compare
Replace the previous Dragula-oriented card/list wiring with Pragmatic Drag and Drop Stimulus controllers for backlog cards and list targets. Keep draggable card state client-side, submit moves through the existing backlogs move endpoints, and tolerate empty drop-target reports by resolving the element under the pointer. Render the draggable attribute and Stimulus item id from the server so Turbo morphs preserve the DnD contract. https://community.openproject.org/wp/74970
cca6f5e to
10fa291
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR is based off #23074. Please review that PR first.
Ticket
https://community.openproject.org/wp/74970
What are you trying to accomplish?
Migrate Backlogs drag and drop to Pragmatic Drag and Drop while preserving the existing Backlogs workflows for inbox items, sprint items, and backlog buckets.
Screenshots
What approach did you choose and why?
Working checklist
bundle exec rspec modules/backlogs/spec/features/work_packagesMerge checklist