Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does it make sense to initialize the default value to edit here? Or we could just change the condition here to
editorMode !== 'navigation'
?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'm on the fence here. On one hand, I don't think it would cause much harm to set the default here, but then we'd probably to add a default for
edit-post
too (and would it also be'edit'
? probably). On the other hand, fixing the condition toeditorMode !== 'navigation'
seems to more precisely target the underlying issue, which is that hiding the side inserter should be seen as the exception and not the norm — and once you fix that you don't care which editor you're in, nor what state is persisted.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.
Yes agreed, changing the condition for rendering the inserter would be preferable.
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 think this was the right fix (adding the default) because there could be a lot more places impacted than just the inserter check. That said, I would love for us to avoid these imperative
setDefault
calls somehow at some point, it doesn't feel like a great API. Or maybe the "setDefaults" are not done in the right place, we shouldn't have to duplicate this code everywhere.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.
+1