Add revision history to the editor - #377
Draft
priethor wants to merge 18 commits into
Draft
Conversation
priethor
force-pushed
the
priethor/add/visual-revision-history
branch
2 times, most recently
from
June 26, 2026 15:39
59f0233 to
2ba2d5f
Compare
priethor
force-pushed
the
priethor/add/visual-revision-history
branch
from
June 26, 2026 15:58
2ba2d5f to
19a814d
Compare
priethor
force-pushed
the
priethor/add/visual-revision-history
branch
from
June 26, 2026 16:07
19a814d to
dcf9184
Compare
The Revision tab swapped the whole inspector frame for the properties diff, which renders nothing when a document has no property fields, so pages and collections opened an empty panel. The revision-aware icon and cover lookups never ran either, since those controls only mount in the other branch.
Revisions stored before these metadata keys were revisioned carry no copy of the icon, cover, collection schema or field values. Reading that silence as "empty" cleared them on the live document. Revisions now carry a format marker, and restoring an unmarked one applies the content and leaves every metadata value alone. Formulas are materialised output rather than authored input, so they are skipped and recomputed from the values that land, the same way apply_meta_updates does it. And wp_update_post no longer leaves its own revision behind, which used to record restored content against pre-restore metadata whenever the pre-restore snapshot found nothing to save.
Rows and backlinks are deliberately outside core-data, so receiving the restored record never reached them and mounted views kept stale field values, relations and link counts. Also trims the revision cache invalidation to the one query anything actually resolves, tells the user when a restore could only apply content, and stops a failed restore from raising an unhandled rejection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #137.
Cortext now has a History panel in the editor. You can open it from the document toolbar or the sidebar row menu, preview an older version without editing it by accident, see what changed in the content and properties, and restore that version. When you restore, the version you were on is kept in history too.
How
Testing Instructions