# Code maintenance DREAM-792 - Migrate meeting agenda sorting to sortable-lists

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

## OPEN POINTS

_No work packages_

## Subtasks

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Assignee | Alexander Coles |
| Accountable |  |
| Designer |  |
| Developers | OP Dev Dream Team |
| Requires doc change | No |
| Date |  |
| Priority | Medium |
| Target versions | 18.1.0 |
| Sprint |  |
| Backlog bucket |  |
| Module | Frontend components and Primer design system, Modules and project features / Meetings |
| Accessibility | Yes |
| List | a11y report 2027 |
| Labels |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |
| Remaining work |  |

## Description

## What to build

Migrate meeting sections and agenda items from the meetings Dragula subclass to the shared `sortable-lists` suite.

This is a high-risk migration, not a mechanical controller swap. Meeting section drops currently keep the client-moved section in place to avoid losing in-section edit state, while updating other agenda components. The new behavior must preserve unsaved/edit state and still reconcile canonical persisted order.

Agenda items must support movement within and between sections, including the special current-occurrence and backlog destinations. Preserve the collapsed backlog state and update all menu availability, agenda metadata, time slots, and related components affected by a move.

Use the strict scoped `move_after(prev_id)` helper and \#DREAM-775's directional menu descriptor. Existing update/replace streams use morph where they render a component; do not introduce a full-list replacement that destroys an active editor.

## Acceptance criteria

- [ ] Meeting sections reorder using relative anchors while preserving active in-section edit state.
- [ ] Canonical section order is reconciled without replacing or disconnecting the active editor.
- [ ] Agenda items reorder within a section and move between sections.
- [ ] Moves to the current occurrence and to the meeting backlog preserve their existing destination semantics.
- [ ] The collapsed backlog state survives item and section moves.
- [ ] Section and item directional menus refresh availability and use the same relative-anchor persistence path as dragging.
- [ ] Header, sidebar, list, time-slot, new-button, and backlog updates remain correct after a move.
- [ ] Unknown/out-of-meeting/self anchors return 422 without partial section or position changes.
- [ ] Unsaved-change confirmation can cancel a drop without changing DOM or persistence.
- [ ] Dragging remains functional after each combination of morph updates.
- [ ] The meetings Dragula subclass and its Dragula-specific state handling are removed.
- [ ] Service/request, component, frontend, and feature tests cover section moves, item moves, cross-section moves, backlog/current-occurrence moves, collapsed state, active edits, invalid anchors, and post-morph dragging.

## Notes

While reworking the empty-meeting drop destination, migrate `MeetingAgendaItems::ListComponent`'s empty-state box (blankslate + inline new-item form, rendered only when the meeting has no items and no sections) from `border_box_container` to `OpenProject::Common::BorderBoxListComponent`, using the free-form empty-state content mode from <mention class="mention" data-id="DREAM-888" data-type="work_package" data-text="#DREAM-888">#DREAM-888</mention>. This is the last <mention class="mention" data-id="DREAM-697" data-type="work_package" data-text="#DREAM-697">#DREAM-697</mention> candidate; it was deliberately not migrated there because it needs that slot and this Work Package owns the surface.

The sections and agenda-items lists stay on bespoke Box markup in this migration: preserving in-section edit state, the collapsed backlog and the current-occurrence destination is the documented strong reason under the BorderBox consolidation goal. Re-evaluate a port to BorderBoxListComponent in a follow-up once this migration has landed.
