-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Autosave editorial comment field before submission #379
Comments
Yea, that sounds pretty annoying.
Yea, makes sense. Though we'll have to think through the two points you mentioned
Would need to add a Just something I was thinking about on the train this morning after reading your comment: Have you explored using |
Thanks for thinking about it! The localstorage option is interesting, but could get really tricky if users have multiple posts open (a real scenario in our case) and I have no experience at all with those kinds of browser APIs. My idea of implementation was a lot simpler, but maybe it was too simple and implementing "comment statuses" would actually be the MVP to fix the problem. My idea roughly:
A simple system with little flexibility but also relatively easy to imlement without modifying tables and stuff. Main thing I'm not sure about is comment threading. If there's a way to pull out the "intended parent" of the unsaved comment (in cases where the editor used "reply" on a specific other comment), then the postmeta could be an array with the text and parent so it could be re-inserted at the right place. If the parent info couldn't be found then IMHO just putting the comment in the box would still be a huge improvement. I know my editors would rather accidentally add a new comment rather than a reply if it meant not re-typing the whole response. _UPDATE_ Inspecting _POST I found everything we need when a post is submitted (checked during _POST[replycontent] => TEXT OF COMMENT |
Got it working! Maybe it's just a proof-of-concept, but so far it solves my problems and it only requires two functions that could easily be integrated just about anywhere. See this gist for my working code: This could be it's own WP plugin but IMHO that's way overkill. Not sure how it would best be integrated into EF itself, but if no one objects to the premise it should be pretty easy to slot in. It DOES support parentage and will automatically insert the text as a reply to the correct parent comment. To get it working I had to have jQuery "click" the appropriate button (to make the textarea show) before inserting the text. Not sure if this is too hacky or not, let me know :) |
Nice work! Seems like solid way to solve your use case!
Definitely has me curious about how this could benefit newsrooms. Was thinking of some questions I'd want to ask on the train this morning once we started storing this kind of data:
I've wandered outside the scope of what you originally intended, but I think this could provide real interesting insights and information for newsrooms. Curious to hear your thoughts! |
Yeah, I think you wandered pretty far outside the core core usability problem with all that. My solution does track who saved the comment because their user ID is in the postmeta label. Personally I don't think adding a ton of metadata and long-term tracking of editorial comment drafts should be a big priority for Edit Flow at this point. They will rarely exist and will often become "submitted" in short order. If you wanted to create an editorial comments dashboard or something then only showing submitted comments would almost definitely be the right solution (otherwise you might expose unfinished comments that embarass/confuse people). My solution is intentionally light and self-destructive so that the data is as temporary as possbile. |
Yea, all solid points!
Yes, good point. Much less interested in the content of the edits. More interested in giving transparency into the editing process. What's being worked on, what's undergoing editing, etc.
Yea, most definitely. Just seems the core usability problem is kind of interesting (i.e., why do people feel the need to have "draft" editorial comments?) When you hit I see editorial comments as a place for quick hits and short remarks. So But if folks expectations are editorial comments should live independently of a post and they should be able to revisit them and rework them, might be worth investing some time into rethinking them. |
The code you wrote definitely solves your usability problem, and is exactly how I would have done it to solve your issue. I'm just always curious to hear about how other newsrooms use Edit Flow, and the usability problem you have seems like it might indicate an interesting use case. Or maybe not. But I'm always curious! |
Noting that Gutenberg does avoid this issue. Saving/changing post statuses doesn't force the full page to refresh, so any content in metaboxes and other fields is not lost. Given the low activity on this, I'm thinking maybe we could close this out? The snippet you've made is a good option for those that absolutely need this in the classic editor, but I'm not super convinced it's something that needs to be in the core plugin - given that this same behavior would happen for any other metabox out there. Will await a second opinion before closing this though. |
Currently if you type up an editorial comment but don't submit it, then save the post, the comment text is lost. This is natural in a way and users correctly "blame themselves" but still, it's not ideal.
My request is that the value in the editorial comment field be saved for each user while they are editing the post, even if they don't submit.
Here's the use case where it's important:
In this scenario, which comes up al the time for us, the editor ends up very likely to hit "save" on the post, trusting WP to autosave everything, only to come back and find their "draft" comment is gone and there's no way to get it back. They can work around this by e.g. typing the comment in an external editor, copying the comment before saving and immediately pasting it back in after saving, writing the comment in the post body etc. but none of these are elegant.
If EF just saved the text and re-inserted it after the post save users wouldn't even have to think about this aspect. They would have their comment text waiting after post save and find it totally normal because that's how all the other forms on this page work.
Not sure how hard it would be to implement, but I imagine there are some quick solutions that could reap large rewards. Ideally it would have a whole ajax-based autosave system like the post body, but IMHO that's not really necessary compared to a bare-bones solution that just ensures manually saving (in which case we should already have the partial form data while saving) passes the comment text around and gets it back in the form for that user.
Thanks and looking forward to any feedback.
The text was updated successfully, but these errors were encountered: