Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve pagination after actions which trigger a grid update #6546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wetneb
Copy link
Sponsor Member

@wetneb wetneb commented Apr 18, 2024

This is a backport of #5411 to the master branch. Closes #33, closes #570, closes #572 (already marked as such by #5411).

For this one, although the change was sort of forced on me by the new architecture, it can be backported with reasonable effort to the master branch.

Summary: this changes the grid pagination so that users to not input a page number, but the index of the first row in the view. Why do this?

It's a change that has implications for the UI and the web API (which is not meant to be stable).
It relies on manually annotating all operations with row/record preservation. In this PR it is done in the frontend, but further backend changes will move this information to the backend (making it possible to detect the row/record preservation of sequences of operations run via the apply-operations command, for instance).

One oddity of this change is that in records mode, the pagination is still done based on row ids and not on record ids. This is intentional, because:

  • it would make it possible to switch between rows and records mode while preserving pagination (although this is not enabled so far)
  • so far, the new architecture drops the notion of record ids and uses the starting row index instead. This is primarily for performance reasons, as it enables more efficient record grouping.

@github-actions github-actions bot added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. Priority: Medium Represents important issues that need to be addressed but are not urgent Theme: UX/Usability Focuses on issues related to improving the overall user experience and interaction flow. Module: Frontend These issues involve working on HTML, CSS, and JavaScript code that affects the user interface. reconciliation Related to the reconciliation operations and other features undo/redo/history issues related to undo or redo or history operations records grid pagination / scrolling About scrolling through the rows via pagination or potentially seamless scrolling labels Apr 18, 2024
@wetneb wetneb force-pushed the 33-pagination-fixes branch 3 times, most recently from 342226d to 5cb17af Compare April 19, 2024 09:02
…OpenRefine#5411)

* Adapt the GridState interface to separate sorting and pagination.

This adds `getRowsBefore` methods, counterpart to the existing pagination
methods, so that we can do efficient and correct pagination, solving #33 and OpenRefine#570

* Revert "(I OpenRefine#2638) Feature to Goto a page directly (OpenRefine#2639)"

Go back to simply displaying a range of row numbers, because
that will enable a solution for #33, OpenRefine#570 and OpenRefine#572.
This reverts commit d7aaac2.

* Do not move back to the first page when applying an action which refreshes the grid.

Instead, the current page is refreshed.
This closes #33, closes OpenRefine#570, closes OpenRefine#572.

* Specify which actions preserve row and record ids

This lets us preserve pagination only when it is guaranteed to show the same
part of the data after the operation.

* Make paging user-editable like before

* Adapt cypress tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid pagination / scrolling About scrolling through the rows via pagination or potentially seamless scrolling Module: Frontend These issues involve working on HTML, CSS, and JavaScript code that affects the user interface. Priority: Medium Represents important issues that need to be addressed but are not urgent reconciliation Related to the reconciliation operations and other features records Theme: UX/Usability Focuses on issues related to improving the overall user experience and interaction flow. Type: Bug Issues related to software defects or unexpected behavior, which require resolution. Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. undo/redo/history issues related to undo or redo or history operations
Projects
None yet
1 participant