-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Templates and Template part revision history shows wrong first revision #49164
Comments
Brilliant - thanks @draganescu |
@draganescu What technical feedback do you need? It seems like the cause of the problem is explained in the description, so I'll remove the label. I guess technically 'Clear customizations' is the same as resetting to the original revision. Given revisions are a big part of phase 3, it may not be worth tackling this fully until then, there may be some quick wins though, like showing the 'clear customizations' button in that sidebar. |
The technical feedback should have been around the basic idea of using posts that are saved on disk and loading them in the DB after 1st edit. There are options to auto-create 1st revision automagically etc. |
Quoting @talldan about a possible UX-based approach to mitigate any confusion until phase 3:
|
I'd like to add this to the 6.5 board #54503 but we seem close on time to get a fix in place for the release in a week. If anyone can take this on, let me know and let's get it added. Otherwise, leaving out for now. |
This is still an issue, @annezazu. Whose sleeve can I tug to get it fixed? Thanks! |
I won't get time for a while, but I double checked to reacquaint myself with the issue and I still think that @talldan's suggestion above is a valid approach. It's confusing when the side-by-side revisions view doesn't display the correct, or any, previous revisions so rather than hide the link to What do folks think? |
I would be curious to explore that approach and try it out! I think it could work. |
That could work, thank you for taking a look, @ramonjd! |
I'm still looking at options on this. Jotting down some notes from today:
|
How big of an issue is this? Feels a bit obscure (thinking on priority). |
My personal read of its 'bigness' is mild to lukewarm. Even on issues like Automattic/wp-calypso#74685 That revisions (2) only appear after having saved the template three times is pretty weird - it's a side-effect of the way Core handles changes to template files. Maybe a small UI change could mitigate it, but I'd question the value of going any deeper right now. What do other folks think? |
Sharing a connected issue - #52221. I think the two are connected, as the incorrect revision history would make preserving/resetting the history not work correctly. 🤔 |
Description
When editing for the 1st time a template or template part and saving, the result of the edit is saved in the database. That becomes the 1st version of the post saved. This is erroneous because compared to the original version saved on disk, the 1st version saved in the database contains edits. This leads to a poor UX like the one described in #48610 where users think their edits have not been saved as a revision.
The templates and template parts are not in the database and the 1st time they're edited they're basically added to the database, along with their edit. This shows up as two revisions, one with an empty post and one with the post having all the content (including the 1st edit).
Starting only with the 2nd edit, which will result in 3 available revisions, will we see actual diffs.
Step-by-step reproduction instructions
You can check for template revisions immediately, or after closing and re-opening the Site Editor. But none will.
After this edit - revisions will start showing.
props @jordesign
Screenshots, screen recording, code snippet
revisions-after-one-edit.mp4
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: