Repository navigation
Conversation
myabc
added this pull request to stack #25836
October 24, 2026 20:10
myabc
force-pushed
the
feature/dream-941-row-position-metadata
branch
from
October 24, 2026 20:14
ae661e2 to
2d9cb9e
Compare
myabc
force-pushed
the
feature/dream-941-row-position-metadata
branch
from
October 24, 2026 20:40
2d9cb9e to
e915a11
Compare
myabc
commented
Oct 24, 2026
myabc
commented
Oct 24, 2026
myabc
commented
Oct 24, 2026
myabc
force-pushed
the
feature/dream-941-row-position-metadata
branch
from
October 24, 2026 21:52
e915a11 to
cc4fc80
Compare
myabc
force-pushed
the
feature/dream-941-row-position-metadata
branch
from
October 24, 2026 21:59
cc4fc80 to
0643b94
Compare
myabc
marked this pull request as ready for review
October 24, 2026 21:59
myabc
force-pushed
the
feature/dream-941-row-position-metadata
branch
from
October 24, 2026 22:51
0643b94 to
32fd953
Compare
1 of 3 tasks
Adds WorkPackage::HierarchyRowPositions, which numbers every result of a hierarchy query and every visible contextual ancestor in depth-first order. Sibling subtrees follow the earliest query rank of any matching work package they contain, so a child ranked before its parent pulls the parent's subtree forward. Each row's parent is its nearest visible ancestor, matching the ancestor chain the frontend renders. A result the user can no longer see, as a historic query may return, is numbered as a root, so the numbering discloses no current parent of a work package the collection itself redacts. Asking for a row the numbering does not know returns nothing, so a work package that stopped matching between paging and numbering cannot fail the request. https://community.openproject.org/wp/DREAM-941
Adds rowCount and rowPositions to work package collections in hierarchy mode. rowCount covers every result and every visible contextual ancestor of the whole query; rowPositions gives each row on the page, and each ancestor it renders under, its global position and nearest visible parent. Both are computed from the scoped result set and omitted above 10,000 results, where numbering the whole query costs too much per request, or when the page holds a row the numbering does not know. https://community.openproject.org/wp/DREAM-941
Renders each hierarchy page depth first, with sibling subtrees ordered by the earliest rank of any result they contain, so a child ranked before its parent no longer defers until the parent appears. When the collection carries row positions whose parents agree with the rendered ancestors, the page follows those positions instead, which keeps it in the query-wide order when a subtree spans pages. The same order applies to every hierarchy table, Gantt and embedded tables included. https://community.openproject.org/wp/DREAM-941
Lets TableRowPositions publish aria-rowindex and aria-rowcount in hierarchy mode from the collection's rowCount and rowPositions. The collection must still list the rendered results in order, every rendered row must have an entry, every edge of a result's visible ancestor chain must match the collection's parents, and positions must rise in rendered order; anything else withdraws the whole family. The renderer only orders a page by the positions under the same condition, so a reorder rendered before its collection arrives keeps its new order. Rows read their ancestry from the work package cache they re-render from, so a cache that is newer than the collection never mislabels rows, whether a row refreshes or the positions are recaptured later. Expanded relation columns still withdraw positions. https://community.openproject.org/wp/DREAM-941
Refetches the current page of a saved, ungrouped query once a drop has been persisted. When the refetched collection lists the rows in the order already on screen, it replaces the results and the positions are recaptured in place, so they come back without a reload and without a second render that would replace rows, focus or selection. Recapture reads each row's ancestry from the work package cache, so a row that moved while the refetch was in flight keeps the positions withdrawn. A render that was still pending when the results changed recaptures at commit. A failed refetch, a different order, a grouped query or an unsaved query leaves the positions withdrawn as before. https://community.openproject.org/wp/DREAM-941
Asserts positions in hierarchy mode instead of their absence, keeps the collapsed descendants' slots, numbers a contextual ancestor once across two pages, and expects positions to return after a drop without revisiting the query. https://community.openproject.org/wp/DREAM-941
myabc
force-pushed
the
feature/dream-941-row-position-metadata
branch
from
October 26, 2026 03:52
32fd953 to
edc685b
Compare
This branch has not been deployed
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 stacked on #26291 (DREAM-938, global row positions). Please review/merge that PR first.
Ticket
https://community.openproject.org/wp/DREAM-941
What are you trying to accomplish?
tl;dr for humans: The default views show work packages as a tree, where only the server knows how many rows come before a page; this has the API send those positions so screen readers can announce "row X of Y" there too.
DREAM-938 withdraws positions in hierarchy mode because pages insert ancestors the results do not describe. The API now returns
rowCountandrowPositionsfor hierarchy collections, every hierarchy table renders in the canonical order, and the list view publishes positions in hierarchy mode, across pages and after a drop.What approach did you choose and why?
WorkPackage::HierarchyRowPositionsorders results and visible ancestors depth first; sibling subtrees follow the earliest rank they contain ([Child, Other, Parent]→Parent, Child, Other). Pages keep their membership, so positions can have gaps.{ position, parent }), since ancestors are not in_embedded.elementsand a work package has one place in the tree. The frontend withdraws positions when its rendered tree disagrees.For discussion:
Not covered: expanded relation and children columns (DREAM-942); drops in grouped or unsaved manually sorted queries (DREAM-943).
AI involvement
Collaborative – AI generated a substantial part of the code; I reviewed and understand every line.
Merge checklist