Commit graph

112 commits

Author SHA1 Message Date
Lim Chee Aun
b72f683a97 Add "12 hours" option for poll duration 2023-01-22 20:50:11 +08:00
Lim Chee Aun
a522511e0e Add "Mark media as sensitive" checkbox
It does the same thing as spoiler text toggle.
2023-01-22 19:33:45 +08:00
Lim Chee Aun
6e72601833 Compose now supports paste/drag-drop files 2023-01-16 09:42:44 +08:00
Lim Chee Aun
d9096ce831 Make media modal sheet max 2023-01-13 17:23:18 +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
dfaec0605a Can re-use the UID as new window target name! 2023-01-11 23:23:49 +08:00
Lim Chee Aun
162fc7ad07 Pass UID across composer popups 2023-01-11 17:07:47 +08:00
Lim Chee Aun
adcea89a25 Add UID as Idempotency key 2023-01-11 14:44:20 +08:00
Lim Chee Aun
a421406a11 DRY get current Account 2023-01-11 13:28:42 +08:00
Lim Chee Aun
3506285176 Better ID for media attachments
The `i` persists for other attachments too. Not good.
2023-01-09 14:33:47 +08:00
Lim Chee Aun
54a95363f0 Use console.debug 2023-01-07 21:02:46 +08:00
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
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
7e869949e2 Turns out, still change CW when editing 2023-01-03 17:41:18 +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
727b944f3b toLowerCase() all the instance URLs! 2023-01-01 20:59:55 +08:00
Lim Chee Aun
0d92f65f7e Esc for compose field 2023-01-01 19:41:42 +08:00
Lim Chee Aun
cf1c03f55f Delay focus compose field a little 2023-01-01 15:32:36 +08:00
Lim Chee Aun
52d5756d44 Remove unused code 2022-12-31 09:51:28 +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
e8a0b401f9 Add safe fallback 2022-12-27 22:02:55 +08:00
Lim Chee Aun
cf42aab4b7 Experimental language selector in Compose field 2022-12-27 18:09:23 +08:00
Lim Chee Aun
f7489710a1 Temporary fix for corrupted data 2022-12-27 08:52:01 +08:00
Lim Chee Aun
eb3880b435 Handle errors here 2022-12-27 01:07:33 +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
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
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
fcd29d4bdc Aesthetic changes
- Icon change for "Unlisted"
- Dynamic text size for compose field depending on char count
2022-12-23 21:25:01 +08:00
Lim Chee Aun
2def939821 Fix textarea focus not working 2022-12-23 19:33:51 +08:00
Lim Chee Aun
13a347ce37 New: char count for Compose field
Uses pre-compiled regex for perf
2022-12-23 16:45:02 +08:00
Lim Chee Aun
263e48d019 New feature: :shortcode: expander in compose field
Using `innerHTML` because easier to code but the `encodeHTML` function is troublesome
2022-12-22 19:24:07 +08:00
Lim Chee Aun
33f0f21399 My sense of logic is getting worse 2022-12-21 01:03:24 +08:00
Lim Chee Aun
d6575037eb No popping in standalone mode 2022-12-20 20:23:57 +08:00
Lim Chee Aun
5e687e871f Bring back polling but bump up timeout
- Polling is needed because status post requires the media to be done processing (not just uploaded)
- But the default timeout set in masto.js is 3s, a bit too low if uploading a large video
- Bumping up to 30s
2022-12-20 13:29:38 +08:00
Lim Chee Aun
9bc5340714 Extra check on loading state before allow closing 2022-12-20 13:27:14 +08:00
Lim Chee Aun
e274950324 Disable popping-in/out and closing when loading 2022-12-20 13:26:45 +08:00
Lim Chee Aun
3921f8a6f9 Debugging 2022-12-20 13:24:56 +08:00
Lim Chee Aun
1c18184ef4 Fix one-char space inserted when replying to own posts 2022-12-17 17:25:04 +08:00
Lim Chee Aun
db1e481bd3 Ugh have to manual trigger onInput
Is there a way to just auto trigger this?
2022-12-16 00:54:44 +08:00
Lim Chee Aun
03d2e2aa72 Add TODO for now for handling multiple mentions
If it's just all mentions with no textual content = can close(?)
But if there're a lot of mentions, won't it be dangerous to close?
User can still edit whatever in between like rearranging the mentions etc
2022-12-16 00:53:04 +08:00
Lim Chee Aun
859500a292 Fix copy since it's not just replying to one person 2022-12-16 00:51:08 +08:00
Lim Chee Aun
a41b18b331 Fix auto-prepending mentions when replying
Prepend not just the reply-to status's acct, but also all mentions' acct
BUT excluding self
2022-12-16 00:50:38 +08:00
Lim Chee Aun
45babb150b Try skip polling
For large medias, API returns 202 Accepted and media is still processing https://docs.joinmastodon.org/methods/media/#v2

masto.js does extra manual poll check by GET-ing the media after uploaded to see if the media is done processing
2022-12-15 21:34:21 +08:00
Lim Chee Aun
fc235024aa Handle pop-in case when there's already a Compose field open
Show confirmation first before popping-in
2022-12-15 13:03:20 +08:00
Lim Chee Aun
b0372ea83b Dispatch oninput manually when textarea value change
I thought… React/Preact should do this automagically…
2022-12-14 22:54:12 +08:00
Lim Chee Aun
72751709df New feature: poll
- More fixes
2022-12-14 21:48:17 +08:00
Lim Chee Aun
975f3dd33f Finally fix HMR not working for this file 2022-12-14 00:39:35 +08:00
Lim Chee Aun
0e1f4c527e This close window check is getting on my nerves 2022-12-14 00:20:24 +08:00
Lim Chee Aun
2b21c421d1 Comment out this console.log 2022-12-14 00:19:49 +08:00
Lim Chee Aun
fb6bca9016 Fix wrong logic again 2022-12-13 22:26:29 +08:00
Lim Chee Aun
e2346bc32a Shift+click to open compose window
- Fixes for closing
- Easier code for checking if can close window
2022-12-13 21:54:16 +08:00
Lim Chee Aun
9d78e67381 New feature: pop-out compose window
- More consistent design for both reply-to status and source status preview
- Fixed bugs too
- Make sure index.css is always above
2022-12-13 20:42:09 +08:00
Lim Chee Aun
7b7b8b9443 Different copy for editing 2022-12-13 01:14:52 +08:00
Lim Chee Aun
74ef381a9c Remove this console.log 2022-12-13 00:23:47 +08:00
Lim Chee Aun
de5c33a568 Fix gifv not loading 2022-12-13 00:23:37 +08:00
Lim Chee Aun
ad8ae165a6 Fix check before closing 2022-12-12 21:58:02 +08:00
Lim Chee Aun
5353a4535a New feature: Edit status!
Get's a bit hacky now
2022-12-12 21:54:31 +08:00
Lim Chee Aun
b988b10c3d Fixes and refactor for compose UI with media uploads
Somehow prettier (for CSS) start running properly
2022-12-12 16:27:44 +08:00
Lim Chee Aun
7f02a7f794 Use a better string length
Using `string-length` instead of `stringz` that's used by Mastodon
2022-12-10 20:46:56 +08:00
Lim Chee Aun
2b9390a0a1 Initial commit 2022-12-10 17:14:48 +08:00