Skip to content

Use the edited post date to compute default ActivityPub visibility - #3643

Merged
arcangelini merged 2 commits into
trunkfrom
fix/3641-editor-dirty-state
Aug 11, 2026
Merged

Use the edited post date to compute default ActivityPub visibility#3643
arcangelini merged 2 commits into
trunkfrom
fix/3641-editor-dirty-state

Conversation

@arcangelini

@arcangelini arcangelini commented Aug 11, 2026

Copy link
Copy Markdown
Member

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:

  • New post, add content, set the date to over a month ago, save the draft.
  • Editor should stay clean — no unsaved-changes warning when you navigate away.
  • Fediverse ⁂ panel should read "Do not federate".
  • Repeat with today's date: should read "Public", editor still clean.
  • Publish a backdated post, confirm nothing queued: wp post list --post_type=ap_outbox

Changelog entry

Already committed as .github/changelog/fix-editor-dirty-after-save.

Copilot AI lite review requested due to automatic review settings August 11, 2026 12:43
@arcangelini arcangelini added the Bug Something isn't working label Aug 11, 2026
@arcangelini arcangelini self-assigned this Aug 11, 2026
@arcangelini
arcangelini requested a review from a team August 11, 2026 12:43
@github-actions github-actions Bot added [Block] Post settings [Focus] Editor Changes to the ActivityPub experience in the block editor labels Aug 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 date via getEditedPostAttribute( 'date' ) inside the existing useSelect block.
  • Add regression tests that render the real EditorPlugin with 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.

Comment thread src/editor-plugin/plugin.js Outdated

@mcsf mcsf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, fixes it for me!

@arcangelini
arcangelini merged commit e2987cd into trunk Aug 11, 2026
12 checks passed
@arcangelini
arcangelini deleted the fix/3641-editor-dirty-state branch August 11, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Post settings Bug Something isn't working [Focus] Editor Changes to the ActivityPub experience in the block editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor unexpectedly marked as dirty, and unable to undo changes

3 participants