Commit graph

245 commits

Author SHA1 Message Date
Christopher Gurnee
4b8bb415bf WIP of implementing context w/o PS ID querying
This implements the `context` query parameter without querying the
Pushshift comment endpoint with `ids`, which until recently only worked
for certain time periods. Now that this is fixed for all comments after
Oct/23/2017 21:55, it makes sense to use a more simple solution instead.
2022-05-13 23:14:46 +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
Christopher Gurnee
56b05821fc Condense CommentInfo to one line 2022-03-17 17:37:34 +00:00
Christopher Gurnee
42621eed59 Update dependencies 2022-03-17 15:54:43 +00:00
Christopher Gurnee
942bee0a96 Add *edited link to toggle archived/reddit post 2022-03-16 21:54:58 +00:00
Christopher Gurnee
006e6ab5af Make collapse and edited links keyboard navigable 2022-03-16 21:54:58 +00:00
Christopher Gurnee
ced6a27e9b Remove unused 'removed' & 'deleted' arrays 2022-03-16 21:54:58 +00:00
Christopher Gurnee
d58903f61f Send almost-full comment requests to Reddit API 2022-03-16 21:54:58 +00:00
Christopher Gurnee
456b212d5f Use Pushshift metadata to see if loadedAllComments
This saves one Pushshift request on about half of all (re-)loads
2022-03-16 21:54:58 +00:00
Christopher Gurnee
0081278e3c Replace maxComments in state w/loadingMoreComments
maxComments is now only the user-preferred setting, and has nothing to
do with displayed state. loadingMoreComments is used to trigger loading
more comments, and temporarily contains the desired comment count to
load. This should make future changes easier. Also fix two minor bugs:

 * the 'Reload' was sometimes hidden after clicking 'load more comments'
 * 'loaded x more comments' incorrectly appeared after clicking 'Reload'
2022-03-16 21:54:47 +00:00
Christopher Gurnee
09e6f9d11d Make collapse-minus width the same as expand-plus 2022-03-05 21:13:11 -05:00
Christopher Gurnee
41870fc493 Add Android Usage to the FAQ and clarify PC Usage 2022-03-05 14:42:53 -05:00
Christopher Gurnee
3c728e569a Speed up sort & filter changes 2022-03-05 12:50:18 -05:00
Christopher Gurnee
1b156c5f56 Small update to c236bf3
This probably isn't fixing a bug, but better safe than sorry.
2022-03-05 09:58:14 -05:00
Christopher Gurnee
6c83b19767 Small wording change in FAQ 2022-03-04 17:35:39 -05:00
Christopher Gurnee
c236bf3e5a Refactor thread/index.js w/more parallelism/speed
Beforehand, Pushshift comments were all downloaded first, then they were
processed, then all Reddit comments were downloaded, then processed.
Now, as each batch of Pushshift comments completes, it is processed
asynchronously, and Reddit comments are downloaded & processed as soon
as enough comment IDs have been batched for submission. This minimizes
the amount of time spent in the 'Comparing comments to Reddit API'
phase. It also spaces out Reddit API requests for better netiquette.
2022-03-03 14:10:20 -05:00
Christopher Gurnee
d93815ae73 Improve error handling and move it to API layer 2022-03-03 09:10:35 -05:00
Christopher Gurnee
52d8d69d90 Fix bug/typo in 6d1600f 2022-03-02 16:39:33 -05:00