Content
View differences
Updated by Alexander Coles about 8 hours ago
### Context
https://github.com/opf/openproject/pull/26293 (#DREAM-941) brings `aria-rowindex`/`aria-rowcount` back after a drag-and-drop reorder in a saved, ungrouped query: once the drop is persisted, the table refetches its page and, when the collection lists the rows in the order on screen, replaces the results and recaptures positions in place. Two cases still withdraw every position until the next load:
- Grouped manually sorted queries: the refetch is skipped, because group counts can change with a cross-group drop and the group headers are not re-rendered in place.
- Unsaved manually sorted queries: their rows are ordered in the browser (`WorkPackageViewOrderService#orderedWorkPackages`), so the server's collection never lists them in rendered order.
### Goal
Positions return after a drop in grouped and unsaved manually sorted queries, without a reload and without a full re-render that replaces rows, focus or selection.
### Scope
1. Grouped manually sorted queries: refresh the group aggregates together with the results after a drop and recapture positions, keeping the collection-identity and grouped-aggregate validations.
2. Unsaved manually sorted queries: publish positions from the rendered order when the page holds the complete result set (manually sorted queries are forced onto one page), or derive them from the locally stored order; withdraw when neither holds.
### Out of scope
Expanded relation and children columns (#DREAM-942); sibling attributes (#DREAM-860); screen-reader verification (#DREAM-897).
### Acceptance criteria
- Vitest covers positions after a drop in a grouped manually sorted query, including a cross-group drop, and in an unsaved manually sorted query, plus withdrawal when the refreshed data disagrees with the rendered rows.
- `manual_sorting_spec.rb` asserts positions return after a drop in group mode and in an unsaved query without `visit_query`.
- #DREAM-885's axe checks stay green; frontend typecheck and touched-file lint pass.
### Hints for Reviewers QA
Group a manually sorted query and drag a row within a group and across groups: positions should return once the drop settles. Do the same in a new, not yet saved manually sorted query. Compare values with the accessibility inspector.
https://github.com/opf/openproject/pull/26293 (#DREAM-941) brings `aria-rowindex`/`aria-rowcount` back after a drag-and-drop reorder in a saved, ungrouped query: once the drop is persisted, the table refetches its page and, when the collection lists the rows in the order on screen, replaces the results and recaptures positions in place. Two cases still withdraw every position until the next load:
- Grouped manually sorted queries: the refetch is skipped, because group counts can change with a cross-group drop and the group headers are not re-rendered in place.
- Unsaved manually sorted queries: their rows are ordered in the browser (`WorkPackageViewOrderService#orderedWorkPackages`), so the server's collection never lists them in rendered order.
### Goal
Positions return after a drop in grouped and unsaved manually sorted queries, without a reload and without a full re-render that replaces rows, focus or selection.
### Scope
1. Grouped manually sorted queries: refresh the group aggregates together with the results after a drop and recapture positions, keeping the collection-identity and grouped-aggregate validations.
2. Unsaved manually sorted queries: publish positions from the rendered order when the page holds the complete result set (manually sorted queries are forced onto one page), or derive them from the locally stored order; withdraw when neither holds.
### Out of scope
Expanded relation and children columns (#DREAM-942); sibling attributes (#DREAM-860); screen-reader verification (#DREAM-897).
### Acceptance criteria
- Vitest covers positions after a drop in a grouped manually sorted query, including a cross-group drop, and in an unsaved manually sorted query, plus withdrawal when the refreshed data disagrees with the rendered rows.
- `manual_sorting_spec.rb` asserts positions return after a drop in group mode and in an unsaved query without `visit_query`.
- #DREAM-885's axe checks stay green; frontend typecheck and touched-file lint pass.
### Hints for Reviewers
Group a manually sorted query and drag a row within a group and across groups: positions should return once the drop settles. Do the same in a new, not yet saved manually sorted query. Compare values with the accessibility inspector.