Repository navigation
Conversation
|
Try this branch in WordPress Playground, with a WooCommerce shop, for an AI agent to drive, or on a blank site with WordPress's default theme. All run the latest build of To start in a workspace other than Default, open it in Writing, Builder or Selling. |
getdave
force-pushed
the
getdave/site-history
branch
from
November 19, 2026 21:59
63c52ec to
b7bb2f0
Compare
scruffian
approved these changes
Nov 20, 2026
scruffian
left a comment
Member
There was a problem hiding this comment.
I still think we haven't got this totally right, but this is a step in the right direction.
getdave
marked this pull request as ready for review
November 20, 2026 12:05
Phase 2 of the "Simplified publish" prototype. A clock in the top bar opens a panel listing what each Publish site published. - A small PHP log (`includes/site-history.php`) records each Publish site as one entry: the time, the person, and per change the core revision it made, or for site settings the values saved. Only templates, template parts, site styles, menus and site settings go in. Pages and posts keep core's revisions. - Each change carries what it changed, from what to what, worked out just before the save (`site-history-diff.js`): style values by preset name with swatches, settings, and blocks added, removed or edited. - Three levels: an entry, its changes with a one-line summary, and a screen of every detail. - Restore asks first in a dialog, then loads the version back in as unsaved edits that wait for Publish site. Nothing is previewed. - The clock is disabled until something has been published. - PHPUnit tests for the log; unit tests for the diffing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getdave
force-pushed
the
getdave/site-history
branch
from
November 20, 2026 12:33
b7bb2f0 to
eade78b
Compare
A revision holds a record as a save left it, so an entry's own revisions are what the site already shows, and Restore put back what was live. Going back to an entry now undoes every later publish instead: each record they changed goes back to how it was before the oldest of them. - Log `previous_revision` with each record, and `previous` values with each site setting. - Note the revision each person's save made, so a save by someone else before the entry is logged isn't claimed. - Keep a record's original as a revision before its first update, so the first change can be undone. - Only keep site settings REST knows. - Say when there was nothing to put back, rather than "Version put back". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rCnBtFg3artGYxgKtvdpE
- A template or part a later publish first changed had no earlier version, so restoring to before it failed. It now goes back to the theme's file, as core's reset does but as an unsaved edit. - An autosave is no longer noted as the revision a save made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rCnBtFg3artGYxgKtvdpE
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 does this do?
This adds site history to "Simplified publish", stacked on #270. A clock in the top bar opens a panel listing everything Publish site has published, and any earlier version can be brought back.
Only what Publish site publishes is listed: templates, template parts, site styles, menus and site settings. Pages and posts keep core's own revisions.
How does it work?
includes/site-history.phpadds one entry per Publish site with the time, the person and each change. A change points at the revision it made, or holds the saved values for a site setting. The log is a non-autoloaded option capped at 50 entries, read and written through/site-history.site-history-diff.jsworks out what changed and stores it with the entry. Style values show by their preset name with colour swatches, settings show their old and new values, and blocks show as edited, added or removed. Each entry therefore still reads correctly after the theme or palette changes.The clock stays disabled until something has been published.
What's not here yet?
Unpublished changes still live only in the editor's memory, so a refresh loses them. Keeping a draft between visits, and scheduling, come next.
How do I test it?
Tests
tests/phpunit/site-history-test.php: entries, revisions, leaving out pages, the cap, permissions, and keeping details safe.src/top-bar/test/site-history-diff.js.🤖 Generated with Claude Code