Commit graph

309 commits

Author SHA1 Message Date
Lim Chee Aun 4a01d3d404 Try save some space here 2023-02-11 20:56:33 +08:00
Lim Chee Aun b29e7ad1cb Clear q URL when clear search field 2023-02-11 20:39:37 +08:00
Lim Chee Aun d9564bff72 Still need these fallbacks for now 2023-02-11 18:55:21 +08:00
Lim Chee Aun b8a938b6d8 Don't need Home button in public timeline 2023-02-11 18:21:39 +08:00
Lim Chee Aun 26f8b618a5 At this point, better write my own matchPath right? 2023-02-11 18:19:23 +08:00
Lim Chee Aun 9401fc38e1 Need location.search too because Search page is using it 2023-02-11 17:58:49 +08:00
Lim Chee Aun 27c7a2dee9 Shorter placeholder for Search field 2023-02-11 17:58:23 +08:00
Lim Chee Aun c1eade0fd8 Stupid mobile safari doesn't apply radius to outlines 2023-02-11 17:58:12 +08:00
Lim Chee Aun afa8a0c057 Maybe better copy for search page 2023-02-11 17:57:44 +08:00
Lim Chee Aun 863ac2663c Fix titles 2023-02-11 17:57:26 +08:00
Lim Chee Aun 62eb6d6b30 Reuse style for search page, time to surface it 2023-02-11 17:01:43 +08:00
Lim Chee Aun 068a49abce Add Followed Hashtags 2023-02-11 16:48:47 +08:00
Lim Chee Aun ffc8d88f82 Add update checking to these pages 2023-02-11 16:28:03 +08:00
Lim Chee Aun ee5ab3f22c Add loader to search page 2023-02-11 16:27:52 +08:00
Lim Chee Aun 0a7189d35a Fix wrong paths again 2023-02-11 16:27:40 +08:00
Lim Chee Aun 722852f5c2 Expose more pages now
Except one
2023-02-11 00:05:18 +08:00
Lim Chee Aun 3490b0e714 Revert "Sort first"
This reverts commit 96f61e6e3f.
2023-02-10 22:23:19 +08:00
Lim Chee Aun e0e236bd26 Experimental hidden search page
And refactored out some reusable components
2023-02-10 22:10:13 +08:00
Lim Chee Aun 541d318fdc One more logic for comment collapsing 2023-02-10 17:35:38 +08:00
Lim Chee Aun 96f61e6e3f Sort first 2023-02-10 14:20:48 +08:00
Lim Chee Aun 81ebb61096 Sneak in this little menu
And… fix title leak bug
2023-02-10 13:39:46 +08:00
Lim Chee Aun 83e6a2b599 Remove console.log 2023-02-09 23:05:40 +08:00
Lim Chee Aun 109cae9c19 More path fixes 2023-02-09 23:01:33 +08:00
Lim Chee Aun 58d4ca0ff2 Finally replace Home 2023-02-09 22:27:49 +08:00
Lim Chee Aun f511b0a5ab More code porting 2023-02-08 19:11:33 +08:00
Lim Chee Aun 9921e487e8 Minimum viable Home → Following port 2023-02-08 00:31:46 +08:00
Lim Chee Aun f6897ef4d8 Don't open sub comments is parent is a thread 2023-02-07 12:01:36 +08:00
Lim Chee Aun 9992299716 More ports to reusable Timeline component
- use status id instead of status, for "auto-update" feature
- hot keys!
2023-02-06 23:50:00 +08:00
Lim Chee Aun db428c04d1 Scoped keyboard shortcuts 2023-02-06 23:47:58 +08:00
Lim Chee Aun 4520822f1f Use nested routes 2023-02-06 20:17:07 +08:00
Lim Chee Aun b58a838af0 Forgot to update these 2023-02-06 20:01:56 +08:00
Lim Chee Aun 7e5c3f1bac Allow Account sheet on welcome page 2023-02-06 19:55:04 +08:00
Lim Chee Aun 719a407414 Use /:instance?/xxx instead 2023-02-06 19:54:18 +08:00
Lim Chee Aun 3aea09fd42 Experimental feature to see post in currently logged-in instance 2023-02-06 19:09:25 +08:00
Lim Chee Aun 1357c1b2bd Fix more edge cases after breaking changes 2023-02-06 16:35:03 +08:00
Lim Chee Aun 1debfc2c12 Fix missing states 2023-02-06 01:10:49 +08:00
Lim Chee Aun a130743d4c Breaking: refactor all masto API calls
Everything need to be instance-aware!
2023-02-06 00:17:19 +08:00
Lim Chee Aun 7e9b6f681f Forgot to emojify again
This is getting ridiculous
2023-02-04 13:18:23 +08:00
Lim Chee Aun e0bab6c70a More refactoring work 2023-02-03 21:08:08 +08:00
Lim Chee Aun e95954a7fd Begin work on account-specific store
1. Move boostsCarousel setting to account-specific, sadly no migration from previous setting
2. Cache last notification to prevent keep getting unread notification badge
2023-02-02 17:29:57 +08:00
Lim Chee Aun eb2f80162a Don't debounce if loading subsequent posts 2023-02-02 15:48:12 +08:00
Lim Chee Aun 20e569da0c Strip out @acct@ from instance URL when log in 2023-02-01 10:49:42 +08:00
Lim Chee Aun 3d2b7f683c Fix notifications grouping bug 2023-02-01 02:09:07 +08:00
Lim Chee Aun ed8fce3cbf Don't need --invisible hack
Protip: use `:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)`
2023-02-01 01:21:58 +08:00
Lim Chee Aun 6647b6cc28 Fix j/k shortcuts to work with collapsed comments
Use x key to expand/collapse comments
2023-02-01 00:10:38 +08:00
Lim Chee Aun 9a261470df Custom titleComponent for Timeline 2023-01-31 19:08:10 +08:00
Lim Chee Aun 18b48c8d19 Smarter collapsing, show total comments count, show 3 avatars 2023-01-31 16:13:16 +08:00
Lim Chee Aun 4ed2852c41 Don't show updates button when loading 2023-01-31 11:24:46 +08:00
Lim Chee Aun 1c52875ba4 Add links to privacy policy 2023-01-30 23:16:00 +08:00
Lim Chee Aun c40fd1ec48 Better hues 2023-01-30 22:31:21 +08:00
Lim Chee Aun 3cec4f66c5 Fix document.title bug 2023-01-30 22:00:14 +08:00
Lim Chee Aun 969fddc581 Time for use-debounce
Try a leading debounce here
2023-01-30 20:51:06 +08:00
Lim Chee Aun 509aac11ab Fix document title leaked out
Probably need to rethink this one day
2023-01-30 20:36:10 +08:00
Lim Chee Aun 1cfef22465 Let's test this out 2023-01-30 20:30:45 +08:00
Lim Chee Aun 88ffb3a44c Reduce distance from start to show the scroll to top button 2023-01-30 19:59:41 +08:00
Lim Chee Aun 1fed35f674 Flush instead of cancel 2023-01-30 19:36:47 +08:00
Lim Chee Aun e5e2bd6f2a Add account statuses timeline + few aesthetic changes to Account sheet
And secretly link to this timeline, don't tell anyone lol
2023-01-29 23:37:13 +08:00
Lim Chee Aun 292186e918 New UI experiment: media modal + status detail page
- Extracted out the media modal and media component from Status
- Use :has CSS selector to do most of the layout work
- Expecting edge case UI bugs
2023-01-29 15:23:53 +08:00
Lim Chee Aun ae37d58826 Fix document.title not working properly 2023-01-29 15:22:16 +08:00
Lim Chee Aun 66216e911e At this point, might as well support level 4
Also still need to show the comment icon IF THERE'S LEVEL 5++
2023-01-29 01:29:26 +08:00
Lim Chee Aun a088b48eb7 Status thread page improvements
- Show level 3 comments
- Change header-tap to scroll top to a button instead (prevent accidental scroll top)
- Show avatars in <summary>
- Clean up CSS a bit
2023-01-29 01:02:25 +08:00
Lim Chee Aun ae90b41aae New feature: "Show all sensitive content" menu 2023-01-28 22:34:36 +08:00
Lim Chee Aun aaeca7dd03 Refactor out a Timeline component
Also replace login() with createClient() for faster log in
2023-01-28 18:52:18 +08:00
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 e83d128f62 Rewrite Notifications page + experimental fix on getting/showing updates 2023-01-27 11:47:30 +08:00
Lim Chee Aun 6a7e7085bd Bump up retries
Slow servers are slow.
2023-01-26 21:02:39 +08:00
Lim Chee Aun 285f8b46f2 Add logo and link to @phanpy 2023-01-26 00:54:30 +08:00
Lim Chee Aun 9a898437f9 Remove unused code 2023-01-25 21:53:43 +08:00
Lim Chee Aun d2c820ce5a Only show 'Set as default' if has more than 1 account 2023-01-25 16:42:01 +08:00
Lim Chee Aun c24a3ef251 Add fetch retries in status page 2023-01-25 16:41:28 +08:00
Lim Chee Aun 28281bb752 New component: Menu
It's time to do this menu thing the right way instead of hacky CSS
2023-01-24 20:56:43 +08:00
Lim Chee Aun 19ee95d188 Add a key, just in case 2023-01-24 20:55:04 +08:00
Lim Chee Aun 791ac667f0 Style adjustments for Settings page 2023-01-24 17:06:13 +08:00
Lim Chee Aun 10b99d2af4 Fix k, shift+k not working 2023-01-24 16:27:09 +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 0ecd7f572f s/Loader/loader 2023-01-22 16:40:10 +08:00
Lim Chee Aun 78839913ed s/Icon/icon 2023-01-22 16:39:04 +08:00
Lim Chee Aun 2a44f3a670 Hidden way to update the account info
Usually when avatar or name changes
2023-01-22 00:37:46 +08:00
Lim Chee Aun 6f4a5553ec Simplify and robustify 2023-01-21 20:21:16 +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 a87b95ed18 Restyle settings sheet 2023-01-17 17:58:04 +08:00
Lim Chee Aun 8834c03d7a Need to cancel the debounce 2023-01-17 08:56:13 +08:00
Lim Chee Aun f7cbf238b1 Shift+j/k shortcut to skip posts in Boosts Carousel 2023-01-16 21:26:33 +08:00
Lim Chee Aun 58cefc2853 Also activate boosts carousel for serial boosts 2023-01-16 20:50:03 +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 68b6cb869e No need these console logs anymore 2023-01-14 22:05:38 +08:00
Lim Chee Aun 0dcccd1e57 Fix scroll direction stopped working
s/up/start s/down/end
2023-01-14 20:16:13 +08:00
Lim Chee Aun e2139399ee New experiment: Boosts Carousel™️ 2023-01-14 19:42:04 +08:00
Lim Chee Aun 71b50382e9 New feature: Unsent Drafts
For now, this only works for unsent unsaved drafts e.g. the browser kill the page without giving the user the chance to discard
2023-01-13 15:30:09 +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 9faf730e82 Handle accept/reject follow requests for locked accounts 2023-01-10 21:49:23 +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 13c3b8fa3b Finally DRY this saving status code 2023-01-09 19:11:34 +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 600edbee5d Might as well make my own link open up the Account modal 2023-01-07 21:43:56 +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 ee9bfe6331 Lots of tiny adjustments 2023-01-07 14:45:04 +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 fffc8cc983 Further grouping of notifications 2023-01-06 12:51:53 +08:00
Lim Chee Aun de45a0f9d5 Update useScroll to check distance in threshold instead of pixels 2023-01-05 15:29:11 +08:00
Lim Chee Aun 04ccf8aca9 Replace @github/relative-time-element with dayjs 2023-01-05 10:50:27 +08:00
Lim Chee Aun 8e19d098eb Test add this condition to see how it works 2023-01-04 17:12:44 +08:00
Lim Chee Aun b0271c50ae Fix forgot to put back the fake <li> 2023-01-03 00:56:11 +08:00
Lim Chee Aun dbf9c22ea5 Less obstrusive "New posts" 2023-01-03 00:52:16 +08:00
Lim Chee Aun d15b1fe03e Fix route() actually not working 2023-01-03 00:48:36 +08:00
Lim Chee Aun 9ea941368d More fixes 2023-01-03 00:27:47 +08:00
Lim Chee Aun d235f56cff Always clear 'new' when load from beginning 2023-01-02 23:19:12 +08:00
Lim Chee Aun 39124ccc70 Add experimental scroll-based effects
- Scroll to top = refresh Home
- Scroll up/down = show/hide header and compose button
- Scroll near bottom = load next statuses
- Move Compose button to only at Home instead of 'App' level
2023-01-02 21:36:24 +08:00
Lim Chee Aun 44f179a69f Beautify notifications slightly 2023-01-02 14:42:28 +08:00
Lim Chee Aun 8099fedf82 Don't store instances list inside JS bundle 2023-01-01 21:02:06 +08:00
Lim Chee Aun 727b944f3b toLowerCase() all the instance URLs! 2023-01-01 20:59:55 +08:00
Lim Chee Aun bfaefbe178 Disable autocapitalize on input field
And disable a bunch of others too
2023-01-01 20:53:40 +08:00
Lim Chee Aun d2d8571b3f Fix updates button got cut off in larger viewport 2023-01-01 19:24:08 +08:00
Lim Chee Aun b62cff4d0e Different gradient for welcome 2023-01-01 17:19:07 +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 c0234dd26e Add focus for notification block too 2022-12-30 23:08:55 +08:00
Lim Chee Aun d605fc6ebe Fix missing border 2022-12-30 20:39:27 +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 5804ddbdb9 Add all the focuses 2022-12-29 16:11: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 2dca345818 More breathing space after the negative top margin hack 2022-12-28 00:24:36 +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 6da4834b71 Change back to limit 1
Sometimes, there's really just one new status update.
2022-12-26 01:09:53 +08:00
Lim Chee Aun c75bf36345 Try dblclick for reloading
Not sure if this'll work on touch-based devices. Also good for debugging.
2022-12-25 23:53:18 +08:00
Lim Chee Aun 86f38ee3b8 Fix Account sheet relationship check not working when clicking from Settings page
This is because accounts from different instances have different IDs!

They're NOT unique cross-instance. So while on one instance, cannot use the account ID of the other instance to query for relationship because the ID doesn't exist on *current* instance.
2022-12-25 23:31:50 +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 cf4fbc8553 Make sheet have header and body section 2022-12-25 18:01:01 +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 8eec844781 Scroll-to-top for Notifications 2022-12-24 17:54:42 +08:00
Lim Chee Aun 42fa30d8f8 Move the onVisibilityChange API check to app.jsx
Doesn't make sense to make it part of Home. Also add in Notifications check.
2022-12-24 10:26:05 +08:00