-
Notifications
You must be signed in to change notification settings - Fork 177
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
Enable autosave for published stories #1402
Comments
A brief summary of how autosaves/revisions work in WordPress: (I recommend trying it yourself to get a better feeling for it)
Let's say you edit a post, save it, and then make some changes again. If you later open the editor, you might get a message like this (depending on whether the changes were saved to session storage or the database: Clicking on the review link will lead you to a WP UI to compare changes in a diff view: Here's where the implementation in the story editor differs:
cc @choumx @gajasinski @aaskedall @agingoldseco for thoughts & prioritization |
Ona difference I forgot to mention above: In Gutenberg, when you create a new post, that post will be periodically autosaved as an autosave, not a "proper" save. To fix this, we simply need to remove the |
@agingoldseco Would love your input here All we basically need is UX for this kinda message: |
My thoughts on the goal of this ticket (which should probably be split into multiple tickets). New flowEditor changesWorking on an unpublished draft of a published storyWhen you publish a story and keep working, or if you load an already published story and start working on it, the header changes to the following options:
All of these extra buttons have some underlying technical consequences, that we can always discuss, but I'm not sure how much we should reveal to the user about what those consequences are. Loading a published story with an autosaveWhen you open a published story in the editor, that has an autosave newer than the published version the story, currently this dialog is displayed: The "View the autosave" button is pretty useless though, as it takes you to a diff view of the underlying JSON changes, which is far too technical to be useful. I propose we instead display something like this dialog: Here you can open previews for the published story and autosave for comparison (it does require that you manually check the differences, but it is a lot more useful that the JSON diff view at least. We could add additional information to this dialog such as "autosave last modified on July X by Author Y" and maybe even some metadata about said changes: "The autosave includes changes to story metadata, page 3, and page 8". If you click the last button, "keep working", the autosave is loaded in the editor as in the above scenario where you keep working on an unpublished draft of a published story. Dashboard changesWe need to highlight that a given published story has an unpublished autosave somehow. Suggestions are welcome, but a simple solution would be something as beautiful as this: If the user wants to see or restore the autosave, they have to click on the story and go into the editor. We could however add a new option to the options menu to directly discard the autosave without going through the editor? New APITo support the above flow, we need to extend the API between WP and the editor a bit. When a story is loaded in the editor, the config is extended with a new field, {
...,
autosave: {
revision_id: "<id>",
last_modified: "<timestamp>",
author: "<author name>",
preview_link: "<URL>",
}
} We then also extend the API with a new endpoint to retrieve a revision as well as delete one: I don't think we need an API to "restore story from revision" (even though WP has that as a built-in function) as we would handle that manually in the editor by simply overwriting the story data with the data from the autosave. I guess the WP function to restore from revision also deletes the revision, but we could also do that manually when the user chooses to republish. Ping @swissspidy, @timarney, @merapi, @miina for input. |
Thanks for this summary 👍 There are definitely some good ideas here. Admittedly, working on this is not straightforward because this ticket hasn't been updated in quite some time and mixes a bunch of things, plus the terminology and possible constellations are also confusing. Because of that, I'd like to provide some additional context... Ever since we built the initial version of the editor, the workflow with revisions/autosaves/publishing etc. did not match the rest of WordPress and thus caused quite some UX inconsistencies and sometimes even user frustration. That's why we've added support for "submit for review" in the past, and are now working on things like sessionStorage autosaving, properly supporting the auto-draft status, and making it easier to access revisions— all in an effort to more closely align the behavior. Speaking of revisions, there's actually some limitation there: WordPress does not natively support revisions to already published posts. That makes it very hard for us to build this. And that's also why people have even built clever solutions to support amendments to published posts and cloning/duplicating posts.
I like the suggestion with the changes to the buttons there. IIUC this would require support for revisions on published stories though (not just autosaves), since it would allow you to make multiple edits to an already published story, without affecting the published content though. Since WP does not support this natively, it would require quite a few backend changes to make this work. Let's track this idea separately in its own ticket so we can dig more into technical feasibility.
Ditto w/ a separate ticket. I like adding a preview option. Perhaps with a dropdown button instead of this many individual buttons.
I like the idea and I think this is something we can already do now. It could check for autosaves both in sessionStorage and the db Maybe displayed with a Something that we must already do today to make autosaves work for published stories is removing the We can repurpose this ticket for that.
The revision endpoint exists at Please let me know what you think. Aside: no corgis in the pictures? 🙂 |
@swissspidy, it seems that this ticket is completely useless at this point, no? Do you want to keep it around, re-purpose it, or just close it? |
Feature Description
Currently, per #221 we disable autosave for published stories. The proposed change here is:
The proposed UX changes are (need finalization before ticket moves to eng queue):
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria
QA Instructions
The text was updated successfully, but these errors were encountered: