Draft: Paginate GLQL analytics charts with a limit

What does this MR do and why?

Setting limit: on an analytics-mode chart or bar list used to fetch one page of that size with no way to reach the rest. It now shows Previous/Next controls and a range label (Showing 1 to 6 of 10), paging one limit-sized page at a time.

The three DAP Impact bar lists grouped by flow type adopt it: "Where credits went", "Sessions by activity" and "Users by activity". Flow types outnumber the six bars a list folds to, so their tails were rolling into Other (N) with no way to reach them. Their panels shrink to fit a page rather than a full list, and the Adoption view below "Users by activity" moves up to close the gap.

Prev replays the after cursor an earlier page used rather than sending before, which this connection pairs with first and resolves from the start of the result set.

Limitation: only charts grouped by one thing can page

One dimension means one bar per row, so a page is just fewer bars, each correct. Two dimensions means each bar sums several rows, so a page boundary can split one:

Claude GPT
Everything 1000 500
Page 1 800 –
Page 2 200 400

Claude appears twice at two wrong totals, both looking finished. So those charts, plus stat and every heatMap, keep auto-pagination: full set, correct bars, no controls. That also fixes the same split on master today, where two dimensions plus a limit: renders one partial page.

Follow-up: paginate analytics charts by dimension value rather than by result row proposes lifting this in the query layer, which is where it belongs rather than here.

References

Screenshots or screen recordings

Where credits went Sessions by activity Users by activity

How to set up and validate locally

gitlab:duo_workflow:populate seeds only three workflow definitions, so widen workflow_definitions in ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake first, then run it and open the DAP Impact dashboard.

  1. Sessions by activity shows six bars, Showing 1 to 6 of N, Previous disabled.
  2. Next replaces the rows, enables Previous, and moves the range on.
  3. The last page disables Next. No Other row appears on any page.
  4. A single-page result renders no controls and no empty footer.
  5. display: table with a limit: still shows Load more, unchanged.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

The pipeline was skipped on push to save CI resources, so a full pipeline is needed before this can merge.

🤖 Generated with Claude Code

Edited by Rudy Crespo

Merge request reports

Loading
Loading