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

Code Editor: unselect blocks and disable inserter #9815

Merged
merged 3 commits into from Sep 12, 2018

Conversation

Projects
None yet
5 participants
@youknowriad
Contributor

youknowriad commented Sep 12, 2018

closes #9807

This PR does two things:

  • Always unselect blocks when switching to the code editor to avoid lingering controls in the inspector/toolbar
  • Disable the inserter when we switch to the code editor. It's a very confusing experience to allow it in the Code editor (see #9807)

@youknowriad youknowriad self-assigned this Sep 12, 2018

@youknowriad youknowriad requested review from jasmussen and WordPress/gutenberg-core Sep 12, 2018

@tofumatt

I dig it. Tested locally and it was nice.

Seems a good contender for an e2e test or two. If you want to add them now I'm happy to review again, otherwise could you file an issue? 😄

return (
<NavigableToolbar
className="edit-post-header-toolbar"
aria-label={ __( 'Editor Toolbar' ) }
>
<FullscreenModeClose />
<div>
<Inserter position="bottom right" />
<Inserter disabled={ mode !== 'visual' } position="bottom right" />

This comment has been minimized.

@tofumatt

tofumatt Sep 12, 2018

Member

These sorts of magic constants always irk me, even when they're strings. This is pretty obvious in its intent, but it's still possible to make typos, etc. 🤷‍♂️

Not really isolated to this PR though.

@tofumatt

tofumatt Sep 12, 2018

Member

These sorts of magic constants always irk me, even when they're strings. This is pretty obvious in its intent, but it's still possible to make typos, etc. 🤷‍♂️

Not really isolated to this PR though.

@jasmussen

This comment has been minimized.

Show comment
Hide comment
@jasmussen

jasmussen Sep 12, 2018

Contributor

Yep! Ship it. This works well.

Contributor

jasmussen commented Sep 12, 2018

Yep! Ship it. This works well.

@youknowriad

This comment has been minimized.

Show comment
Hide comment
@youknowriad

youknowriad Sep 12, 2018

Contributor

@tofumatt Test added if you want to take another look.

Contributor

youknowriad commented Sep 12, 2018

@tofumatt Test added if you want to take another look.

@tofumatt

Thanks for the test! ❤️

🚢

Show outdated Hide outdated test/e2e/specs/code-editor.test.js Outdated
Show outdated Hide outdated test/e2e/specs/code-editor.test.js Outdated

@youknowriad youknowriad merged commit 555f656 into master Sep 12, 2018

2 checks passed

codecov/project 48.96% (-0.01%) compared to 87a5e2d
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@youknowriad youknowriad deleted the update/tweaks-to-code-mode branch Sep 12, 2018

@mcsf

This comment has been minimized.

Show comment
Hide comment
@mcsf

mcsf Sep 12, 2018

Contributor

Yay, less is more! I'm glad we took this route to fix the parent issue.

Contributor

mcsf commented Sep 12, 2018

Yay, less is more! I'm glad we took this route to fix the parent issue.

@mtias mtias added this to the 3.9 milestone Sep 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment