[bug] Favorites are being rearranged by post date despite API serving by favorite date, messing up scrolling #391

Closed
opened 2024-05-15 05:52:06 +00:00 by lamp · 3 comments

Version

ed0b403c33

What were you trying to do?

browse my favorites

What did you expect to happen?

see my favorites sorted in the order i favorited them, without the ui going all herp derp and jumping all over the place

What actually happened?

it seems the frontend is sorting the posts by post date, despite the back end serving them in order of favorite date, which is causing the frontend to spazz out, as it puts oldest posts at the bottom, and then when you scroll near the bottom, posts of miscellaneous dates are inserted all over the list, pushing the content down, making it very difficult to get to the posts at the bottom as they keep getting pushed down. very annoying

Severity

I cannot use the software

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Version ed0b403c33 ### What were you trying to do? browse my favorites ### What did you expect to happen? see my favorites sorted in the order i favorited them, without the ui going all herp derp and jumping all over the place ### What actually happened? it seems the frontend is sorting the posts by post date, despite the back end serving them in order of favorite date, which is causing the frontend to spazz out, as it puts oldest posts at the bottom, and then when you scroll near the bottom, posts of miscellaneous dates are inserted all over the list, pushing the content down, making it very difficult to get to the posts at the bottom as they keep getting pushed down. very annoying ### Severity I cannot use the software ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
Member

I think the below should fix it. Can you confirm?:

diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index 1080462c..228ac2a5 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -314,7 +314,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
   })
 
   // Keep the visible statuses sorted
-  if (timeline && !(timeline === 'bookmarks')) {
+  if (timeline && !(['favorites', 'publicFavorites', 'bookmarks'].includes(timeline))) {
     sortTimeline(timelineObject)
   }
 }

There are some userId related checks before that though, if you’re actually running develop + the current iteration of your public-favourites patch its userID mangling might affect this too. On the other hand, if as suggested public favourites get added as a distinct publicFavorits timeline, some of the processing above the changed line probabaly also needs to be updated to treat them like favorites

I think the below should fix it. Can you confirm?: ```diff diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 1080462c..228ac2a5 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -314,7 +314,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us }) // Keep the visible statuses sorted - if (timeline && !(timeline === 'bookmarks')) { + if (timeline && !(['favorites', 'publicFavorites', 'bookmarks'].includes(timeline))) { sortTimeline(timelineObject) } } ``` There are some userId related checks before that though, if you’re actually running develop + the current iteration of your public-favourites patch its userID mangling might affect this too. On the other hand, if as suggested public favourites get added as a distinct `publicFavorits` timeline, some of the processing above the changed line probabaly also needs to be updated to treat them like `favorites`
Author

this works. favorites line is working properly

this works. favorites line is working properly
Member

this works. favorites line is working properly

thx, opened #392

> this works. favorites line is working properly thx, opened #392
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma-fe#391
No description provided.