-
Notifications
You must be signed in to change notification settings - Fork 137
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
Jump to Letter when scrolling, closes #125 #510
Conversation
Here's the proof of concept of the feature. Actually works very well. The thing is that if the letter is not on the actual page it does not scroll. |
Nice! Have you tried using this without a high-precision pointing device like a mouse? xD |
No, I haven't. BTW I did not think of any test or integration test, do you have any to edit and cover this? |
I honestly have no idea how to do this properly. Maybe there's a way to only fetch a very small amount of information for each track from Jellyfin, and we fetch the rest of the info when the items are scrolled into view? As for tests, there are none so far. Adding tests would of course be great, but so far no-one could be bothered to write any 😅 |
I think we can have leave as it is with this feature, as it does what the users want and seems reasonable. |
Looks good! I'll give it a try at some point, perhaps we can "keep scrolling" in hope of finding a letter that isn't currently loaded. As for tests, ...yeah. The current codebase is too spaghetti for tests to be written. @Chaphasilor's new QueueService looks like a good candidate for tests though, and new stuff should be modular enough to allow for easy testing. |
I'm just not sure if the PR actually solves the issue:
Since we don't load 600+ artists on a single page, pressing W would do... nothing? So it's not really a solution 🤔 @jmshrv do you know of a way to exclude certain fields from the API response? We don't really need the |
Yeah I'm not a fan of how Jellyfin does it. We could exclude fields when loading the list, but then we can't reuse that item elsewhere in the app (when tapping on an album/playlist, that item is directly passed to the detail view instead of us fetching two things). I think continually scrolling could work for letters that haven't been loaded yet, we could stop if we go past the letter (in cases where the user selects a letter that doesn't exist) |
With continually scrolling you mean the app just scrolls down as quickly as it can? I like that idea! |
It actually does, however if you want me to display the actual letters, I will do. |
It does? In the video you posted nothing happens when you click on "M" on the album screen 🤔 |
I have dealt with the pagination and it handles the element loaded. As soon I eat I will upload it. |
@Chaphasilor take a look, now all letters work, as they are in the buffer. |
Ah okay, so "unavailable" letters are just hidden, got it. I think I would prefer it the other way around though, were all letters are always shown and if you click on that's not in the buffer the app will scroll down multiple times until the needed page is loaded 😁 |
Hello @Chaphasilor and @jmshrv, take a look 😄 Scrolling.to.letter.webm |
That looks good! 😁 If I have the time I'll test it out once I get back home :) |
Just checked it out, it does work for the most part. The biggest problem is load performance, with a page size of 100 it takes ages to get to the correct position, but with bigger page size (250, 500) loading becomes slow and choppy. I'll send a video later. The other issue is that on some tabs the floating action button covers the letters on a small phone, maybe you could give the button a bit more padding or put it on the left side? |
@Chaphasilor I added some padding to the FloatingActionButton. I think we must define the scope of the task instead of throwing feature ideas 😄. Otherwise, this task will last forever. Also I added the search by the nearest letters if not found. |
@Guillergood you are right of course, and I don't want to overwhelm you with requests. In the end, @jmshrv needs to decide if we can merge this :) |
Found a small bug when no item for that letter exists, it will scroll to the bottom of the list first and then scroll to the right position shortly after. Probably waiting for an http request to complete? screen-20231015-204545.3.mp4(yes my playlists are a bit messy) |
Hello @Chaphasilor, test now. I have refactored it to have less code (and fewer possible bugs). Also, to manage the timer in a different stage. |
Just took another look, it seems fine. Performance is still poor, especially the scrolling to a letter when the full list is already loaded is pretty laggy. And if nothing is loaded yet and I want to scroll to the letter "M" on my album list, it takes roughly 20s to get there. It will work for small libraries, but even medium libraries will not be a great experience I'm afraid. |
We can always polish it later. Merged :) |
That looks great. Kudos! |
No description provided.