mastodon-android icon indicating copy to clipboard operation
mastodon-android copied to clipboard

Add a setting for "Load missing posts behavior"

Open tinsukE opened this issue 2 years ago • 5 comments

It allows the user to, if they prefer, loading missing posts from the oldest post onwards (upwards).

I understand that new features should be suggested on the iOS app repo, vetted, planned, coordinated with a UX designer, and then implemented. But I was poking around the code, wanted to test how hard would it be to give it a try myself, and I think I came up with a good solution.

No new design/layout was added as I able to reuse the existing Settings framework. That being said, I made some UX decisions/assumptions:

  • [ ] No visual indication of current setting in the "Load missing posts" button. Putting arrows up/down would be an alternative
  • [ ] Placement of the setting: Settings -> Behavior
  • [ ] Setting icon: Vertical Align Center from Material Icons
  • [ ] Setting name: "Load missing posts behavior"
  • [ ] Value name: "Newest first (downwards)", the default and current behavior
  • [ ] Value name: "Oldest first (upwards)", the new behavior

One can easily (and repeatedly) test the feature by using the mock data from this branch: https://github.com/tinsukE/mastodon-android/pull/1

Boost this change so it gets more attention!

https://mas.to/@tinsuke/110991335369359509

Settings

Test builds

  • Debug build with the feature (you'll have to uninstall your currently installed version to install this one): mastodon-debug.apk.zip
  • Debug build with mock data (so you can reproduce the TL on the GIF below over and over): mastodon-debug-mock.apk.zip

Downwards (current, default) x Upwards (brand new)

load more

Fixes #154

tinsukE avatar Sep 01 '23 18:09 tinsukE

I wonder if this could be smarter to not require a setting… because I don't always scroll in one direction or the other. Like, could it track which direction you “came from” when you hit the “load missing” button, and then have it load them in in the opposite direction?

E.g. if I am starting from the top like I usually do, the app would load in missing posts below my current position, but if I was working my way back up from older to newer, it would load them above.

cassidyjames avatar Sep 01 '23 20:09 cassidyjames

I wonder if this could be smarter to not require a setting… because I don't always scroll in one direction or the other. Like, could it track which direction you “came from” when you hit the “load missing” button, and then have it load them in in the opposite direction?

E.g. if I am starting from the top like I usually do, the app would load in missing posts below my current position, but if I was working my way back up from older to newer, it would load them above.

i thought about that.. but.. like at the very least, there needs to be a visual indicator about the direction it'd load. maybe i'll do that!

sk22 avatar Sep 01 '23 20:09 sk22

I wonder if this could be smarter to not require a setting… because I don't always scroll in one direction or the other. Like, could it track which direction you “came from” when you hit the “load missing” button, and then have it load them in in the opposite direction? E.g. if I am starting from the top like I usually do, the app would load in missing posts below my current position, but if I was working my way back up from older to newer, it would load them above.

i thought about that.. but.. like at the very least, there needs to be a visual indicator about the direction it'd load. maybe i'll do that!

I think a good approach would be to build an "Auto" setting (maybe default?).

On this one, the app would keep track of your scrolling before tapping "load missing items" and then load up/down accordingly.

Indeed, having a visual indicator (arrow up/down?) inside the "load missing items" view, that would rotate up or down depending on your scrolling, would be a strong clue to the user about the behavior they'll trigger.

But the detection part isn't easy to tune. Should the change threshold be 1 pixel, 1dp, Xdp, % of the scrolling view, 1-x toots, view on the top/bottom part of the scroll area? Sounds like whatever is picked would not please all users, hence why I'd still keep "always up" / "always down" as options.

tinsukE avatar Sep 02 '23 08:09 tinsukE

@Gargron @grishka do you have an opinion on the PR? Does it have merit? Would you prefer some changes to it?

It has attracted quite some attention both here an on the following toots: https://mas.to/@tinsuke/110991335369359509 https://floss.social/@megalodon/110991689181470000

tinsukE avatar Sep 07 '23 14:09 tinsukE

in megalodon, i just implemented it like this and removed the setting. feel free to copy if desired

Screenshot_20230908-222648_Megalodon

sk22 avatar Sep 08 '23 22:09 sk22