feat: Arrows to navigate search results while in a document
This is an attempt to fix #3612.
When relevant, list of documents are attached a search_query field, containing the query that got them, with bounds centered on them.
Then, when a document is displayed, we are able to get "previous" and "next" documents and generate arrow buttons. We can also generate a list of results "a search navigation box".
A screenshot:
Questions/warnings/things to improve:
- I will need some help with the visual design!
- When visiting a waypoint, we can click on an associated route and the "associated search" will be the one for all routes associated to this one. BUT: the routes are ordered alphabetically, which is not possible in search queries.
- Similarly, when visiting a waypoint and clicking on an associated route, the search query associated is for all activities. We could restrict it to the activity that was clicked.
Let me know what you think! In my opinion it is very useful to navigate a set of documents using arrows.
For the design, to be compliant with mobile, an idea is simply adding button at left of the title (with more spacing than on this design) :
But on mobile, we can also use the swiping to left or right.
the routes are ordered alphabetically, which is not possible in search queries.
No choice.
We could restrict it to the activity that was clicked.
Yes, good idea. To have all activities, click on "View all results" before viewing a route.
Thanks for your comments!
We could restrict it to the activity that was clicked.
Yes, good idea.
Ok, then I'll implement that soon!
For the design, to be compliant with mobile, an idea is simply adding button at left of the title (with more spacing than on this design) :
I might be seek for more opinion, maybe on the forum... I would prefer if the design seems liked by many before working on it!
But on mobile, we can also use the swiping to left or right.
I would prefer avoiding that. Some mobile browsers already use swiping to navigate in the history...
Superseded by #3807.
Closed, see https://github.com/c2corg/c2c_ui/pull/3807 instead