tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.41k stars 384 forks source link

Remember position #89

Open papjul opened 7 years ago

papjul commented 7 years ago

A feature I miss from Twidere is the ability to remember position in a tab. When you refresh the tab, you have to go through all new toots to get back to where you stopped reading. Users should be able to choose if they want to stay in position and have new toots appearing just above. Thanks,

iGEL commented 7 years ago

I'd :heart: if it would also remember the scroll position over application restarts. It should basically start from the last completely seen post. This was the main reason I dumped the official Twitter client (it did this most of the time, but not always) and bought Flamingo.

charlag commented 6 years ago

I think this requires a lot of work, this means saving toots to the disk (DB e.g.). I feel you and I would like to have it but it means rewriting quite a lot. So, @connyduck , are you sure it's okay to have this for 1.3.0?

connyduck commented 6 years ago

Yes, this is not a really easy task, but in my opinion really important for good user experience. I will not block the 1.1.3 release if it is the only thing not done though.

penduin commented 6 years ago

+1 for very much wanting this.

i don't understand the "saving toots to disk" business. upon loading a new batch, we'd like to jump to the scroll position of the oldest item we just loaded. maybe that's not as simple as it sounds?

charlag commented 6 years ago

@penduin ah, I misunderstood what users want. What I see is bigger feature when you see your timeline in the state you left it when you open the app (like @iGEL said). I think we can fix what you want pretty easily but it's much harder to save position after restart/switching tabs.

penduin commented 6 years ago

Oh cool! For me personally, a quick+dirty version would go a long way.

That extra stuff would be neat too, of course, but if the 90% case can be solved without tons of work, that would be amazing. :^)

On 10/26/17, Ivan Kupalov notifications@github.com wrote:

@penduin ah, I misunderstood what users want. What I see is bigger feature when you see your timeline in the state you left it when you open the app (like @iGEL said). I think we can fix what you want pretty easily but it's much harder to save position after restart/switching tabs.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Vavassor/Tusky/issues/89#issuecomment-339772620

Miklostibi commented 6 years ago

Wouldn't a middle option be more appropriate? Saving the currently loaded toots, and caching the latest 20~or so and the rest between being loaded lazily?

achilleas-k commented 6 years ago

Does anyone know how Twitter apps with TweetMarker support do it?

GregSutcliffe commented 6 years ago

Huge +1 for this, it's pretty much the only thing I miss from Twidere - which loads the latest tweets and then adds a "Load More" button above the current position if there's more, I.e

[New tweets] <-- load more --> <-- current position --> [Old tweets]

That's assuming you scrolled to the top and then pulled-down to refresh the timeline, so you're always at the "latest" position before loading new things. Something similar in Tusky would be amazing.

Thanks for the excellent work either way, Tusky is great ;)

semente commented 6 years ago

In Twidere this feature is called "Read from bottom". It simply don't move the position to the top of the timeline when you refresh the tab. It doesn't mean it will fetch all the intermediate toots, there is a configurable limit and a button to load more intermediate toots if you wish, as @GregSutcliffe mentioned.

charlag commented 6 years ago

Y'all, we want it,it's just a complex thing but @connyduck says it's planned right after pinned statuses & other profile improvements

IzzySoft commented 6 years ago

@charlag as you already wrote before: it would be nice if at least it remembered the position when doing a manual refresh. That'd be at least something. Sure it'd be even nicer to survive reboots – but please don't delay the "easy part" just because the other one is more complicated.

Apart from that: maybe peek into the other Mastodon clients and see how they've solved it (if they did – I'm pretty new to Mastodon and haven't tried other apps yet). There's e.g. Mastalab, Subway Tooter, AndStatus, Twidere, 11t, Mastobone, twilatte, MouseApp, Troutoss, Toot

charlag commented 6 years ago

@IzzySoft I've implemented a thing which can remember you position during refresh now (it's not merged yet) but I've made it scroll to top if you refreshed manually and you're on the top. We can think about making it a preference.

IzzySoft commented 6 years ago

Sounds good, thanks! Looking forward to it getting merged and released.

If you make it a preference, please consider it trinary state: 1) "always jump to top" (as it is currently), 2) "always keep position" (i.e. regardless on whether I was at the top), 3) "keep postition if not already at top".

My preference would be 2) – as usually I am at the top when I refresh, and that's where I want to continue reading: with the toot next to the one I've seen before the refresh (so as long as that is there, I'm happy even if it's not trinary).

To add some logic: 3) should rather be "when not at top, jump to the pace that was top before the refresh" – makes much more sense to me :wink:

charlag commented 6 years ago

It all kinda makes sense to me, thanks for your input. I'd rather have one nice behavior rather than 3 of them, even if it's trivial to implement but I don't see how it's possible right now. Let's try different solutions after #562 is merged

IzzySoft commented 6 years ago

Sure, @charlag – every big journey starts with a single step :wink: If by that "one nice behavior" you're referring to my second perspective aka "2)" I won't nag :rofl: But even if it is "keep position unless you're on top", a work-around would be scrolling down a little before refreshing. Ahem, wait: how should that work with "pull to refresh"? I see no other way to refresh (no button or something). And when you pull to refresh, you must be at the top. :confused:

charlag commented 6 years ago

You could change position while it loads

IzzySoft commented 6 years ago

If I'm fast enough :rofl: OK, yes, I can try that (didn't think of it, thanks!)

ahihi commented 5 years ago

any news on this, especially the part about saving position across app restarts?

just opening a link often causes Tusky to be shut down on my phone… :(

charlag commented 5 years ago

Sorry, I'm terribly slow with my caching PR! I have an idea how to solve the main problem but it needs some work. I will try to work on this more in the following weeks. It's really not easy at all but maybe we can have minimal implementation which remembers only one part (where you closed it)

IzzySoft commented 5 years ago

Just as a note, @charlag: for me, the problem no longer exists for a couple of versions already. When I refresh, the current tab keeps it position. It's only when I get a notification from Tusky (e.g. someone @mentioned me) and I tap it that the "main tab" (timeline) doesn't keep its previous position if there meanwhile were new posts. So for me, it went from "quite annoying" to "minor disturbance" :wink:

semente commented 5 years ago

Yea, it is much better now. But besides the issue pointed by @IzzySoft I really appreciate a Read from Bottom option, so when I press the "Load More" button (to fetch intermediate toots) it doesn'tt send me to the top of the timeline once I prefer read chronologically. Also it will make sure I won't miss any toot once I will know exactly from where I stopped reading the timeline.

IzzySoft commented 5 years ago

@semente that's exactly how it works for me since a couple of releases: when I pull to "load more", the post I'm looking at stays at where it is, and I can continue bottom-up.

semente commented 5 years ago

hey @IzzySoft! I didn't proper explain my issue. The toots loaded after I press the "Load More" button goes below my position, so I have to scroll down until the point I was to be able to read all new loaded toots. It indeed do not send me to the top of the timeline but it load the toots below my position. I would them being loaded above my position so I don't need to scroll down to read them ;)

IzzySoft commented 5 years ago

@semente that was what I originally complained above – and which is solved for me for a while already: new toots load above and no longer push down the "current toot", so I wonder if you use the latest version? Or maybe there's a difference between pressing the "load more" button and "pull to update"? Could you try the latter (i.e. when on the latest toot, pull as if there were one more)?

semente commented 5 years ago

@IzzySoft Yea, I do use latest version. :)

Or maybe there's a difference between pressing the "load more" button and "pull to update"? Could you try the latter (i.e. when on the latest toot, pull as if there were one more)?

Yes, when I press "Load More" it doesn't behave as "Pull to Update". You can easily reproduce this in the Federated Time in an instance with lots of connected instances:

IzzySoft commented 5 years ago

@semente Ah, now it's clear what different things we were talking about :rofl:

@charlag Could you please check to use the same logic on the "load more" that is used on "pull to refresh"?

charlag commented 5 years ago

Pull-to-refresh is expected to move user to bottom. That's the default behavior everywhere I've seen. I don't have a strong opinion about "load more", I guess we don't do anyrhing manually and the list will likely to expand below by default.

kjhoerr commented 5 years ago

To add to this in reference to the "Load More" button, in my experience it will keep the user at the top if there is a toot visible above the button. If the button is at the top (the line above the button is not even visible), then when the toots are loaded it will move the user to the bottom.

It certainly isn't intuitive, although if the two options were to be kept (user @ top v. bottom when "Load More" pressed) there should be some better visual indication of this.

charlag commented 5 years ago

Loading "above" is hard to implement right now due to Mastodon api woes. Once "min_id" API is widely supported we can return to this

jangliss commented 5 years ago

I wonder why there is a since_id and min_id. Without trawling through the code, they appear to offer the same functionality, but the API verbiage says "immediately newer" for min_id but just "newer" for since_id. When was each introduced? Any ideas why two properties? Could one be used over the other? I also use Mastalab that seems to remember where it was and how to fetch new toots.

charlag commented 5 years ago

They're restrictions. When you say "I want toots newer than this one" the server can say "okay here are the newest toots" or it can say "here are the toots right after toot you asked".

guntbert commented 5 years ago

I am not sure which of the variants I should request: I once more want to compare with twidere: there exists a setting/preference read from bottom. That means that whenever I leave the app it saves the current position (maybe the ID of the top displayed tweet/toot) and whenever I come back it reopens at the same post, regardless if there has been a refresh in the mean time.

klausi commented 5 years ago

@connyduck confirmed to me that this feature is planned for tusky 6, yay!

I threw in some $$ at https://opencollective.com/Tusky and mentioned this issue to conny. Maybe others want to do the same to put some motivation on this issue? 😀

charlag commented 5 years ago

@klausi hey, thanks for the support and perhaps it is the wrong place to discuss it but... I personally myself bounded not by motivation by but meatspace and energy. And second, I am against the sponsored features. People who don't have money deserve care as much (or perhaps more) as those who do and this will be my reasoning. I am completely fine with someone using it as they job and implementing it in this way but that's just not how it works for me at least now. Thanks for listening.

klausi commented 5 years ago

@charlag sure, thanks for your contributions! I want to pay someone to implement this feature, thought l go to the core developers first instead of hiring an external android developer. Then conny pointed me to opencollective, so I thought this is how you want to receive money?

We could also set up an external gofundme and hire a developer instead? Since it was already decided that this feature will be implemented now it is just a matter of planning and implementing?

charlag commented 5 years ago

I have nothing against open collective, thanks for your support a lot! I don't manage it but my guess would be that if someone would have interest in taking the task it can be arranged. I just wanted to say my thoughts and motivations, that's all. I don't like motivation boosts but I also don't take time from work to work on Tusky, as others do.

klausi commented 5 years ago

Update: with the timeline caching changes this issue is fixed for me, thanks a lot! Since a couple of versions Tusky does not jump around when I open it and I can read on where I left off.

morremeyer commented 4 years ago

I can confirm what @klausi reported, but it still jumps when loading in the middle of the timeline (with the "load more" button).

charlag commented 4 years ago

@mauricemeyer I've seen a really cool idea in one of the iOS apps but I can't remember which one, maybe it was Toot!. It was basically that if the gap is in the upper side of the screen it would say "load above" and if it's in the bottom side it would say "load below" We"ve been also missing min_id API support for that but now it's already very widespread so I think it would be cool to do something like that.

iGEL commented 1 year ago

Just to throw in my idea, how I think I would go about implementing this. The chances are high that I'm missing something or you already though about this and discarded this idea.

I assume, you have a timestamp for each toot when it either was created or boosted to determinate it's order in the timeline. My idea is to remember the timestamp of the last fully visible toot for each account. To restore the position, you "just" need to determinate the position of the toot with that timestamp (or an older one, if it got deleted) and reset the scroll position.

This obviously doesn't restore the 100% exact position, since users don't scroll exactly to fully visible toots, but I think it might be even more useful than the last mid-toot position.

modelmat commented 1 year ago

The markers API is similar: https://docs.joinmastodon.org/methods/timelines/markers/

nondeterminischtick commented 1 year ago

Whoever figures this out will be my hero. Losing position on 'load more' is pretty much the only frustration in the app.

On Fri, 11 Nov 2022, at 6:01 AM, modelmat wrote:

The markers API is similar: https://docs.joinmastodon.org/methods/timelines/markers/

— Reply to this email directly, view it on GitHub https://github.com/tuskyapp/Tusky/issues/89#issuecomment-1311264969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOYAVFOU7YFBXD6XHISNDWHXOLFANCNFSM4DG2L4QQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

guntbert commented 1 year ago

The weird thing - also sort of workaround: when I click on 'load more' and immediately scroll the cards so that 'load more' is above the visible area I get keep my position - but this can get pretty tedious... :smiling_face_with_tear:

nondeterminischtick commented 1 year ago

Thanks for the workaround. Works a treat.

On Fri, 11 Nov 2022, at 10:38 PM, Guntbert Reiter wrote:

The weird thing - also sort of workaround: when I click on 'load more' and immediately scroll the cards so that 'load more' is above the visible area I get keep my position - but this can get pretty tedious... 🥲

— Reply to this email directly, view it on GitHub https://github.com/tuskyapp/Tusky/issues/89#issuecomment-1312243212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOYASBFUAO4TFYQ4FPYF3WH3DG7ANCNFSM4DG2L4QQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

MattJeanes commented 1 year ago

Yeah this is absolutely my biggest issue with Tusky, I (and I'm sure many others) like to read every single post and when I come back to the app I want to be where I was, this seems to mostly work but the load more button normally throws you right out of position and you've got to go looking for the last post you remember seeing and then continue scrolling up again

s427 commented 1 year ago

The problem with the workaround is, if your server is a bit slow, you have no way of knowing when the new posts have finished loading. If you scroll back up too soon, you lose your position again when they appear.

The weird thing - also sort of workaround

nikclayton commented 1 year ago

Working on this in https://github.com/tuskyapp/Tusky/pull/3000

guntbert commented 1 year ago

@nikclayton great news - thank you! Is there any way I can give assistance?

nondeterminischtick commented 1 year ago

Latest version of Tusky has a Reading Order setting in Preferences that seems to solve any issues I had, especially around the 'Load more' functionality.