feat: implement item navigation when showing details in no-split or mobile mode
- Resolves: #3136
- Related: #2964
Summary
This PR will allow to navigate between articles when showing details in no-split mode or on mobile devices where no-split mode is forced. I open this as draft, because it needs some testing with different sorting and settings.
Currently implemented is after selecting an item, you can navigate between the items in the list with the shortcut keys or using the navigation arrows. When reaching the end of the actual loaded batch of items, more items are loaded just as it is when scrolling. Closing the details view will scroll the list to the currently viewed item.
There are also some open design questions:
Should there some indicator, where you are in the list? see debug text on right screenshot (x items of x items loaded). The problem here is that the frontend has no access to the info how much items are there in total.
Should changing the route (feed, folder, etc.) automatically select the first item when navigate from the details view?
Problematic is also when using the sorting newest->oldest. What to do when at the end of the list, when new items are available. Pressing 'r' would refresh the list and deselect the actual item. Should pressing 'r' refresh the list and open the first item in the list or simple go back to the list with the new items?
I changed also the icons and the position of the arrows to go in line with other apps with similar functionality like go through pictures in files app.
| Old: | New: |
|---|---|
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- Changelog entry added for all important changes.
Thx for that, i've tested it and it works well !
Should there some indicator, where you are in the list? see debug text on right screenshot (x items of x items loaded).
I don't think it's necessary.
Should changing the route (feed, folder, etc.) automatically select the first item when navigate from the details view?
Yes, that would fill the need expressed in https://github.com/nextcloud/news/discussions/3063 :)
I have rebased the PR and added new features:
- The status of the details view is now saved in the browser storage
- The details view is retained when switching feeds and the first item is automatically selected
- If the app is refreshed with “r” in the details view, the list is reloaded and the first item is automatically selected (this is particularly important when sorting newest>oldest)
As I have also modified the overall navigation and scrolling, this still requires extensive testing.
I have been using this version for over a week now without any problems. No idea if anyone else has tested it, but I think this can now be integrated.
The debug text has been removed from the article view and a button has been added to go back from the "No article selected" message to the list view.