Commit graph

261 commits

Author SHA1 Message Date
Christopher Gurnee
763516b19d Update dependencies 2022-10-20 16:25:30 +00:00
Christopher Gurnee
af18d3a868 Improve Reddit OAuth token retrieval
* Only make one OAuth attempt at a time (no async OAuth requests)
 * Respect token expiration
2022-10-10 17:59:47 +00:00
Christopher Gurnee
be7064124f Respect Reddit API limits
With Pushshift's increase in the maximum request size from 100 to 250
comments, this also increases the Reddit request rate by 2.5x. This
makes it possible to overrun the API limits, so start tracking and
respecting them. Also switch back to logging into Reddit to increase
these limits.
2022-10-10 17:05:48 +00:00
Christopher Gurnee
ec0fc925b4 Increase PushShift comments retrieved size to 250 2022-10-10 17:02:35 +00:00
Christopher Gurnee
75e1de010c Update dependencies 2022-10-10 17:01:16 +00:00
Christopher Gurnee
5b0adb2a1d Update the Is-Pushsift-down link 2022-08-01 16:25:45 +00:00
Christopher Gurnee
6bd725796e Update dependencies 2022-08-01 16:21:51 +00:00
Christopher Gurnee
5b5295c30d Update dependencies 2022-07-20 18:31:13 +00:00
Christopher Gurnee
d6c0fc65d3 Color comments '[ Removed by Reddit ]' as removed 2022-06-13 16:25:48 +00:00
Christopher Gurnee
c47103b28a Update dependencies 2022-06-13 16:25:42 +00:00
Christopher Gurnee
064f319db9 Add and make default a highlighted mode for edits 2022-05-30 17:37:49 +00:00
Christopher Gurnee
2a29851ed7 Update dependencies 2022-05-30 17:23:32 +00:00
Christopher Gurnee
981c06fb73 Fix some minor context-related edge cases 2022-05-22 14:46:04 +00:00
Christopher Gurnee
ccfb452bce Prevent extraneous requests to the Reddit API
Unnecessary requests for already-retrieved comments were sometimes being
sent to the Reddit API when retrieving context or loading permalinks.
2022-05-16 22:39:43 +00:00
Christopher Gurnee
d35f7e7bf0 Fix some minor (mostly display) context bugs 2022-05-16 20:53:14 +00:00
Christopher Gurnee
07d4863c7a Add support for Reddit-style bookmarks/hashes 2022-05-16 14:16:18 +00:00
Christopher Gurnee
85af5be925 Add context query param: shows permalink ancestors
Appending `?context=#` to a permalink will highlight the permalinked
comment and display above it up to 8 ancestors, similar to Reddit's
behaviour. To keep things fast, this update required that the Pushshift
comments endpoint work with `ids` queries which was fixed around May 11.
2022-05-13 22:33:18 +00:00
Christopher Gurnee
32deb7f1e6 Update dependencies 2022-05-13 22:04:31 +00:00
Christopher Gurnee
7cc5521c83 Fix minor bug in error-handling 2022-05-13 16:16:37 +00:00
Christopher Gurnee
d3fbd86dd3 Rename redditIdsToPushshift() to fullnamesToShortIDs() 2022-05-13 16:13:43 +00:00
Christopher Gurnee
08991dfbb0 Work around Pushshift bug for certain time ranges
Comments in the time ranges below need a workaround which slows down
Pushshift queries, but it's required to retrieve them correctly

 * Sep/1/2017 0:00 - Sep/30/2017 23:59:59 UTC
 * Feb/1/2018 0:00 - Mar/31/2018 23:59:59 UTC
2022-05-09 20:07:12 +00:00
Christopher Gurnee
0ca5630ffe Refactor counting of removed/deleted comments
This fixes a small bug, and avoids unnecessary setState() calls.
2022-04-29 17:05:15 +00:00
Christopher Gurnee
44b3049406 Fix under-post links when Reddit is broken 2022-04-21 22:42:17 +00:00
Christopher Gurnee
6d687e188c Fix default of scrolling past the post w/permalinks
Regression from 536bccb
2022-04-21 22:14:52 +00:00
Christopher Gurnee
b8411d84b3 Fix permalinked comments missing from Pushshift
There were two bugs when a permalinked comment was missing from
Pushshift, but available via Reddit:

 * the links below the comment (`permalink reddit reveddit`) were
   often broken due to calling `redditIdsToPushshift()` twice
 * if removed or deleted, it wasn't counted or colored correctly
2022-04-20 15:08:27 +00:00
Christopher Gurnee
54bd0d9bce Update dependencies 2022-04-20 13:33:56 +00:00
Christopher Gurnee
2449a88f01 Add tooltips on click for touch/pen screens
Credit to SO contributer 'H K': https://stackoverflow.com/a/60660207
2022-04-17 03:18:23 +00:00
Christopher Gurnee
5d09ea54ab Do fetch deleted link-posts from Pushshift
There's still some data that Pushshift can restore from these link-posts
2022-04-16 15:17:02 +00:00
Christopher Gurnee
536bccba2a Fix visits to full posts but with a bookmark/hash
Beforehand, only initial visits to single comments (permalinks)
and internal links correctly scrolled to the bookmark/hash.
2022-04-15 00:18:49 +00:00
Christopher Gurnee
1e21ba474a Fix some small post display/link issues
* make the post placeholder bigger to minimize the layout changes
   as the post loads
 * correctly add link clicks to the location history if the current
   location differs from the link target
2022-04-14 23:53:36 +00:00
Christopher Gurnee
df0c86aac0 Don't fetch removed link-posts from Pushshift
Removed/deleted self-posts are still fetched from Pushshift to get
the selftext, however there's no value in fetching link-posts.

Also:

 * Don't display '[deleted]' if no selftext was deleted.
 * Add key attributes to the post <div> so that React recreates
   it instead of mutating it after the Post loads. This prevents
   transitioning the background color (from the dark/light mode css).
2022-04-14 22:25:17 +00:00
Christopher Gurnee
37e0a152e1 Update dependencies 2022-04-14 21:04:54 +00:00
Christopher Gurnee
8ed7e8c644 Fix incorrectly named 'class' JSX attribute 2022-04-11 19:27:18 +00:00
Christopher Gurnee
8d80eacf41 Don't add link-to-self clicks to location history 2022-04-11 16:34:49 +00:00
Christopher Gurnee
929a153e19 Flash 'show' setting if all comments are filtered 2022-04-09 15:56:02 +00:00
Christopher Gurnee
ccca3b3120 Handle permalinks w/mismatched link_ids correctly 2022-04-09 15:03:54 +00:00
Christopher Gurnee
69e59a75d2 Improve scrolling with parent and permalinks
Visiting a permalink (from an internal or external link) now scrolls to
just past the post, and both parent and permalinks scroll smoothly where
appropriate; it makes sense for internal permalinks to immediately jump.
2022-04-08 18:51:58 +00:00
Christopher Gurnee
5ea27dd616 Add componentWillUnmount() to thread/index.js 2022-04-08 14:18:57 +00:00
Christopher Gurnee
763d9bdae7 Remove empty class attributes from /about 2022-04-08 13:37:56 +00:00
Christopher Gurnee
dd1b8b7f91 Update dependencies 2022-04-08 12:57:51 +00:00
Christopher Gurnee
d120c8f6d3 Fix dark mode transition fx & adjust spacing a bit 2022-03-31 15:49:16 +00:00
Christopher Gurnee
29c390709d Fix some post link issues
* Only redirect Reddit post links to Unddit if it's likely to work.
 * Use React <Link>s instead of <a>s if the post link matches the
   post itself. This avoids an unnecessary page reload if clicked.
 * Relative links in comments still don't work well...
2022-03-30 01:05:45 +00:00
Christopher Gurnee
77895e8d71 Add dark/light/system mode switch
Also give more space to the selftext of posts.
Closes #6
2022-03-28 18:52:23 +00:00
Christopher Gurnee
46c64f9498 Log time taken to load post/comments 2022-03-25 16:54:09 +00:00
Christopher Gurnee
385758918b Update dependencies 2022-03-25 16:53:39 +00:00
Christopher Gurnee
a97fc287e5 Update comment counts as downloads progress 2022-03-23 12:41:30 +00:00
Christopher Gurnee
31dc89bf13 Make error message a bit more clear 2022-03-21 15:58:32 +00:00
Christopher Gurnee
0abf9222fb Improve permalinks and add parent link to comments
Beforehand, visiting a permalink would cause Unddit to begin loading
from the Post's first comment. If the max-to-download setting was too
small, and the permalinked comment wasn't yet encountered, no comment
tree would be displayed.

Now, only comments that occur at the same time as the permalinked
comment or later (chronologically) are downloaded.

This also adds a Parent link to each comment. When viewing a permalinked
comment, clicking the top-level Parent link will download only new
comments between the parent and child comments. Likewise, clicking the
'view rest of comments' link will only download new comments from the
first comment up until the previously viewed comment.

In general, Unddit will not re-download comments that it knows it has
previously downloaded, nor download more than max-to-download comments
per link clicked. This can leave 'gaps' in the list of downloaded
comments. If the 'load more comments' link is clicked, Unddit will only
download comments that can fill such gaps between the currently-linked
permalink (or if not viewing one, the first comment) and the last, up to
the max-to-download setting.
2022-03-18 23:56:10 +00:00
Christopher Gurnee
2d436062ce Improve error handling 2022-03-18 23:53:31 +00:00
Christopher Gurnee
ee1bef62dd Fix small bug introduced in c236bf3 2022-03-17 17:38:23 +00:00