Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The migration is cohesive and well-covered by request/component/feature specs, and the controller enforces clear validation with appropriate Turbo morph updates on success.
Pull request overview
Migrates status administration reordering from the legacy generic drag controller to the sortable-lists Stimulus suite, including server-side anchor-based validation and Turbo morph reconciliation of the list after successful moves.
Changes:
- Replace legacy “position/index” based status drag handling with
list_type/list_id/prev_idanchor-based moves and 422 rejection for invalid drop payloads. - Update the statuses index component wiring to
sortable-lists(sortable-lists,sortable-lists--list,sortable-lists--item) including handle targeting and a{id}move URL template. - Expand request, feature, and component specs to cover anchor moves, pagination semantics, morph updates, and disabled reordering when filtered.
File summaries
| File | Description |
|---|---|
| spec/requests/statuses_spec.rb | Adds request coverage for anchor-based moves, pagination semantics, and invalid move rejection (422). |
| spec/features/admin/statuses_spec.rb | Updates browser coverage for morph-based reconciliation, focus preservation, and sortable-lists behavior. |
| spec/components/statuses/item_component_spec.rb | Asserts drag handle is correctly targeted for sortable-lists items. |
| spec/components/statuses/index_component_spec.rb | Verifies sortable-lists wiring, outlets, URL template, and absence when filtered/empty. |
| app/models/status.rb | Includes Lists::MoveAfterAnchor and defines the sortable list type constant. |
| app/controllers/statuses_controller.rb | Implements anchor-based move handling, validation, and Turbo morph update on success. |
| app/components/statuses/item_component.html.erb | Wires the drag handle as a sortable-lists item target. |
| app/components/statuses/index_component.rb | Replaces generic drag-and-drop attributes with sortable-lists controller/list/item wiring. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
15f98cc to
8d70cee
Compare
Migrates the AUTOWORK-266 status list to the shared sortable controllers. Resolves drop anchors in global status order while preserving page-start placement and global menu actions. Validates malformed moves and morphs the list response to preserve interaction state.
606f7e7 to
9b0ba84
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
dfriquet
left a comment
There was a problem hiding this comment.
attempt at a migration
@myabc The drag-n-drop technically works. But from a UI perspective, it lacks a drop indicator. The backlog buckets have one IIRC.
With the generic implementation, the dragged item takes a faded appearance on its droppable position:
With this version, I can’t see any indicator:
Any idea?
To receive the full drag and drop treatment, you currently need to do the following:
The project attributes page currently does 1 but not 2: https://qa.openproject-edge.com/admin/settings/project_custom_fields The introduction of a
Is the lack of styling a blocker for you? We could try to rework styles in this PR, but I would prefer to see the Statuses table migrate to My preference would be to:
D-Team will take care of 2. We can also support with, or implement 3. / @HDinger |
@myabc It went smoothly. I’ll mark this PR for you to review. If that’s what you had in mind, let’s merge it. |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
The shared border-box grid top-aligns cells and nudges the action button up to compensate, which left the single-line status rows hugging the top of the taller action cell. Scopes a centered override to this table.
Ticket
https://community.openproject.org/wp/AUTOWORK-285
What are you trying to accomplish?
Moves status administration dragging off the legacy generic drag controller
and onto
sortable-lists. Filtered lists continue to disable reordering.What approach did you choose and why?
Validates predecessor anchors against global status order, resolves blank
anchors to the start of the requested page, and rejects invalid moves with
422. Successful moves reconcile the list using a Turbo update morph.
Preserves the existing server-backed directional menus because they move
across page boundaries; the shared controller menus only know rendered rows.
The shared legacy controller remains available for other migration surfaces.
Validation: 110 backend examples and 16 browser examples pass, including
native Chrome dragging, pagination, persistence after reload, filtering,
and focus preservation. Changed-line Ruby lint (7 files), ERB lint, and
git diff --checkpass. Browser tests used the isolated OrbStack environmentwith a worktree-local frontend hostname allowlist and headless Chrome.
Merge checklist