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
(I #2638) Feature to Goto a page directly #2639
(I #2638) Feature to Goto a page directly #2639
Conversation
2020-04-19 Update master
First implementation. Is functional.
Background-color for each « button » & validation for the page choice of the user: number, > 1 & < last & singular for a one page project.
Thanks a lot! I am thinking that as a user it might be more natural to go to a particular row or record number, since the pagination changes depending on the filters applied and the page size. |
Good question @wetneb. As a programer, I try to stay in the same logic that was there before. With the « page » concept, if you choose 2, and you go back one page with « previous », you end up strait with the first record at the top. I only mimicked the way the « last page » works, which takes into account the hidden rows. OpenRefine/main/webapp/modules/core/scripts/views/data-table/data-table-view.js Lines 500 to 508 in 1cdf81b
It really follow thru the current's OR logic, so I fell this way is less disruptive to the user. But I might be wrong. As with the other features I coded, my aim is to be as sure as possible it won't break. I know I'm not setting new marks in term of UI, but it's decent, simple, and… working. Also, no dirty tricks in the code, it really a lot on existing code/way OR works. Of course, there could be:
All beside each other. If you think this is the way, I'll code it. Regards, |
Yes, the API exposed by the backend is not really suited to go to a specific row at the moment: this would require backend changes. In terms of UI, if we just do it based on page numbers as proposed in this PR, I think we could potentially have a number input directly in the table header, which would show the current page number: the user could edit it directly and confirm with the Enter key or a small button next to it. Let's not rush this and ask @ostephens and @lisa761 what they think about it. |
We could circumvent having to change the API by bringing the user to the page that contains the row or the first row of the record. It wouldn't be the first row of the page, but the user would have what he wants.
Yes, in terms of UI, that would be better. I didn't choose that path because it's a little bit more complex to code, and much less robust, even if it's not important or with effects if it breaks. I also think we should consider this: by giving a small feature asked from a long time, effective even if in a basic form, we give value to the user at a minimal cost. Then, user usually feel entitled to come and comment about that (usually in the form: « thanks for this feature (…) but (…) ;-) ). Then, it's easy to get a feel of our user base, and act accordingly, with a possible incremental change in the next version. It gives a feeling to the user that they are listened to. And, in fact, it's not just a feeling, it's a processus and it's real. It might not seem like that to a seasoned developer on GitHub, but there is a step learning curve for a user not too tecky to come here and start to interact. It's a bit intimidating also.
Of course. Anyway, it's out now, and people can make their own mind and see if they like it! ;-) Best Regards, @wetneb, P.S. I feel I've now pushed enough features in the last month, and it's now time to pause. But… if I was to continue, the next feature on the path would probably be to let a user change the name of a facet. It's also something that could be done simply, and without too much risks of breaking, and that would help a good bunch of users, I feel. (That is also another feature that would be MUCH easier to code with a GenericFacet JS parent class…) But, instead, let's go in debug/testing mode for v3.4! ;-) |
Yes you have been incredibly productive, thank you very much! And I have the impression that you are tackling issues which are directly motivated by your own experience with the tool - those contributions are extremely valuable since they make a big difference to users. So thank you again! |
This would be nice to keep if we keep a toggle between infinite scrolling and pagination. It's a useful feature for the users and the code doesn't seem to introduce anything particularly hard to work with for scrolling. |
Changed from prompt() to <input type="number">, and visual X out Y.
Everything else works fantastic and this is a major improvement! |
If the user choose below 1, 1 will be displayed, and if the user choose above the max, the max page will be displayed.
Add pages after « of maxValue », calculate the width of <input> based on max value.
Little fix.
Hi @thadguidry,
Very interesting question. Yesterday, I coded so that if the user go over the max, that it sticks to the max. I coded it yesterday, it's now pushed to GitHub. I now did the same with the lower limit, that is, if you go below 1, it will stick at 1. I think this will solve the issue you are raising here. That code is now pushed.
Done.
Auto-size is difficult. It could be calculated… There. Did it. 20px + 8px per number.
Yes indeed. What would still be missing, is the i18n + TEMPLATING ! @wetneb, could you point me to an example of templating? Or a documentation link to implement it? I think I remember you talked about that in another issue.
Yes, I also think this would be great. I tried to implement it, but failed :-( Any suggestion as to what I should do? Trapping the key down, setting an internal variable to « refocusAfterChange == true » and then, after change, put back the focus? I'm dealing with internal browser behavior that I would have to modify… That maybe easier to ask than to code…
Thank you! I'm happy you like it. It's actually not much code for a lot of user benefit! You now have a new version to checkout! The ball is in your court. Regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it would be easier to just use the control attributes themselves?
<input type="number" id="something" name="something" min="1">
REF: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
Correct min and max for <input>
I think I did a mistake… I've put Regards, A. |
main/webapp/modules/core/scripts/views/data-table/data-table-view.js
Outdated
Show resolved
Hide resolved
Add managment to keep the arrow's key in the CurrentPage <input>.
main/webapp/modules/core/scripts/views/data-table/data-table-view.js
Outdated
Show resolved
Hide resolved
Fixes for Thad’s KeyDown's « Infinite Paging » & PageSize changes.
Code rehookCurrentPageInput & spacing for PageSize section
I will test it on Windows 10. Is that close to your setup, @wetneb? Also, I changed the way the delay was working, now, it really delay. Regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably because of the merge conflict. If you could undo the last commit, maybe I can take a look at the conflicts again? Because #2719 changed a lot of things with the table.
main/webapp/modules/core/scripts/views/data-table/data-table-view.js
Outdated
Show resolved
Hide resolved
Fix headerTable to tableHeader (PR OpenRefine#2719)
data-header-table to data-table-header
Remove .data-header-table-container
@wetneb: Window 10 This all seams good. Regards, |
Yeah, not on my Debian, but that's a cosmetic issue that should not be a blocker for @lisa761's work. |
@antoine2711 If this:
implies that you don't want to help test French plurals support, I really wish you'd reconsider, since I spent the time fixing it specifically for you. |
@@ -537,6 +537,7 @@ | |||
"core-views/view": "Aperçu", | |||
"core-views/extend-not-supported": "Ce service de réconciliation de supporte pas l'extension de données. Essayez de supprimer le service et de l'ajouter à nouveau. Si le problème persiste, contactez le fournisseur de service.", | |||
"core-views/to-text": "En texte", | |||
"core-views/goto-page": "$1 de $2 page(s)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pluralized the same way Spanish and English is.
Hi @tfmorris, please, when you see one of my action and you don't think it's inline with « OR standard » or your way of seeing things, do NOT assume it's true or it's my intention. You will have a better communications with me if you instead ask my thru a question. In this particular case, the reason I removed this (after putting IT BACK a few days ago), it's because @wetneb wanted this issue resolve fast for his GSoS. Also, I didn't want to make « noise » here about this, since it's not directly related. My intentions are to tackle this with PR #2717, where you will soon see me requesting your attention in order to fixed. From there, I will then fix this, also. From what I understand of you, you should like this way of working. Regards, |
…ne#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.
…#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 #570 * Revert "(I #2638) Feature to Goto a page directly (#2639)" Go back to simply displaying a range of row numbers, because that will enable a solution for #33, #570 and #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 #570, closes #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
…#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 #570 * Revert "(I #2638) Feature to Goto a page directly (#2639)" Go back to simply displaying a range of row numbers, because that will enable a solution for #33, #570 and #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 #570, closes #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
…#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 #570 * Revert "(I #2638) Feature to Goto a page directly (#2639)" Go back to simply displaying a range of row numbers, because that will enable a solution for #33, #570 and #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 #570, closes #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
…f the grid (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
…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
…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
…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
…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
…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
…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
(Closes #2638)
First implementation. Is functional.