Skip to content

Conversation

@paulkaplan
Copy link
Contributor

The use of an "override" prop that allowed the preview modal to be hidden without actually changing the redux state was causing a problem where the block editors where not closing when modals were opening. That is because it relied on the modal reducer being accurate.

I defaulted the preview state to false to make it simpler to consume the GUI, as www will not want the preview info to be true. I made it true in the playground instead.

This fixes #3710

I can't write an integration test for that specific issue yet because it only happens when embedded, but the current integration tests ensure that the preview modal is still there in the playground the way we want. I confirmed the fix for #3710 by manually linking and testing.

Copy link
Contributor

@benjiwheeler benjiwheeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good! I'm hoping that the logic can be clarified a bit... LMK if the direction I'm suggesting makes any sense.

@paulkaplan
Copy link
Contributor Author

@benjiwheeler thanks for the comments, restructuring the negative "if" is definitely more clear.

I don't love the mini reducers in GUI either, but I do not really see a better way to have the initial state be something other than what the reducer says it is. It doesn't really make sense to dispatch to make this change, because there is no user action that is happening, it is just that the initial state is different between gui/www.

@benjiwheeler
Copy link
Contributor

This looks good, but could you wait for ChrisG to merge the much simpler #3725 , which also touches hideIntro? Should land today

The use of an "override" prop that allowed the preview modal to be hidden without actually changing the redux state was causing a problem where the block editors where not closing when modals were opening. That is because it relied on the modal reducer being accurate.

I defaulted the preview state to false to make it simpler to consume the GUI, as www will not want the preview info to be true. I made it true in the playground instead.

This fixes scratchfoundation#3710
@benjiwheeler
Copy link
Contributor

LGTM

@paulkaplan paulkaplan merged commit 3580cc1 into scratchfoundation:develop Nov 16, 2018
@paulkaplan paulkaplan deleted the fix-preview-modal branch November 16, 2018 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block editors not being hidden by modals when embedded

2 participants