Post drafting #282

Merged
floatingghost merged 2 commits from solidsanek/pleroma-fe:drafts into develop 2023-03-10 18:55:03 +00:00
Contributor

If I ever write another lengthy reply and accidentally close the reply button only to lose what I wrote I will go insane. It works similarly to Misskey's draft feature that I also explained a bit here #281

What it does:

  • On every post/reply/quote change, it saves the whole content in a draft in a "drafts" item in the browser's local storage
  • Each reply and quote is saved separately by having ID specific keys
  • If the body/subject is empty, there are no files and the poll is empty (has no options) the draft is deleted
  • If the post/reply/quote is sent, the draft is deleted

What could be improved:

  • Use the server-side profile feature to synchronize drafts among all devices
  • The way draft keys are built. It kinda sucks

What doesn't work:

  • Poll options are saved and restored correctly, however I cannot manage to display the poll form. Using the toggle doesn't seem to work.
If I ever write another lengthy reply and accidentally close the reply button only to lose what I wrote I will go insane. It works similarly to Misskey's draft feature that I also explained a bit here #281 What it does: - On every post/reply/quote change, it saves the whole content in a draft in a "drafts" item in the browser's local storage - Each reply and quote is saved separately by having ID specific keys - If the body/subject is empty, there are no files and the poll is empty (has no options) the draft is deleted - If the post/reply/quote is sent, the draft is deleted What could be improved: - Use the server-side profile feature to synchronize drafts among all devices - The way draft keys are built. It kinda sucks What doesn't work: - Poll options are saved and restored correctly, however I cannot manage to display the poll form. Using the toggle doesn't seem to work.
solidsanek added 1 commit 2023-02-17 13:26:30 +00:00
Post: Add drafting feature
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
00704bd88c
solidsanek added 1 commit 2023-02-19 17:59:19 +00:00
Post: remove debug logs
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2c007f06e3

heyyyy that's pretty cool - we can figure out the poll stuff later

for an initial pass this is good, thanks a lot!

i'll add to "future improvements", maybe a time-to-delete? otherwise we might end up slowly eating up localstorage 🙃 but hey not like posts are big

heyyyy that's pretty cool - we can figure out the poll stuff later for an initial pass this is good, thanks a lot! i'll add to "future improvements", maybe a time-to-delete? otherwise we might end up slowly eating up localstorage 🙃 but hey not like posts are big
floatingghost merged commit 0f33b1cd79 into develop 2023-03-10 18:55:03 +00:00
floatingghost deleted branch drafts 2023-03-10 18:55:03 +00:00
First-time contributor

If the server is broken and cant save the image to disk then empty file objects are put in local storage ("files":[{},{},{},{}]) which bricks the FE after reloading.

I've also had it happen when the server was fine, maybe network interruption but I don't know how to reproduce. Rare but happened a few times over the year, also on iPhone where it is hard to clear the local storage.

FE needs to handle missing properties in file objects

If the server is broken and cant save the image to disk then empty file objects are put in local storage (`"files":[{},{},{},{}]`) which bricks the FE after reloading. I've also had it happen when the server was fine, maybe network interruption but I don't know how to reproduce. Rare but happened a few times over the year, also on iPhone where it is hard to clear the local storage. FE needs to handle missing properties in file objects
mel referenced this pull request from a commit 2024-05-15 22:36:01 +00:00
Sign in to join this conversation.
No description provided.