Commit graph

233 commits

Author SHA1 Message Date
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
Christopher Gurnee
e0c0c163ae Keep removed posts' Reddit score and num_comments 2022-03-02 12:03:03 -05:00
Christopher Gurnee
d24752db6d Add 'Is Unddit/Pushshift down?' to FAQ 2022-03-01 10:03:13 -05:00
Christopher Gurnee
3fab1f398a Change to all-lowercase in SortBy.js 2022-02-27 01:10:02 -05:00
Christopher Gurnee
94d4514922 Add feedback after 'load more comments' completes 2022-02-26 13:07:38 -05:00
Christopher Gurnee
fb327e7b94 Fix bug w/0-comment posts introduced in 07c72a2 2022-02-25 13:25:02 -05:00
Christopher Gurnee
d6a55ee31c Add '?max_comments=n' query parameter
This increases the initial max-comments-to-download above the user's
preference without changing their saved setting. This can be useful when
linking to a specific comment which is new enough that the default max-
comments setting (of 800) is too low to download the linked comment
tree, causing most users to see a confusing 'No comments found' message.
2022-02-25 11:25:46 -05:00
Christopher Gurnee
cab177c021 Refactor state.js a bit 2022-02-25 10:27:33 -05:00
Christopher Gurnee
1e1a78fbe9 Fix Reload button bug introduced in 59df221 2022-02-25 10:13:05 -05:00
Christopher Gurnee
8204f0829a Remove unnecessary useLocation() call 2022-02-25 08:17:00 -05:00
Christopher Gurnee
9b902f5cf5 Don't line-wrap inside of a setting 2022-02-22 13:05:50 -05:00
Christopher Gurnee
aac22ce109 Speed up and clarify the 'load more comments' UI
* only rerender the comments after loading and iff something changes
 * change text to 'loading...' and make link unclickable while waiting
 * if all comments are already loaded, rename to 'load new comments'
2022-02-22 11:56:53 -05:00
Christopher Gurnee
59df221ff9 Add 'load more comments' links to the thread's end 2022-02-20 14:12:10 -05:00