Skip to content
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

Do not show the block settings menu if selected block is invalid #12209

Closed
wants to merge 2 commits into from

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Nov 22, 2018

Alternative to #12052
Fixes #12002

Please, consider this PR together with #12052 We only want to merge one of them.

The blockSelection mechanism doesn't get updated with the UNDO/REDO actions. I haven't found an easy approach to solve the root problem, so I originally proposed we merged #12052 that hides the plugin slot in the BlockSettingsMenu so the editor doesn't break.

This PR is more holistic in that in hides the whole BlockSettingsMenu instead of only the plugin slot.

@oandregal oandregal self-assigned this Nov 22, 2018
@oandregal oandregal added the [Type] Bug An existing feature does not function as intended label Nov 22, 2018
@oandregal oandregal requested a review from a team November 22, 2018 10:01
@oandregal oandregal added this to the 4.6 milestone Nov 22, 2018
</Fragment>
) }
<BlockSettingsMenu clientIds={ blockClientIds } />
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why it wasn't considered before to hide this if the block is invalid, so I'd want some perspective on the potential implications of this.

Copy link
Member Author

@oandregal oandregal Nov 22, 2018

Choose a reason for hiding this comment

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

I've learned why this is a bad idea. This is what would happen:

peek 2018-11-22 11-19

@gziolo gziolo requested a review from jasmussen November 22, 2018 10:27
@gziolo
Copy link
Member

gziolo commented Nov 22, 2018

@jasmussen - I'm wondering if this 3 dots menu makes sense when in the text mode. If we would update UI to show only the exit button, we wouldn't have to worry about many things which might not make sense in this mode. Similar issues may apply when you make your HTML invalid and duplicate it, etc.

A similar question applies to the case when a block is invalid and we show alternative UI. Should we still show the menu in the unified toolbar? Or maybe we should move action controls from the block to the unified toolbar for consistency?

I don't know answers but wanted to share some questions that this screencast raises :)

@jasmussen
Copy link
Contributor

To this PR specifically, I think it's important we don't hide the ellipsis menu just because the block is invalid. You want to be able to delete it. You want to be able to insert before or after. You want to be able to release a reusable invalid block, perhaps.

I'm wondering if this 3 dots menu makes sense when in the text mode. If we would update UI to show only the exit button, we wouldn't have to worry about many things which might not make sense in this mode. Similar issues may apply when you make your HTML invalid and duplicate it, etc.

Just to be sure I'm understanding you, you're referring to the More menu in the top right corner of the screen, correct?

If yes, I don't think this is a good idea. I understand that there are a number of menu options that don't make sense in that mode — I would rather we remove those items, or disable them. Or even look at alternatives, like making the HTML editor a modal, but I suspect that won't be popular as many use the text editor exclusively.

@oandregal
Copy link
Member Author

I agree with Joen, this PR isn't a good idea. I was just exploring out of frustration with this bug.

Prepared a different alternative at #12214 that solves the problem for every client that uses the getSelectedBlockClientId API, not only for the block settings menu.

@jasmussen
Copy link
Contributor

It's a good PR! It's important to explore all avenues, and even if we decide it's not a good idea, that just means we cauterized an avenue and are smarter for it.

@oandregal
Copy link
Member Author

Agreed! I meant I changed my mind (or rather, decided this wasn't a good avenue to walk after all) after learning how the isValid interacts with the block settings menu.

@gziolo
Copy link
Member

gziolo commented Nov 22, 2018

Prepared a different alternative at #12214 that solves the problem for every client that uses the getSelectedBlockClientId API, not only for the block settings menu.

Yes, this one looks promising 👍

@gziolo gziolo closed this Nov 22, 2018
@gziolo gziolo deleted the fix/block-settings-menu branch November 22, 2018 10:55
@gziolo gziolo removed this from the 4.6 milestone Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants