Skip to content

[DREAM-938] Add global row positions for flat and grouped tables - #26291

Open
myabc wants to merge 8 commits into
feature/dream-885-treegrid-semanticsfrom
feature/dream-938-row-positions
Open

myabc wants to merge 8 commits into
feature/dream-885-treegrid-semanticsfrom
feature/dream-938-row-positions

Conversation

@myabc

@myabc myabc commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR is stacked on #26288 (DREAM-885, treegrid semantics). Please review/merge that PR first.

Ticket

https://community.openproject.org/wp/DREAM-938

What are you trying to accomplish?

tl;dr for humans: Screen readers can now say "row 57 of 120" in flat and grouped tables, counted across pages and collapsed groups, so users know where they are in a long list.

Adds aria-rowindex/aria-rowcount to flat and grouped tables. Positions are query-wide (page 2 keeps them), collapsed groups leave gaps instead of renumbering, and header, sums, totals, empty and creation rows count towards the total. Hierarchy mode follows in DREAM-941 (#26293); aria-posinset/aria-setsize wait for DREAM-860.

What approach did you choose and why?

Pagination and group metadata are captured with each render and applied only when it commits. The whole projection is validated first; anything it cannot vouch for (unsupported modes, stale collections, contradictory groups, unknown rows) clears the attributes instead of guessing. Tables without keyboard navigation are unchanged.

Hints for dev review

  • Default views use hierarchy mode; test with a flat or grouped query.
  • Positions clear while a relation or children column is expanded and during a drag; a failed drop restores them.
  • After a successful drop, and on unsaved manually sorted queries, positions stay absent until the next load. DREAM-941 ([DREAM-941] Publish row positions in hierarchy mode #26293) fixes this for saved ungrouped queries; the rest is DREAM-943.

AI involvement

Directed – I specified the requirements and AI implemented most of it; I validated via testing rather than a full line-by-line review.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@github-actions github-actions Bot added the ai: Directed 🪄 A human specified the requirements and AI implemented most of it; They validated via testing. label Oct 24, 2026
@myabc
myabc added this pull request to stack #25836 October 24, 2026 05:05
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./spec/features/work_packages/table/delete_work_packages_with_descendants_spec.rb[1:1:2]
🤖 Ask Copilot to investigate

Copy 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.

@copilot The following spec(s) are flaky in CI (first seen on PR #26291, linked for reference only):

- `rspec ./spec/features/work_packages/table/delete_work_packages_with_descendants_spec.rb[1:1:2]`

Treat this as a standalone task, unrelated to PR #26291. Create a new branch from origin/dev and open a new pull request targeting dev — do not stack it on PR #26291 or reuse that branch.

Follow the playbook in docs/development/testing/handling-flaky-tests/README.md to find the root cause and fix the underlying race — do not skip, delete, or weaken the spec to make it pass; disabling is a last resort per the playbook, and only with a bug ticket. Verify the fix by running the spec(s) repeatedly (e.g. `script/bulk_run_rspec --run-count 10`).

If you cannot reproduce the flake or are not confident in a fix after reasonable investigation, do not fabricate a change or skip the spec to force CI green. Instead, leave the pull request in draft and document what you tried, the suspected cause, and any leads in its description, then assign @myabc to take over.

Once the fix is verified, title the PR after the spec(s) it fixes, and use the PR description to explain the root cause, how the change resolves it, and the before/after results. Label the PR `flaky-spec`, assign @myabc, and request a review from @myabc.
On every commit, set @myabc as the sole co-author with a `Co-authored-by:` trailer (use their GitHub no-reply email so it links to their account), so it is traceable who dispatched the fix.

@myabc myabc changed the title [DREAM-938] Characterize hierarchy ordering for global positions [DREAM-938] Add global row positions for flat and grouped tables Oct 24, 2026
@myabc
myabc force-pushed the feature/dream-938-row-positions branch from b34ee4e to ffedd3b Compare October 24, 2026 05:59
@myabc
myabc force-pushed the feature/dream-938-row-positions branch from b5640d3 to 6ec3530 Compare October 24, 2026 17:57
@myabc
myabc marked this pull request as ready for review October 24, 2026 17:59
@myabc myabc added feature javascript Pull requests that update Javascript code needs review Accessibility labels Oct 24, 2026
@myabc myabc added this to the 18.0.x milestone Oct 24, 2026
@myabc
myabc requested a review from a team October 25, 2026 22:14
@myabc
myabc force-pushed the feature/dream-938-row-positions branch from 6ec3530 to ed11e52 Compare October 26, 2026 03:52
myabc added 8 commits October 26, 2026 14:32
Covers child-before-parent ordering with the parent both inside and
outside the query window, plus the parent-before-child case. Adds the
cache state accessor needed to exercise deferred insertion in the
existing table harness.

https://community.openproject.org/wp/DREAM-938
Adds validated pagination and group-prefix arithmetic for stable global
body positions and a draft-agreement check that confirms the rendered
rows follow those ordinals. Rejects contradictory, unsafe or negative
metadata.

https://community.openproject.org/wp/DREAM-938
Binds global positions to accepted render snapshots and validates the
complete table before publishing index and count attributes. Includes
structural rows, preserves collapsed gaps and clears unsupported or
contradictory projections. Children-column expansions withdraw the
family like other relation expansions. Staged drag moves repaint at
once, so the family clears while a row is out of rank order and
returns when a failed drop puts it back. A successful drop waits for
a collection in the new order.

Adds coverage for pagination, stale frames, group membership mismatch,
nested tables, children-column expansion, staged drag moves and
capability-off consumers.

https://community.openproject.org/wp/DREAM-938
Repaints global positions after Angular header, totals and creation
rows change exposure or content. Covers asynchronous schema updates,
replacement tables, permissions and active creation input identity.

https://community.openproject.org/wp/DREAM-938
Adds page-object helpers that assert the table's row count and every
exposed row's index in document order, or that both are absent. The
flat treegrid example now checks global positions including totals
and Create, their removal while a children relation is expanded and
their return once it collapses.

https://community.openproject.org/wp/DREAM-938
Checks global positions for group headers, group sums, totals and
Create in grouped mode, the stable gap left by a collapsed group and
the positions restored on expanding it again. Also checks that
hierarchy mode exposes no positions and that the empty-results table
counts the header, empty message and Create rows.

https://community.openproject.org/wp/DREAM-938
Adds pagination helpers for changing the page and the page size, and
checks in both project and global scope that a row on page 2 keeps
its query-wide position while the table count stays the same.

https://community.openproject.org/wp/DREAM-938
Checks that a drop on a flat table brings global positions back once
the reloaded query has rendered, and that a drop on an already
manually sorted query persists the order which the next visit exposes
with positions again. Transient states during a drop are covered by
the Vitest lifetime and row-positions specs.

https://community.openproject.org/wp/DREAM-938
@myabc
myabc force-pushed the feature/dream-938-row-positions branch from ed11e52 to 866679a Compare October 26, 2026 14:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessibility ai: Directed 🪄 A human specified the requirements and AI implemented most of it; They validated via testing. feature javascript Pull requests that update Javascript code needs review

Development

Successfully merging this pull request may close these issues.

1 participant