-
Notifications
You must be signed in to change notification settings - Fork 189
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
ordering: implement in item list #2811
Conversation
90a8e8d
to
28d2753
Compare
I think this broke the frontend tests. |
Hm, when I run |
I'm not able to find out what is even failing...
That line of code isn't even in I can't make the tests show what actually failed. 😬 |
@powerpaul17, @devlinjunker, do you maybe have some insight what went wrong? |
It seems to be an issue with the |
But meanwhile there are merge conflicts too. @wofferl, are you ok with my conflicting changes of those two files?
|
You should modify these files and add a fallback to the global setting store.state.oldestFirst when feed.ordering === FEED_ORDER.DEFAULT |
@wofferl, thank you for your answer. Could I please get a little more context? Lines 36 to 38 in 22cdb3c
You mean "take my version"?
Could you please elaborate on what we want to achieve? |
I mean this parts which have changed to this in master to use the global setting for ordering and which your commit changes to use the feed setting. The goal here is to first use the feed setting and fallback to the global oldestFirst when FEED_ORDER.DEFAULT is set for this feed. news/src/components/feed-display/FeedItemDisplayList.vue Lines 131 to 136 in 6603803
news/src/dataservices/item.service.ts Lines 89 to 101 in 6603803
And I think, this commit leads to another problem, that needs to be solved. The way the items actual loaded it will not load all articles with mixed ordering views. Eventually we need different lastItemLoaded states for each ordering. |
Signed-off-by: Patrizio Bekerle <[email protected]>
Signed-off-by: Patrizio Bekerle <[email protected]>
6c6f479
to
41d474b
Compare
Signed-off-by: Patrizio Bekerle <[email protected]>
@wofferl, thank you very much, should be implemented now.
I didn't even know we can keep different orderings in mind. |
Signed-off-by: Patrizio Bekerle <[email protected]>
Yes, and I don't know if it is really a good idea to have such a feature, it don't make things easier. |
Even the thought of it scares me. 😁 |
Have you tested what happens when you are viewing mixed ordering feeds in Folder view or in All Article/Unread view? |
I currently don't even see the "All Articles" menu entry in the master branch. 🤔 The ordering while loading items in infinite scroll in "Unread" is a mess (older and newer items loaded by infinite scroll). In the pull request branch, the ordering of items in "Unread" is consistent (newest first). So, I guess, that's a big improvement. |
It only shows if you activate "show All articles"
You mean the date showing is a mess or in sense of the items where reordered during scroll. You can search this repository for ordering/sorting and you will find multiple topics over the last ten years why "real" sorting by date doesn't work. Here a simple example: You have two feeds, the fetcher download new items grouped by feeds. For example since you last have looked at your news, the fetcher has downloaded 40 items for each feed. When ordering oldest to newest you get 40 items ordered by item id from the backend, in this case item 1-40, you will only see the items from feed 1. At the end of this bunch the frontend requests another 40 (41-80), so you now get the items from feed2. Because the second bunch can have dates that overlap with the first bunch, sorting all 80 articles in the frontend, will now reorder the item array and you might need to scroll up to see unread articles of the second bunch. This also can confuse the logic to load new articles or which item is selected. So having different sortings (item id in backend and date in frontend) can not work. |
Here an example what I mean. This is how my feed looks like after reading the first 40 articles, navigating with shortkey, with your actual version. The new articles where inserted everywhere, which is chronologically correct, but disturbs the flow of reading. There are also now unread items where I need to scroll back and the selected item is no longer selected. |
Yes, the feed wasn't ordered anymore after scrolling. I don't know how to deal with the issue properly. 🤷🏻 |
It depends on what you want to achieve. A “real” sorting by publish date will not work without major changes in the API and the backend. It actual will only work by item id, which corresponds to the date when an article is added to the database. So I would change a.pubDate back to a.id as it is currently in the master and then test how it will behave if you have several different sorted feeds with items > 100. Especially when switching between different views. |
Signed-off-by: Patrizio Bekerle <[email protected]>
Fine with me, done. |
Since this.config.ordering is only valid for feeds I would suggest something like this to prevent ordering switching in folder or unread view:
But there is still some confusion with the ordering in mixed views. For example the default ordering is set to oldest->newest. |
Ok, this seems a general problem which exist in master too. I have created an issue for that. |
Thank you for testing! So I think this PR is "ready for merging" then? 😊 |
Summary
This pull requests now implements the ordering of feed item in the item list.
Checklist