Use the edited post date to compute default ActivityPub visibility - #3643
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the ActivityPub editor sidebar plugin so the default visibility calculation uses the edited post date (not the last-saved date), preventing the visibility sync effect from writing post meta after a save and incorrectly marking the editor as dirty.
Changes:
- Switch default visibility computation to read
dateviagetEditedPostAttribute( 'date' )inside the existinguseSelectblock. - Add regression tests that render the real
EditorPluginwith a mocked editor store to catch selector regressions. - Add a patch-level changelog entry describing the user-facing fix.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/editor-plugin/plugin.js | Uses the edited post date selector for default visibility computation to avoid post-save dirty state. |
| src/editor-plugin/tests/visibility-sync.test.js | Adds regression coverage by rendering the real plugin and asserting meta sync behavior across saved-vs-edited date scenarios. |
| build/editor-plugin/plugin.js | Generated build output updated to reflect the source change. |
| build/editor-plugin/plugin.asset.php | Generated asset metadata/version updated. |
| .github/changelog/fix-editor-dirty-after-save | Patch changelog entry for the editor dirty-state fix. |
Files not reviewed (1)
- build/editor-plugin/plugin.js: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fixes #3641
Proposed changes:
Backdate a post by more than a month, save it, and the editor immediately claims you have unsaved changes and warns you about leaving the page.
The plugin defaults posts older than a month to "Do not federate" and saves that choice onto the post. It was reading the date from the saved copy instead of the one you're editing, so it only noticed the new date after the save had finished — and writing its choice down that late looks like a fresh edit.
Now it reads the date you're actually editing.
Side effect worth knowing: publishing a backdated post no longer sends it to your followers. It used to go out anyway, despite the sidebar saying "Do not federate".
Doesn't fix the undo trap also described in #3641.
Testing instructions:
wp post list --post_type=ap_outboxChangelog entry
Already committed as
.github/changelog/fix-editor-dirty-after-save.