Skip to content
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

Add ability to save posts (Addresses #81) #391

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hamiltondave
Copy link

  • Addresses Feature Request | Save posts #81
  • Added a star SVG icon at the bottom of posts which will allow users to save or unsave it
  • List of saved posts is stored in a cookie
  • Saved posts can be viewed at /saved, which is linked in the feeds dropdown

libreddit-saved-posts

@PAI5REECHO
Copy link

Nice to see this addressed!

Do saved posts work with:

You can restore your current settings and subscriptions after clearing your cookies using this link.

Also are you able to save individual comments, not just parent threads?

@hamiltondave
Copy link
Author

Thanks for taking a look at this. I just updated the branch so that saved posts can be restored with the link on the settings page. This just works for parent threads for now though.

@PAI5REECHO
Copy link

Can you rebase your changes on latest master? I want to give this feature a try

@hamiltondave
Copy link
Author

This is rebased now and ready to test.

@PAI5REECHO
Copy link

PAI5REECHO commented Apr 12, 2022

I gave this PR a try. There's some stuff I see an issue with:

  • The save button when viewing an individual post needs to be aligned to the end of the flexbox (preferably after the upvote ratio so it'd be in the corner in the same place as /saved):
    image
  • It'd be nice to be able to search /saved if possible
  • saved_posts should automatically span multiple cookies if one cookie is more than 4093 bytes to avoid Cannot import large amount of Subscriptions #352 from happening (something like saved_posts1, saved_posts2, saved_posts3, etc...)
  • Should be able save individual comments rather than entire posts for feature parity with real reddit. It's also beneficial because often people just want to be able to recount a single comment in a very large thread rather than the post content itself. Also sometimes comments can get deleted by moderators so they won't be findable otherwise.

@hamiltondave
Copy link
Author

Thanks for your feedback! I think this is all doable. I will work on these improvements when I have some time.

@PAI5REECHO
Copy link

PAI5REECHO commented Apr 25, 2022

Another thing I noticed is that when you submit the /saved/{ID}/save form the redirect is just ?redirect=/ rather than ?redirect=/#{ID} to resume your scroll position on the current page

@spikecodes spikecodes linked an issue May 21, 2022 that may be closed by this pull request
@Daniel-Valentine
Copy link
Member

@hamiltondave: Now that Libreddit development has resumed, I'd like us to consider this for inclusion in the code base. Would you mind pulling the latest from master and resolving merge conflicts?

Keep in mind that with the merge of #637 the template block that generates the view for a post has been made a macro and moved into templates/utils.html, so any changes you've made to that block will need to be ported to that file.

@Daniel-Valentine Daniel-Valentine requested review from Daniel-Valentine, sigaloid and spikecodes and removed request for sigaloid December 5, 2022 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request | Save posts
3 participants