When searching, allow user to go back to results past 0 (last result)
This issue is duplicated in the Ketida repo: https://gitlab.coko.foundation/ketida/ketida/-/issues/576
Context
The Ketida and OEN versions of the Wax editor have a useful search feature. How it currently works is that I click the search icon or ctrl F (cmd F on Mac) and type or copy paste text to find into the search bar. The number of results are then shown and I can cycle forwards to each result by clicking the next button:
What if I have 200 results in a chapter and I know the result I'm looking for is near the end? It would be useful to go to result 200 first, and cycle backwards. Currently, even though the previous button looks clickable when you're at result 0 or 1, clicking the previous button doesn't result in a change in the editor. In the case of 200 results, at position 0 or 1 I would expect to go back to result 200 by clicking the previous button.
A workaround for this use case, is to put your cursor lower down in the chapter and cycle forwards with the search bar to see only results near the end of the chapter. But cycling backwards past 0 is a nice feature if possible.
To elevate this further, to make the search feature more keyboard friendly, allow Ctrl G (and Cmd G on Mac) to cycle to the next result, and Shift Ctrl G (Shift Cmd G on Mac) to go to the previous result. (By the way, Windows and Linux people please confirm the shortcuts usual practice in browsers and text editors on because I'm not sure.)
Proposal
- At the top of a document the user presses Ctrl F
- The total number of results are shown
- If they click previous they go to the last result
- The usual forward and backwards functions still apply, but allow Ctrl G (and Cmd G on Mac) to cycle to the next result, and Shift Ctrl G (Shift Cmd G on Mac) to go to the previous result
Design
[Include sketch or wireframes of the UI changes necessary for this feature]
Implementation (if applicable)
[A description of the steps to implement the feature.]
Alternative approaches (if applicable)
[Include any alternatives to meet this use case.]
Open issues (if applicable)
[Links to and a discussion of related issues, if applicable.]