telescope icon indicating copy to clipboard operation
telescope copied to clipboard

Have a bookmark for where you left off on Telescope

Open AmasiaNalbandian opened this issue 3 years ago • 5 comments

What would you like to be added: I think it would be really cool if I could go to Telescope and see the posts from today.

Then next week, when I go back to Telescope, I get put to the exact post I last read, with a little banner that says "5 new posts since you last visited"

Why would you like this to be added: We have a lot of new posts every week, and it's fun to read them all. Sometimes you miss some and it would be nice to enable a feature to "bookmark" where you left off.

Some thoughts on how to implement this? We can use localstorage to store the last post that was rendered in your feed, and always navigate to that post on(i.e. anchor link) I think we can use states? I'm not too experienced in React for this.

AmasiaNalbandian avatar Feb 28 '22 06:02 AmasiaNalbandian

This is a really interesting idea. The best way to approach this would be to keep track of our "cursor" in the timeline, where we load the posts, see https://github.com/Seneca-CDOT/telescope/blob/2359565d11aa045eedadfee2ef72d29f62d87bee/src/web/src/components/Posts/index.tsx#L43-L62. We could easily change the starting location, and get the back-end to tell us what we've missed. Storing that position in localStorage makes sense.

humphd avatar Mar 02 '22 01:03 humphd

I'd like to try this, but I want to remove the current stuff on my to-do first.

AmasiaNalbandian avatar Mar 04 '22 15:03 AmasiaNalbandian

I am not really sure how to implement this. If the cursor is supposed to store the id of the current post in localStorage, how we would scroll the screen to the post with that id?

dbelokon avatar Mar 23 '22 10:03 dbelokon

My thoughts on how you can do this:

  • use IntersectionObserver to know what post is being viewed and store the id in local storage
  • you can either set an interval to store the id or save it when the browser closes
  • Next time you visit, we gonna look at the stored post id because we load 30 posts at first, if the page id is in one of the posts, scroll to it.
  • To scroll to the post, you need to bind its ref and call ref.current.scrollIntoView

However, I don't think all users want to scroll to the last post they viewed. We should add a button to ask them if they want to scroll.

DukeManh avatar Mar 23 '22 20:03 DukeManh

We need to focus on other features, this feature can be a post 3.0 thing

TueeNguyen avatar Mar 31 '22 12:03 TueeNguyen

I don't think we're going to do this.

humphd avatar Jan 20 '23 15:01 humphd