-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Default to Gutenberg upon opening a block based post #12066
Default to Gutenberg upon opening a block based post #12066
Conversation
@@ -7,6 +7,7 @@ import Foundation | |||
/// list objects. | |||
protocol KeyValueDatabase { | |||
func object(forKey defaultName: String) -> Any? | |||
func bool(forKey: String) -> Bool |
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.
This should be in a protocol extension since it’s just a wrapper that will be the same for all cases
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.
Nice catch! Updated 👍
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.
It works! There is a case that this didn't account for but I think we can live with that. The logic checks if the dialog has been shown, not if the setting has been changed, so the following is possible:
- Install the app
- Go to settings and enable gutenberg
- Try gutenberg for a few things
- Decide you don't want it anymore and disable the app setting
- Open a gutenberg post, the alert shows and gutenberg is enabled again for new posts
Since it seems like an odd case, and it would only happen once, I think it's fine?
… KeyValueDatabase
To describe automatic switch flip to make gutenberg the default editor.
As agreed, we will merge this as a short lived feature, so we won't worry about these edge cases. |
Fixes wordpress-mobile/gutenberg-mobile#1186
This PR flips the "default for new posts" switch to true the first time the block editor is launched, if the switch is off.
The alert text was changed to match wordpress-mobile/gutenberg-mobile#1186 (comment)
The logic is:
When the alert is shown, we automatically flip the switch located in App Settings.
This will trigger the tracks event
AppSettingsGutenbergEnabled
but I'd say that it is still desirable, unless we want a new tracks event for this particular case?I'm unsure if we should add this to the release notes.
To test:
UserDefaults.standard.setValue(false, forKey: "Gutenberg.InformativeDialog")
to be triggered on app lunch. (onapplicationWillEnterForeground
is helpful to easily reset it)Update release notes:
RELEASE-NOTES.txt
.