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

Blocks settings unavailable within the Unsupported Block Editor #48298

Closed
dcalhoun opened this issue Feb 22, 2023 · 7 comments · Fixed by #48435
Closed

Blocks settings unavailable within the Unsupported Block Editor #48298

dcalhoun opened this issue Feb 22, 2023 · 7 comments · Fixed by #48435
Assignees
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release

Comments

@dcalhoun
Copy link
Member

Description

When editing a block with the mobile app's Unsupported Block Editor (UBE), the "Show more settings" option is not available.

The source of this issue is likely similar to #33592 and related to the inherent brittleness of the foundational implementation referenced in #21874. There may have been a change the web editor's DOM hierarchy/class names or a browser-specific issue introduced.

Step-by-step reproduction instructions

  1. Create a post in the web editor and add a block that is not supported by the mobile app, e.g. Archives.
  2. Open the same post with the mobile app.
  3. Select the block.
  4. Tap the ? button.
  5. Tap "Edit using web editor."
  6. Tap the three-dot menu in the block toolbar.

Expected behaviour

The "Show more settings" option is available.

Actual behaviour

The "Copy block" option is available.

Screenshots or screen recording (optional)

Screenshot

ube-block-settings-missing

WordPress information

  • WordPress version: 6.1
  • Gutenberg version: 15.1.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes

Device information

  • Device: iPhone SE
  • Operating system: iOS 16.3
  • WordPress app version: 21.8.0.0
@dcalhoun dcalhoun added [Type] Regression Related to a regression in the latest release Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Feb 22, 2023
@geriux
Copy link
Member

geriux commented Feb 22, 2023

This is a tricky one because it looks like the "Show more options" that was supposed to show as the first item after tapping the three-dots button is no longer there:

Screenshot 2023-02-22 at 12 52 29

The option to open the block options is now in the header navigation which we don't display within the UBE:

Screenshot 2023-02-22 at 12 51 03

Tapping that button opens a sidebar:

Screenshot 2023-02-22 at 12 51 18

I'm now sure how to workaround that 🤔

@dcalhoun
Copy link
Member Author

I'm now sure how to workaround that 🤔

My initial reaction without looking at the code is that we would need to use JavaScript to manually construct and inject a "Show more settings" button where we need it inside of packages/react-native-bridge/common/gutenberg-web-single-block/editor-behavior-overrides.js — a file we solely control. That feels very bad and brittle, but one might argue it is less brittle than previous approach of relying upon the existence of the button being there — which this very issue demonstrates the risk of that approach.

@dcalhoun
Copy link
Member Author

From my research, it appears the "Show more settings" button was removed in #46709.

@dcalhoun
Copy link
Member Author

dcalhoun commented Feb 22, 2023

The option to open the block options is now in the header navigation which we don't display within the UBE:

I am wondering if merely displaying the edit post header is the simplest and most stable approach to resolving this. I.e. remove the following lines that currently hide the edit post header.

/*
Hiddes the top bar header by setting its height to 0
We can\'t remove it since the block toolbar is a child of it.
*/
.edit-post-header {
height: 0px;
padding: 0px;
overflow: hidden;
}
/* Move the block toolbar to the top */
.edit-post-header-toolbar__block-toolbar {
top: 0px;
}
.interface-interface-skeleton {
top: 0px;
}
/*
Moves the whole editor to the top.
There was an extra top margin after removing the WP Admin bar.
*/
.block-editor-editor-skeleton {
top: 0px;
}

Yes, it occupies more vertical space — possibly an annoying amount of space on small displays — but it would further align the UBE with the default web editor and likely make the UBE less brittle. We would likely need to hide individual menu items, e.g. navigating away from the post editor.

@geriux
Copy link
Member

geriux commented Feb 23, 2023

I am wondering if merely displaying the edit post header is the simplest and most stable approach to resolving this. I.e. remove the following lines that currently hide the edit post header.

I think we should explore that and like you said just hide the options we don't need there, it is true about the vertical space but nowadays mobile phones are quite big so it might not be an issue, especially if you're just editing one block.

@dcalhoun dcalhoun added the [Priority] High Used to indicate top priority items that need quick attention label Feb 23, 2023
@dcalhoun dcalhoun self-assigned this Feb 23, 2023
@dcalhoun
Copy link
Member Author

dcalhoun commented Feb 24, 2023

I explored the idea of displaying the Edit Post Header. Unfortunately, it does expose the ability to perform actions outside of the scope of modifying a single block and potential confusion for users.

Specifically, it is very easy to access Post Settings in the sidebar, rather than just Block Settings. When a block is not selected, tapping the Sidebar toggle button opens the Post Settings, which is confusing and undesired for the scope of the UBE.

I am now exploring displaying the Sidebar toggle button only when a block is selected to avoid this.

Visible Edit Post Header Post Settings Block Settings
edit post header visible sidebar block settings sidebar post settings

@geriux
Copy link
Member

geriux commented Feb 24, 2023

I am now exploring displaying the Sidebar toggle button only when a block is selected to avoid this.

That looks like the best approach 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Priority] High Used to indicate top priority items that need quick attention [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants