feat: Implement LatestContentProvider for WebView recovery#22774
Draft
dcalhoun wants to merge 2 commits intojkmassel/gutenbergkit-settings-refactorfrom
Draft
feat: Implement LatestContentProvider for WebView recovery#22774dcalhoun wants to merge 2 commits intojkmassel/gutenbergkit-settings-refactorfrom
dcalhoun wants to merge 2 commits intojkmassel/gutenbergkit-settings-refactorfrom
Conversation
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.
Collaborator
Generated by 🚫 Danger |
Contributor
|
|
Contributor
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## jkmassel/gutenbergkit-settings-refactor #22774 +/- ##
========================================================================
Coverage 37.40% 37.40%
========================================================================
Files 2320 2320
Lines 123654 123658 +4
Branches 16793 16795 +2
========================================================================
+ Hits 46256 46258 +2
- Misses 73687 73689 +2
Partials 3711 3711 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.


Description
Ref CMM-1123.
This is a rebased version of #22493, targeting the
jkmassel/gutenbergkit-settings-refactorbranch (#22764) so it can be reviewed/tested on top of the GutenbergKit v0.15.0 upgrade.Implements GutenbergKit's
LatestContentProviderinterface 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:
getPersistedTitle()andgetPersistedContent()methods toEditorFragmentListenerinterfaceLatestContentProvideronGutenbergViewinGutenbergKitEditorFragmentGutenbergKitActivityreturning content fromEditPostRepositoryRebase notes:
EditorConfigurationBuilderto the new builder API:setStatus(...)→setPostStatus(...)and removed the now-redundantsetPostType(...)call (postType is a constructor argument)Related PRs:
Testing instructions
WebView refresh recovery:
chrome://inspect