Skip to content

Conversation

@dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jan 16, 2026

Description

Ref CMM-1123.

Implements the editorRequestsLatestContent delegate method for GutenbergKit's pull-based content recovery mechanism.

When the WebView reinitializes (due to OS memory pressure or page refresh), the editor now requests the latest content from the app rather than using stale content from the initial WebView load. This ensures users don't lose their work during WebView recovery.

Changes:

  • Added editorRequestsLatestContent(_:) delegate method to NewGutenbergViewController
  • Returns the current post title and content from Core Data (the authoritative source updated via autosave)

Related PRs:

Testing instructions

  1. Open a post with existing content in the GutenbergKit editor
  2. Make edits to the content (wait 2+ seconds for autosave to persist)
  3. Trigger a WebView refresh:
    • Safari DevTools: Cmd+R while WebView is inspected
    • iOS Simulator: Open Activity Monitor, force quit "com.apple.WebKit.WebContent"
  4. Verify the editor recovers with the edited content, not the original

🤖 Generated with Claude Code

Allow GutenbergKit to retrieve the latest content persisted in the host
app as needed. This is important for allowing GutenbergKit to display
the latest content after the WebView reloads or re-initializes from
memory pressure or backgrounding.
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@sonarqubecloud
Copy link

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30474
VersionPR #25144
Bundle IDorg.wordpress.alpha
Commit9a8f7c0
Installation URL5nn49r5p4u9gg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30474
VersionPR #25144
Bundle IDcom.jetpack.alpha
Commit9a8f7c0
Installation URL4qepklgcif28g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@dcalhoun dcalhoun added [Type] Enhancement Posting/Editing Gutenberg Editing and display of Gutenberg blocks. labels Jan 16, 2026
@dcalhoun dcalhoun marked this pull request as draft January 19, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gutenberg Editing and display of Gutenberg blocks. Posting/Editing [Type] Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants