# Code maintenance DREAM-838 - Improve BorderBoxTable and sortable-lists integration

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

## 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 | Product Backlog |
| Sprint |  |
| Backlog bucket |  |
| Module | Frontend components and Primer design system |
| Accessibility | Yes |
| List | a11y report 2027 |
| Labels |  |

## Estimates and progress

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

## Description

## Purpose

Provide a documented, tested integration of sortable-lists with OpPrimer::BorderBoxTableComponent for [DREAM-839](https://community.openproject.org/wp/DREAM-839), [DREAM-840](https://community.openproject.org/wp/DREAM-840) and <mention class="mention" data-id="DREAM-793" data-type="work_package" data-text="#DREAM-793">#DREAM-793</mention>. Coordinate with <mention class="mention" data-id="DREAM-671" data-type="work_package" data-text="#DREAM-671">#DREAM-671</mention> and [DREAM-837](https://community.openproject.org/wp/DREAM-837).

## Existing foundation

<mention class="mention" data-id="DREAM-786" data-type="work_package" data-text="#DREAM-786">#DREAM-786</mention> is closed and established tag-independent source-row handling. BorderBoxTable already exposes container_data, rows_container_class and row_data. Its data rows live in a div.op-border-box-table--rows with role=rowgroup; the header and footer also have rowgroup roles. The list controller defaults to :scope > ul, so relying on that default or selecting the first role=rowgroup is incorrect for this table.

## Scope

Reuse existing hooks and the configurable rows-container selector. Add only the shared component support actually needed to avoid consumers copying the table template. Keep sortable-lists opt-in. Manual row ordering is separate from sorting records by a column; do not repurpose sortable? without checking its existing TableComponent contract.

## Acceptance criteria

- [ ] A real BorderBoxTable Lookbook example wires the root, list, data rows, handles and move menu through the shared suite.
- [ ] Data rows alone participate in ordering. Header/footer/pagination and blankslate rows never become sortable items or predecessor anchors.
- [ ] Drag previews preserve readable multi-column content; drop indicators and optimistic placement stay inside the data rowgroup and preserve table semantics.
- [ ] Menu-based reordering is keyboard accessible, announces moves and restores focus. Interactive row controls do not accidentally start dragging.
- [ ] First/middle/last moves, single-row and empty states, failure rollback and repeated moves after Turbo morph reconciliation are covered.
- [ ] Relative-anchor requests and explicit server-response policy remain unchanged; domain-specific validation stays with consumers.
- [ ] Non-sortable tables remain unchanged; existing list consumers remain covered by regression checks.
- [ ] Lookbook table and drag-and-drop guidance distinguishes manual reordering from column sorting, explains the rows-container selector, and shows the supported hooks.

## Boundaries

Shared menu descriptor ownership stays with <mention class="mention" data-id="DREAM-775" data-type="work_package" data-text="#DREAM-775">#DREAM-775</mention>. Paginated status menus retain their server-backed cross-page behavior from <mention class="mention" data-id="AUTOWORK-285" data-type="work_package" data-text="#AUTOWORK-285">#AUTOWORK-285</mention>; do not substitute loaded-row-only client menu gating. Resource Planner persistence belongs to <mention class="mention" data-id="DREAM-793" data-type="work_package" data-text="#DREAM-793">#DREAM-793</mention>. This ticket does not rebuild the drag engine or introduce native-table/DataTable infrastructure.
