Commit graph

492 commits

Author SHA1 Message Date
Lim Chee Aun 3ca696dd3d Modals for media attachments in composer
Dedicated editor experience per media attachment
2023-01-06 01:51:39 +08:00
Lim Chee Aun abe5d02d93 Different logic for relative time 2023-01-05 17:36:43 +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 599d81f924 Disable card if there's a poll or media attachment
Regardless of the size
2023-01-05 15:28:04 +08:00
Lim Chee Aun a4b452e177 Switch back to blur effect for spoilers
The SVG filter is too heavy for mobile browsers
2023-01-05 13:30:19 +08:00
Lim Chee Aun a429da37f4 Don't show card for sensitive/CW content 2023-01-05 13:29:44 +08:00
Lim Chee Aun 04ccf8aca9 Replace @github/relative-time-element with dayjs 2023-01-05 10:50:27 +08:00
Lim Chee Aun c77ed16804 Even shorter name text 2023-01-05 10:41:25 +08:00
Lim Chee Aun eef658b758 Slightly higher z-index for updates-button 2023-01-04 19:41:35 +08:00
Lim Chee Aun edeceba729 Allow people to type essays 2023-01-04 19:16:43 +08:00
Lim Chee Aun 1f12c53ee1 Refactor textarea and chars count meter
It won't re-render on every key press anymore
2023-01-04 19:03:11 +08:00
Lim Chee Aun fea7145ac9 The mention is hidden *inside* spoiler text 2023-01-04 17:27:43 +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 7e869949e2 Turns out, still change CW when editing 2023-01-03 17:41:18 +08:00
Lim Chee Aun 88297fa17e Remove opacity from spoiler content 2023-01-03 15:52:28 +08:00
Lim Chee Aun 5478e407aa For large cards, align the meta left 2023-01-03 15:51:33 +08:00
Lim Chee Aun a41655698f Disable text selection on some elements 2023-01-03 15:51:16 +08:00
Lim Chee Aun 910120ecd7 When status is small, need more breathing space 2023-01-03 13:52:13 +08:00
Lim Chee Aun a71f66dcbd Handle locked accounts 2023-01-03 13:25:55 +08:00
Lim Chee Aun dbfdd6ec68 Add border for card 2023-01-03 13:03:22 +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 72e3d96675 Add more contrast to green 2023-01-03 00:49:05 +08:00
Lim Chee Aun d15b1fe03e Fix route() actually not working 2023-01-03 00:48:36 +08:00
Lim Chee Aun e4de6d1d22 Don't need to focus on status after closing carousel
It causes unnecessary scroll
2023-01-03 00:48:16 +08:00
Lim Chee Aun 8d609e14a6 This subtle press-down effect starts to annoy me 2023-01-03 00:30:40 +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 5074716378 Set scroll threshold for up/down
Else it'll be too trippy
2023-01-02 23:16:49 +08:00
Lim Chee Aun 7408d7a5d4 No need opacity 2023-01-02 23:16:21 +08:00
Lim Chee Aun f8821d530d Maybe these might help a little 2023-01-02 22:02:21 +08:00
Lim Chee Aun 597232067d Not down enough 2023-01-02 21:43:04 +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 c3aef80ad4 More styles 2023-01-02 15:00:13 +08:00
Lim Chee Aun 44f179a69f Beautify notifications slightly 2023-01-02 14:42:28 +08:00
Lim Chee Aun 07dff34e20 Show formatted duration for video media 2023-01-02 14:21:38 +08:00
Lim Chee Aun 21bdb51cd6 Compose pop-in/out now can work with non-id medias
Commented out for now to see if it really works

The bug is due to valtio proxying the File object
2023-01-02 12:03:06 +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 2925afeefc Refetch list of instance URLs
Also bump list to more than 200
2023-01-01 21:00:43 +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 0d92f65f7e Esc for compose field 2023-01-01 19:41:42 +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 151f0875ad Upgrade relative-time-elements
They've renamed the package name
2023-01-01 18:14:35 +08:00
Lim Chee Aun 0517690ed3 Spruce up the compose button 2023-01-01 17:19:20 +08:00
Lim Chee Aun b62cff4d0e Different gradient for welcome 2023-01-01 17:19:07 +08:00
Lim Chee Aun 4d7aeca10f Make skeleton unpointerable 2023-01-01 16:09:10 +08:00
Lim Chee Aun 6306ed9602 Move updates button further down 2023-01-01 16:02:15 +08:00
Lim Chee Aun c116de8456 Don't show card when status is truncated 2023-01-01 16:01:57 +08:00
Lim Chee Aun 811de6ec0a Remove that one tiny white space at the bottom of the avatar image 2023-01-01 16:01:44 +08:00
Lim Chee Aun cf1c03f55f Delay focus compose field a little 2023-01-01 15:32: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 951c93a070 Add link to media in carousel modal 2023-01-01 12:28:54 +08:00
Lim Chee Aun 842db90f9c Handle context API call fail error 2023-01-01 12:02:11 +08:00
Lim Chee Aun 4e80e9e0cb Debounce new statuses 2023-01-01 12:01:54 +08:00
Lim Chee Aun b153d7526c Add even more spacing 2023-01-01 12:01:39 +08:00
Lim Chee Aun 5e52874aa5 Use v1 instance api
v2 is too new, only added for Mastodon v4
2023-01-01 10:59:20 +08:00
Lim Chee Aun 07163f0c3f Fix layout bug with routes
At this point, it feels like I'm writing my own react-router
2023-01-01 09:18:11 +08:00
Lim Chee Aun ac91dc7983 Make this manual opt-in 2023-01-01 08:51:56 +08:00
Lim Chee Aun e22e50705f Move things around 2023-01-01 01:46:08 +08:00
Lim Chee Aun d46a1e8b38 Set min height for timeline 2023-01-01 00:50:48 +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 f9e1704727 Disable this hover effect for large status
Will still animate in timeline but at least not as distracting
2022-12-31 20:18:56 +08:00
Lim Chee Aun b12b0c588d Experimental j,k,o,esc,backspace shortcuts 2022-12-31 09:52:31 +08:00
Lim Chee Aun 36a33e488b Use focus-visible 2022-12-31 09:51:59 +08:00
Lim Chee Aun 52d5756d44 Remove unused code 2022-12-31 09:51:28 +08:00
Lim Chee Aun 2c970f635a Make focus ring nicer 2022-12-30 23:09:25 +08:00
Lim Chee Aun c0234dd26e Add focus for notification block too 2022-12-30 23:08:55 +08:00
Lim Chee Aun 724be17d3e Basic keyboard shortcuts
Esc for carousel modal, Ctrl/Cmd+Enter for Compose field
2022-12-30 21:36:14 +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 30c529fe02 No opacity for sheet animation
Move things around a bit
2022-12-30 13:55:46 +08:00
Lim Chee Aun a409ff6712 Some images are just… too high 2022-12-30 13:37:59 +08:00
Lim Chee Aun 123d2469f6 Don't show hero pointer when loading 2022-12-30 13:26:05 +08:00
Lim Chee Aun 167399f889 Subtle press state 2022-12-30 11:03:03 +08:00
Lim Chee Aun 3338c49c25 Fix threshold for larger-than-viewport statuses 2022-12-29 16:15:58 +08:00
Lim Chee Aun 6ffc40fdf3 Use semantic <article> 2022-12-29 16:12:09 +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 160b535552 Not all cards work in large size
Check the image aspect ratio before converting to large size
2022-12-29 11:34:29 +08:00
Lim Chee Aun 808d56432e Use sinceId for new checks 2022-12-29 10:45:47 +08:00
Lim Chee Aun 353c911232 Temporarily disable this now 2022-12-29 10:27:36 +08:00
Lim Chee Aun a6196f923f Better styles for card
Show large card for large status, but only when there's no poll and media
2022-12-29 08:57:01 +08:00
Lim Chee Aun afb1a75f69 Show carousel controls initially 2022-12-28 20:46:38 +08:00
Lim Chee Aun c205a43125 Try this fancy touch-action 2022-12-28 20:38:16 +08:00
Lim Chee Aun e32c6c6473 Revert "Delay onClose after swipe"
This reverts commit 0feee7ea93.
2022-12-28 20:35:49 +08:00
Lim Chee Aun 0feee7ea93 Delay onClose after swipe 2022-12-28 20:02:28 +08:00
Lim Chee Aun 7200acc2a7 Swipe down for closing carousel 2022-12-28 19:43:02 +08:00
Lim Chee Aun 86df9fd9f8 Tap media to toggle carousel controls 2022-12-28 19:31:08 +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 02c464a139 Delay showing "status posted" toast 2022-12-28 18:05:22 +08:00
Lim Chee Aun 44617cffca Make sure bottom toast respect safe area 2022-12-28 18:04:58 +08:00
Lim Chee Aun 422a924844 Make GIF autoplay on Mobile Safari
Only in carousel, and seems like `autoplay` with `muted` ain't working in (P)react.
2022-12-28 14:47:39 +08:00
Lim Chee Aun 23a6cdbe3b Fix video alignment 2022-12-28 14:43:58 +08:00
Lim Chee Aun 5869ec3b9f Move "Read more" slightly to the left 2022-12-28 10:52:08 +08:00
Lim Chee Aun fa0ccece32 Handle > 4 medias
- Mastodon now doesn't allow >4, so this is for the future or maybe the forks.
- Using grid for better control on how images lay out
2022-12-28 10:51:57 +08:00
Lim Chee Aun 8b6cae5611 More gradients for headers 2022-12-28 10:49:43 +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 abb7f11c12 Fix danger appearing for "Follow" too 😆 2022-12-28 00:15:27 +08:00
Lim Chee Aun e8a0b401f9 Add safe fallback 2022-12-27 22:02:55 +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 03ae42ab17 Possible fix for #35 2022-12-27 19:12:36 +08:00
Lim Chee Aun cf42aab4b7 Experimental language selector in Compose field 2022-12-27 18:09:23 +08:00
Lim Chee Aun 43e0f51bcf Add bot indicator 2022-12-27 18:09:07 +08:00
Lim Chee Aun 1bb547e1a3 Use box-shadow, border skews the actual dimension 2022-12-27 11:00:05 +08:00
Lim Chee Aun c006a791b9 Comment out log 2022-12-27 09:05:54 +08:00
Lim Chee Aun fb88129ae7 Check for ref before access scrollTop 2022-12-27 09:05:45 +08:00
Lim Chee Aun f7489710a1 Temporary fix for corrupted data 2022-12-27 08:52:01 +08:00
Lim Chee Aun 04ff8eca4c Make modal backdrop appear nicely
I probably created too many similar keyframes
2022-12-27 01:44:41 +08:00
Lim Chee Aun 3ac2a45244 Got trolled by @neet 2022-12-27 01:17:04 +08:00
Lim Chee Aun eb3880b435 Handle errors here 2022-12-27 01:07:33 +08:00
Lim Chee Aun d981a31a10 Fix serious BUG
v1 uses `uri`, v2 uses `domain`
2022-12-26 23:44:18 +08:00
Lim Chee Aun ccb0032f81 Fix displayName don't need to be encoded 2022-12-26 21:19:10 +08:00
Lim Chee Aun af437ae4c8 Image vertical alignment is always a pain 2022-12-26 20:39:49 +08:00
Lim Chee Aun 7fca59782e Make donut meter work on Safari 2022-12-26 20:34:24 +08:00
Lim Chee Aun e96cc9cc16 Fix snakecase not working in Compose pop-out 2022-12-26 20:22:13 +08:00
Lim Chee Aun b25b54b79e Silent fail for custom emojis fetch 2022-12-26 20:21:16 +08:00
Lim Chee Aun e320a5be4a pre-wrap for code blocks 2022-12-26 18:05:00 +08:00
Lim Chee Aun 334584ecef Fix HTML inside code blocks being rendered 2022-12-26 18:04:49 +08:00
Lim Chee Aun 082a04c30c Maybe visibilityState is more reliable 2022-12-26 17:39:20 +08:00
Lim Chee Aun be656d585a Make boosts shorter 2022-12-26 14:33:46 +08:00
Lim Chee Aun f1ca52d561 Button text swapper for Unfollow button 2022-12-26 14:29:57 +08:00
Lim Chee Aun 6b41666efe It's time to toast 🥂 2022-12-26 14:02:05 +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 9278645069 Another attempt at fixing GIF not autoplaying on Mobile Safari 2022-12-26 01:09:19 +08:00
Lim Chee Aun c8ea2e8703 Restyle cards
Got to max-height it, and then make sure the images crop smaller
2022-12-26 00:43:17 +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 01963c9d7a Try different heart animation 2022-12-25 23:51:17 +08:00
Lim Chee Aun 641bccd685 Prettier decided to prettify this 2022-12-25 23:33:59 +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 3daa7e4f9d Fix poll showing NaN when total votes = 0
So 0/0 = NaN
2022-12-25 23:29:25 +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 0276820185 Fix className typo 2022-12-25 15:49:39 +08:00
Lim Chee Aun cff13d53f0 Forgot to revert the optimistism 2022-12-25 13:22:41 +08:00
Lim Chee Aun e4116cf9e6 Don't need left border in small screen 2022-12-24 23:17:13 +08:00
Lim Chee Aun 05fd9bdd2c Make spoiler effect work in dark mode 2022-12-24 22:52:19 +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 17ac9cc2c6 Seems like these have special URL treatments too 2022-12-24 21:14:05 +08:00
Lim Chee Aun 966e8b9cb7 Better backdrop 2022-12-24 17:54:58 +08:00
Lim Chee Aun 8eec844781 Scroll-to-top for Notifications 2022-12-24 17:54:42 +08:00
Lim Chee Aun c6b9e3fc78 New spoiler filter 2022-12-24 16:51:19 +08:00
Lim Chee Aun d6421972df Reduce spacing at the top of the thread badge 2022-12-24 14:15:47 +08:00
Lim Chee Aun c4efc26d62 Attempt to fix video not autoplaying on Mobile Safari 2022-12-24 14:15:34 +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
Lim Chee Aun 71514312bf Should be OR
A short video can be treated as GIF.
Loopability is only for <= 60 second video
2022-12-24 10:23:06 +08:00
Lim Chee Aun b96f263f69 Make "Unfollow" button look dangerous
Also add ellipsis
2022-12-24 10:05:01 +08:00
Lim Chee Aun 55ad4be580 Only show reply badge if not inside mentions 2022-12-24 01:22:25 +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