hackerweb icon indicating copy to clipboard operation
hackerweb copied to clipboard

Pull to refresh

Open jcaudle opened this issue 13 years ago • 9 comments

I don't know anything about the library used on this project, but it would be nice to get the pull to refresh idiom going on this web app. I know it's possible in the Mobile Safari browser (Gmail has a nice implementation for it). If its possible with these libraries, I'll happily get going on putting it in place if there's interest in the feature.

jcaudle avatar Mar 02 '12 05:03 jcaudle

Yeah, that's in the plans :smile:

cheeaun avatar Mar 02 '12 06:03 cheeaun

Just forked the repo. I'll take a look into it soon!

jcaudle avatar Mar 02 '12 07:03 jcaudle

Do you think this is something that might be better in tappable?

jcaudle avatar Mar 02 '12 22:03 jcaudle

I think it's better be a separate piece of code. The rough idea I had in mind is a touchmove event to grab the scrollTop values and animate the rotation of arrow, and touchend to detect if scrollTop reaches a certain threshold then begin refreshing.

cheeaun avatar Mar 03 '12 00:03 cheeaun

So, still thinking of doing this? I didn't realize there was a patent on this when I suggested it... Now, according to the IPA, Twitter won't do anything, but I'm just wondering if you were still hoping to implement this...

jcaudle avatar Jun 09 '12 02:06 jcaudle

Yeah, I think it's okay for now on the patent stuff. Before I try to implement this, I did some research and read this on Quora: http://www.quora.com/What-are-some-reasons-to-not-implement-Pull-to-refresh-UIs-and-actions-into-an-iPhone-app

Among the reasons, one that doesn't work for hnmobile is that the list of stories is not a timeline. Frontpage stories are sorted not by time but by upvotes + time + magic, so when doing pull-to-refresh, new items are not prepended to the list, the whole list just change. The feature may be cool, but not intuitive in this context, so I'm holding off till there's a better solution or a new paradigm appears. Also keeping this issue open as a reminder for myself :smile:

If you're curious if pull-to-refresh may work at all in a -webkit-overflow-scrolling: touch container, here's another project that manage to implement it, which is worth reading the code: https://github.com/Harrison/Messenger

cheeaun avatar Jun 09 '12 02:06 cheeaun

I think you are right on about the UX here. Perhaps shake to refresh would be better, but a browser based app might make that un-workable... and there's this: https://speakerdeck.com/u/mccasal/p/the-ux-of-shake-to-refresh-on-iphone-dark-side-of-ux :smile:

Thanks for the tip to the Messenger app.

jcaudle avatar Jun 09 '12 03:06 jcaudle

Hah! It is possible with shake.js https://github.com/alexgibson/shake.js/ :smiley:

cheeaun avatar Jun 09 '12 03:06 cheeaun

Well, it might make more sense with the whole idiom of HN shaking things up with a refresh, but I don't know if that's necessarily the best idea to go with... :wink:

jcaudle avatar Jun 09 '12 03:06 jcaudle