-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Preload editor settings within My Site #21815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/provide-editor-settings
Are you sure you want to change the base?
feat: Preload editor settings within My Site #21815
Conversation
fec3cd1
to
4235427
Compare
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21815-7a03644 | |
Commit | 7a03644 | |
Direct Download | wordpress-prototype-build-pr21815-7a03644.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21815-7a03644 | |
Commit | 7a03644 | |
Direct Download | jetpack-prototype-build-pr21815-7a03644.apk |
bf0f0ca
to
234d290
Compare
Improve load speed of editor.
Avoid redundant network requests triggered each time My Site is displayed. The stale-while-revalidate approach remains used when the editor is opened, meaning the latest editor settings are always fetched on each editor open event.
59d259f
to
802c445
Compare
Ensure the remote feature flag is taken into consideration for editor settings fetching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves editor load speed by preloading editor settings, leveraging caching to avoid unnecessary network requests. Key changes include:
- Adding a new optional parameter (skipNetworkIfCacheExists) to the FetchEditorSettingsPayload in EditorSettingsStore.kt and updating the fetch logic.
- Removing EditorSettingsStore dependency injection in EditPostActivity.kt to clean up unused references.
- Updating SelectedSiteRepository.kt to dispatch editor settings actions based on experimental feature flags and adding new dependencies.
- Injecting EditorSettingsStore in WPMainActivity.java to ensure the store processes dispatched actions.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
libs/fluxc/src/main/java/org/wordpress/android/fluxc/store/EditorSettingsStore.kt | Introduces a new payload parameter, modifies fetchEditorSettings to support caching logic. |
WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt | Removes unused injection of EditorSettingsStore. |
WordPress/src/main/java/org/wordpress/android/ui/mysite/SelectedSiteRepository.kt | Adds feature-flag-based logic to fetch editor settings and updates dependency injections. |
WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java | Injects EditorSettingsStore to ensure the store responds to dispatched actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dcalhoun This tested fine and code looks good, but there are failing tests that should be addressed.
References to feature flags and experimental features introduced test failures.
Assert new conditional logic based on experimental features.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/provide-editor-settings #21815 +/- ##
=============================================================
Coverage 39.32% 39.32%
=============================================================
Files 2125 2125
Lines 99871 99871
Branches 15385 15385
=============================================================
Hits 39277 39277
Misses 57114 57114
Partials 3480 3480 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Improve editor load speed through preloading the editor settings.
Testing instructions
Important
Enabling the
Experimental block editor
feature is required.1: My Site without cache fetches editor settings
2: My Site with cache does not fetch editor settings
3: Editor utilizes stale-while-revalidate caching