-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Mitigate GutenbergKit text composition oddities #21883
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: trunk
Are you sure you want to change the base?
fix: Mitigate GutenbergKit text composition oddities #21883
Conversation
Forcibly ending text composition led to odd outcomes--e.g., erroneously dismissing the inline inserter, resetting editor history stack. It was originally added to ensure the latest text in the editor is captured before providing it to the host app for persistence. This appears necessary for Samsung device keyboards only. For the time being, text may be lost on these devices if the user does not first blur the text input before saving or exiting the editor.
Ensure the latest text is captured before attempting to persist the post content.
The rest of the editor methods throw this exception.
Generated by 🚫 Danger |
Project dependencies changeslist! Upgraded Dependencies
org.wordpress.gutenbergkit:android:134-9ddb18e52f80387559ae1bcde7c59a3657b93212, (changed from trunk-fdfe788530bbff864ce7147b5a68608d7025e078) tree +--- project :libs:editor
-| \--- org.wordpress.gutenbergkit:android:trunk-fdfe788530bbff864ce7147b5a68608d7025e078
+| \--- org.wordpress.gutenbergkit:android:134-9ddb18e52f80387559ae1bcde7c59a3657b93212
-\--- org.wordpress.gutenbergkit:android:trunk-fdfe788530bbff864ce7147b5a68608d7025e078 (*)
+\--- org.wordpress.gutenbergkit:android:134-9ddb18e52f80387559ae1bcde7c59a3657b93212 (*) |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21883-a936fc0 | |
Commit | a936fc0 | |
Direct Download | jetpack-prototype-build-pr21883-a936fc0.apk |
|
App Name | ![]() |
|
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr21883-a936fc0 | |
Commit | a936fc0 | |
Direct Download | wordpress-prototype-build-pr21883-a936fc0.apk |
.../editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergKitEditorFragment.java
Fixed
Show fixed
Hide fixed
.../editor/src/main/java/org/wordpress/android/editor/gutenberg/GutenbergKitEditorFragment.java
Fixed
Show fixed
Hide fixed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #21883 +/- ##
=======================================
Coverage 39.58% 39.58%
=======================================
Files 2130 2130
Lines 99558 99558
Branches 15350 15350
=======================================
Hits 39406 39406
Misses 56669 56669
Partials 3483 3483 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The existing `doFinish` argument is used to managed finishing the activity after saving. Because we want to complete text composition for this same context, reusing this argument seems appropriate.
f47ec77
to
a936fc0
Compare
|
private fun updateAndSavePostAsyncOnEditorExit(listener: OnPostUpdatedFromUIListener?, | ||
isFinishing: Boolean = false) { |
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.
private fun updateAndSavePostAsyncOnEditorExit(listener: OnPostUpdatedFromUIListener?, | |
isFinishing: Boolean = false) { | |
private fun updateAndSavePostAsyncOnEditorExit( | |
listener: OnPostUpdatedFromUIListener?, | |
isFinishing: Boolean = false | |
) { |
⛏️ Just following a more Kotlint style
Unfortunately, I don't have any Samsung device to test this step
|
I've tested all the scenarios except for the Samsung one, and they work as expected now. Thanks! Screen.Recording.2025-05-16.at.09.44.23.movSo, waiting for some clarification, especially what to do about Samsung, and I can then approve the PR :) |
Description
Fix CMM-353. Fix CMM-199.
Mitigate text composition oddities where editor history was lost and the inline
block inserter erroneously dismissed.
Related:
Testing instructions
Important
A bug remains present for Samsung keyboard users where the inline inserter does not update its filtering until text composition ends—adding a space, tapping a word in the toolbar, etc.
1: History stack functions as expected
See: wordpress-mobile/GutenbergKit#130
2: Inline inserter does not prematurely dismiss
See: wordpress-mobile/GutenbergKit#103
3: Save on exist includes latest typed content for devices using Samsung keyboard with predictive text
4: Smoke test the Gutenberg Mobile (GBM) and Aztec editors
For GBM: Disable the experimental editor.
For Aztec: P9ugOq-4rN-p2