fix(js): skip redux toggle when opening native block inserter#487
fix(js): skip redux toggle when opening native block inserter#487jkmassel wants to merge 1 commit into
Conversation
857a294 to
e84a41c
Compare
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/487")Built from 045288c |
Tapping the `+` button currently calls `setIsInserterOpened(true)` in the editor store, which momentarily renders Gutenberg's web inserter before the native dialog covers it — visible as a flash on slower devices. Call `prepareAndShowInserter()` directly instead; the redux flag isn't useful when the inserter is rendered natively.
e84a41c to
045288c
Compare
oguzkocer
left a comment
There was a problem hiding this comment.
@jkmassel Do you have a recording of the flash this is fixing? Because I tried recording before and after and I don't see any change. I am working with Claude to see maybe it's just a build issue on my end because I tested the fix before I tested the base branch. Here are the recordings:
Recording from: jkmassel/android-block-picker:
487-before.webm
Recording from jkmassel/native-inserter-no-redux-flash:
487-after.webm
oguzkocer
left a comment
There was a problem hiding this comment.
I think maybe the reason I am not seeing a flash is this:
a visible flash on slower devices.
So, I am going to approve the PR on the code change and the fact that I am not observing a flash after the change. 🤷
Summary
Tapping the
+button currently callssetIsInserterOpened(true)on the editor store, which momentarily renders Gutenberg's web inserter UI before the native dialog covers it — a visible flash on slower devices. CallprepareAndShowInserter()directly instead; the redux flag isn't useful when the inserter is rendered natively.Test plan
enableNativeBlockInserteron, tap the+toolbar buttononToggle(false)fromwindow.blockInserter.onClose)