Skip to content

Conversation

@dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jan 16, 2026

Important

DO NOT MERGE. With the merge of wordpress-mobile/GutenbergKit#260, we need to integrate those changes before we can merge this PR.

Description

Ref CMM-1123.

Implements GutenbergKit's LatestContentProvider interface for pull-based content recovery.

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 getPersistedTitle() and getPersistedContent() methods to EditorFragmentListener interface
  • Set up LatestContentProvider on GutenbergView in GutenbergKitEditorFragment
  • Implemented the interface methods in GutenbergKitActivity returning content from EditPostRepository
  • Properly set overlooked post status and ID to avoid unexpectedly emptying post titles.

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:
    • Android: Cmd+R while WebView is inspected via the Chrome Inspector by visiting chrome://inspect
  4. Verify the editor recovers with the edited content, not the original

🤖 Generated with Claude Code

@dangermattic
Copy link
Collaborator

dangermattic commented Jan 16, 2026

1 Error
🚫 This PR is tagged with Do Not Merge label(s).
1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

Project dependencies changes

list
! Upgraded Dependencies
org.wordpress.gutenbergkit:android:283-3110b008df0edceac04a1c6f18724476ce67b3ce, (changed from v0.11.1)
tree
 +--- project :libs:editor
-|    \--- org.wordpress.gutenbergkit:android:v0.11.1
+|    \--- org.wordpress.gutenbergkit:android:283-3110b008df0edceac04a1c6f18724476ce67b3ce
-\--- org.wordpress.gutenbergkit:android:v0.11.1 (*)
+\--- org.wordpress.gutenbergkit:android:283-3110b008df0edceac04a1c6f18724476ce67b3ce (*)

@dcalhoun dcalhoun added [Type] Enhancement Posting/Editing Gutenberg Editing and display of Gutenberg blocks. labels Jan 16, 2026
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

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
FlavorJalapeno
Build TypeDebug
Versionpr22493-5b4967c
Commit5b4967c
Direct Downloadjetpack-prototype-build-pr22493-5b4967c.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2026

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
FlavorJalapeno
Build TypeDebug
Versionpr22493-5b4967c
Commit5b4967c
Direct Downloadwordpress-prototype-build-pr22493-5b4967c.apk
Note: Google Login is not supported on these builds.

@nbradbury nbradbury self-assigned this Jan 19, 2026
@nbradbury
Copy link
Contributor

@dcalhoun I've enabled Chrome Dev Tools, but the three dot menu doesn't show a "Crash the renderer" item. Can you provide steps?

Screenshot_20260119_085200

@dcalhoun
Copy link
Member Author

@nbradbury sorry, this was generated by Claude and the repository's @wordpress-mobile/android-developers auto-assignment resulted in a review request. It should've been a draft. This is not ready for testing. I'll follow up once this is ready.

@dcalhoun dcalhoun marked this pull request as draft January 19, 2026 14:54
@dcalhoun
Copy link
Member Author

To answer your question, the reference to "Crash the renderer" is a hallucination. It does not exist.

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.
@dcalhoun dcalhoun force-pushed the feat/gutenberg-kit-pulls-content branch from 71b0c66 to 3a38e04 Compare January 20, 2026 19:37
@sonarqubecloud
Copy link

@dcalhoun dcalhoun marked this pull request as ready for review January 21, 2026 17:54
@dcalhoun
Copy link
Member Author

@nbradbury this PR and its sibling wordpress-mobile/GutenbergKit#283 are formally ready for review. I updated the PR descriptions with appropriate testing instructions. Thanks in advance for the help! 🙇🏻‍♂️

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.86%. Comparing base (9040f15) to head (5b4967c).
⚠️ Report is 3 commits behind head on trunk.

Files with missing lines Patch % Lines
...ss/android/ui/posts/GutenbergKitSettingsBuilder.kt 60.00% 2 Missing ⚠️
...press/android/ui/posts/GutenbergKitWarmupHelper.kt 0.00% 2 Missing ⚠️
...ess/android/ui/posts/EditorConfigurationBuilder.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22493   +/-   ##
=======================================
  Coverage   38.86%   38.86%           
=======================================
  Files        2193     2193           
  Lines      105926   105931    +5     
  Branches    14985    14986    +1     
=======================================
+ Hits        41166    41168    +2     
- Misses      61320    61323    +3     
  Partials     3440     3440           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

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

Works as expected! :shipit:

@dcalhoun dcalhoun added the Do Not Merge In PRs with this label, our automation will fail a require check, preventing accidental merging label Jan 22, 2026
@dcalhoun
Copy link
Member Author

Converting to draft. With the merge of wordpress-mobile/GutenbergKit#260, we need to integrate those changes into WordPress-Android before we can merge this PR.

@dcalhoun dcalhoun marked this pull request as draft January 22, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge In PRs with this label, our automation will fail a require check, preventing accidental merging Gutenberg Editing and display of Gutenberg blocks. Posting/Editing [Type] Enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants