Commit graph

113 commits

Author SHA1 Message Date
Lim Chee Aun
816653e2e6 Add j/k keyboard navigation to status page
At the same time, fix shift+k not working in Home page
2023-01-27 20:54:18 +08:00
Lim Chee Aun
912506afcc Fix some scrolling edge cases
This is tough
2023-01-27 11:48:13 +08:00
Lim Chee Aun
6a7e7085bd Bump up retries
Slow servers are slow.
2023-01-26 21:02:39 +08:00
Lim Chee Aun
c24a3ef251 Add fetch retries in status page 2023-01-25 16:41:28 +08:00
Lim Chee Aun
348e7a52c9 Fix stupid mistake 2023-01-23 17:58:33 +08:00
Lim Chee Aun
e7dffecfe0 Need to reset cachedStatusesMap too 2023-01-22 19:21:24 +08:00
Lim Chee Aun
81170c6d05 When clicked, don't use cached scroll position 2023-01-21 19:52:51 +08:00
Lim Chee Aun
fa5a468005 Don't really get how this becomes multi-line 2023-01-21 18:59:13 +08:00
Lim Chee Aun
9bff95bcec Replace preact-router with react-router
Need more routing powers, hopefully things don't break 🤞
2023-01-21 00:23:59 +08:00
Lim Chee Aun
8834c03d7a Need to cancel the debounce 2023-01-17 08:56:13 +08:00
Lim Chee Aun
d7d9d9f0a2 Don't store scroll position while in loading state 2023-01-16 20:32:51 +08:00
Lim Chee Aun
62a3ba7c5f Bug fixes for boosts carousel + scrolling 2023-01-16 20:32:30 +08:00
Lim Chee Aun
e2139399ee New experiment: Boosts Carousel™️ 2023-01-14 19:42:04 +08:00
Lim Chee Aun
e2b6f2df6a Auto-threadify when open a status page with context 2023-01-11 17:45:37 +08:00
Lim Chee Aun
a421406a11 DRY get current Account 2023-01-11 13:28:42 +08:00
Lim Chee Aun
9743da1e9b Fix cached statuses gone 2023-01-10 20:05:47 +08:00
Lim Chee Aun
53f70e68f7 Need better distancing 2023-01-10 16:37:34 +08:00
Lim Chee Aun
2bed0c7f03 Add Experimental scroll to top button for status page 2023-01-10 10:44:16 +08:00
Lim Chee Aun
1727475336 Reduce more code for scrolling logic
- Move from sessionStorage to in-memory for statuses cache
- Remove userInitiated, it's getting hard to differentiate between user-initiated and non-user-initiated. Probably better done from the route side instead of only stuck to this component's state
2023-01-10 01:31:38 +08:00
Lim Chee Aun
7f5214c8c6 Need a way to refresh status page on-demand 2023-01-09 21:51:30 +08:00
Lim Chee Aun
522dd08925 Remove unused imports 2023-01-09 17:05:42 +08:00
Lim Chee Aun
cab06ae936 Further simplify the scrolling logic in Status page
Previous code is too darn complicated and doesn't work in async cases
e.g. user scrolled while the status is loading
2023-01-09 16:56:16 +08:00
Lim Chee Aun
41df88e625 Perf fixes
Turns out, adding an object to states.statuses proxyMap object, re-render ALL statuses
2023-01-07 20:26:23 +08:00
Lim Chee Aun
ac557e1271 Delete cache in SW before reloading status page
Seems kinda hacky… probably might cause new side effects
2023-01-06 21:29:16 +08:00
Lim Chee Aun
04ccf8aca9 Replace @github/relative-time-element with dayjs 2023-01-05 10:50:27 +08:00
Lim Chee Aun
d15b1fe03e Fix route() actually not working 2023-01-03 00:48:36 +08:00
Lim Chee Aun
2031e88d87 Better handling of failures
Some mastodon instances are getting hit hard
2023-01-01 15:28:07 +08:00
Lim Chee Aun
842db90f9c Handle context API call fail error 2023-01-01 12:02:11 +08:00
Lim Chee Aun
ac91dc7983 Make this manual opt-in 2023-01-01 08:51:56 +08:00
Lim Chee Aun
895602e446 Gosh this need to be low threshold
It's actually % of the full height of the element. So if the status is super long (100K chars), it'll never be 0.25
2022-12-31 23:58:48 +08:00
Lim Chee Aun
b12b0c588d Experimental j,k,o,esc,backspace shortcuts 2022-12-31 09:52:31 +08:00
Lim Chee Aun
9201f7a118 First step in making things focusable 2022-12-30 20:37:57 +08:00
Lim Chee Aun
123d2469f6 Don't show hero pointer when loading 2022-12-30 13:26:05 +08:00
Lim Chee Aun
3338c49c25 Fix threshold for larger-than-viewport statuses 2022-12-29 16:15:58 +08:00
Lim Chee Aun
bdcefb1ab0 Add a nice pointer 2022-12-29 11:47:10 +08:00
Lim Chee Aun
353c911232 Temporarily disable this now 2022-12-29 10:27:36 +08:00
Lim Chee Aun
7e3733d79e Delay hero status fetch if already cached
The context call is more important
2022-12-28 18:06:05 +08:00
Lim Chee Aun
e7cff25337 Fix wrong logic for silent fail
Some mastodon instances are getting swamped
2022-12-27 21:30:18 +08:00
Lim Chee Aun
fb88129ae7 Check for ref before access scrollTop 2022-12-27 09:05:45 +08:00
Lim Chee Aun
318c2aeffc Upgrade masto.js to V5
- Fix all breaking changes
- Have to manual remove null/undefined values before creating statuses
- Have to recreate iterator instance if start from scratch because can't pass args in next()
2022-12-25 23:28:55 +08:00
Lim Chee Aun
ec67811823 Smart status heading + tap to scroll to hero status
I'll probably need to componentize relative-time, it's getting not DRY
2022-12-24 22:26:43 +08:00
Lim Chee Aun
f8fac1294b Fixes & adjustments to statuses in Status page 2022-12-24 01:11:11 +08:00
Lim Chee Aun
dd99d186bf Add one more case for scrolling 2022-12-23 23:42:41 +08:00
Lim Chee Aun
a2e55eca90 Make fetches concurrent 2022-12-23 12:30:49 +08:00
Lim Chee Aun
fe78ac5fa0 Fix userInitiated undefined 2022-12-23 12:30:07 +08:00
Lim Chee Aun
d3e3e47527 Fix logic for cached statuses 2022-12-23 11:28:25 +08:00
Lim Chee Aun
7e84088d67 Handle case when too many sub-comments
For now, encourage clicking on status to see more replies instead of expanding the sub-comments
Feels "wasted" since the comments are already loaded but it's just too much scrolling

Also auto-open if the sub-comments are not a lot.
2022-12-23 00:30:55 +08:00
Lim Chee Aun
3b6f0f277e Rewrite whole scroll logic for Status page
Handle 3 cases, all written down in comments.

Crossing my fingers 🤞🤞🤞
2022-12-21 18:02:13 +08:00
Lim Chee Aun
04323f05ff Experimental: caching status + context
Cache all statuses from Status page so that it can load faster when
navigating between statuses. Uses sessionStorage
2022-12-21 01:02:48 +08:00
Lim Chee Aun
8babc97877 Fix status jumping bug
This part is too complex.
The thread can get very fancy and it's impossible to handle all use-cases without a lot of code.
Solution is just fading all of them out while loading.
2022-12-20 15:32:31 +08:00
Lim Chee Aun
99357dc887 Shorten number for replies count 2022-12-19 17:38:20 +08:00
Lim Chee Aun
9beee6cb37 Revert back to 'X' instead of '<'
It can be confused with the browser back button. It doesn't function as back button as well
2022-12-19 16:25:57 +08:00
Lim Chee Aun
681dfaaaff Auto-open details and hide summary button
Only show toggle comments button if there are many statuses
2022-12-19 10:05:27 +08:00
Lim Chee Aun
141f4a94dc Fix "show more" appearing below the faux padding 2022-12-19 10:04:50 +08:00
Lim Chee Aun
f110ac6812 Fix flash of un-nested comments 2022-12-19 00:19:19 +08:00
Lim Chee Aun
a029c7ccae Change from 'x' to '<' on Status page 2022-12-18 20:53:32 +08:00
Lim Chee Aun
2f24713d71 Real nested comments
- Collapsed/expandable replies
- Pagination for many many comments
2022-12-18 20:46:13 +08:00
Lim Chee Aun
9eb40d165f Only snap to top when there are ancestors 2022-12-18 13:43:34 +08:00
Lim Chee Aun
6e09d5f836 Fix .insignificant class affecting other elements
Remove them because they were used in previous discarded design
2022-12-18 01:14:44 +08:00
Lim Chee Aun
665b908698 Put names into every export 2022-12-16 13:27:04 +08:00
Lim Chee Aun
94dd2bf627 Fix spoiler content accidentally get leaked in document.title
- Also add quotes
- Add comment to why use 64 chars (soft) limit
2022-12-15 17:14:33 +08:00
Lim Chee Aun
d884cddf16 Fix bugs on status page 2022-12-10 21:19:38 +08:00
Lim Chee Aun
2b9390a0a1 Initial commit 2022-12-10 17:14:48 +08:00