-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Revert "Implement GutenbergKit ViewModel Architecture (#22087)" #22127
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
Conversation
This reverts commit 890d484.
|
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22127-b637fad | |
Commit | b637fad | |
Direct Download | wordpress-prototype-build-pr22127-b637fad.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr22127-b637fad | |
Commit | b637fad | |
Direct Download | jetpack-prototype-build-pr22127-b637fad.apk |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/26.1 #22127 +/- ##
=============================================
Coverage 39.43% 39.43%
=============================================
Files 2149 2149
Lines 101872 101872
Branches 15604 15604
=============================================
Hits 40177 40177
Misses 58126 58126
Partials 3569 3569 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
I did not encounter any regressions while smoke testing GutenbergKit.
The
ViewModel
approach mixes static configuration with dynamic content and could cause state synchronization problems. The Bundle-based approach is simpler and more appropriate for passing initialization parameters.
For my own understanding, would you mind sharing an explicit example(s) of synchronization problems? Are they severe or prevalent enough to target the beta branch?
@dcalhoun This is a precautionary revert, rather than addressing a bug I've found. While working on The way As for whether to target the frozen branch or not, I think there is a trade-off:
Considering this is behind an experimental flag, I believe it'd be best to revert this in the frozen branch. In my opinion, we want to be as close to the final version as possible in every release we do for this experimental feature to get the most out of this period. What do you think? |
@oguzkocer thank you for elaborating on the context and rationale. I agree, it makes sense to revert in the release branch. |
* Revert "Implement GutenbergKit ViewModel Architecture (#22087)" (#22127) This reverts commit 890d484. * Fix `GutenbergKit` editor issues during dark mode toggle (#22135) * Remove isEditorStarted flag to fix content loss during activity restart The isEditorStarted flag was preventing editor reinitialization during activity restarts, but this caused content loss because: 1. Activity restart triggers new fragment creation 2. isEditorStarted gets reset to false in onDestroy() 3. startWithEditorSettings() gets called but always rebuilds from original data 4. Current editor content is lost instead of being preserved Root cause: The flag was designed to prevent duplicate initialization within a single fragment instance, but during activity restarts, we WANT the editor to reinitialize with the current content, not block reinitialization entirely. Changes: - Remove isEditorStarted field and related state management - Remove isEditorStarted checks in startWithEditorSettings() - Allow editor to reinitialize after activity restart - Fixes content loss during dark mode toggle * Fix double ViewPager setup during auth state changes Prevent duplicate editor initialization by: 1. Only calling fetchWpComCookies() if not already in Success state 2. Adding ViewPager state check to prevent duplicate setup 3. Using distinctUntilChanged() to prevent duplicate LiveData emissions 4. Consolidating Success handling logic in handleSuccessfulAuth() Changes: - Check auth state before calling fetchWpComCookies() - Add ViewPager adapter check with error logging for duplicate setup attempts - Add distinctUntilChanged() to auth state observer - Extract handleSuccessfulAuth() for consistent Success state handling - Remove debug logging from production code * Update translations * Update translations * Bump version number * Update WordPress metadata translations for 26.1 * Update Jetpack metadata translations for 26.1 --------- Co-authored-by: Oguz Kocer <[email protected]>
Summary
Reverts the
GutenbergKitViewModel
implementation as it may create configuration change issues and adds complexity without clear benefits.Note that this was a clean revert, so it doesn't include any additional changes.
Reason
The
ViewModel
approach mixes static configuration with dynamic content and could cause state synchronization problems. The Bundle-based approach is simpler and more appropriate for passing initialization parameters.Testing Instructions
Check for any regressions.