-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove horizontal and vertical navigation block variations from inserter #34614
Conversation
Size Change: +1.48 kB (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
This is a neat one. The duplicate blocks in the inserter has always felt like a temporary solution to the transformations between orientations being an insufficiently obvious interface. That might still be the case — transforming between those orientations isn't that obvious. On the other hand, this behavior is already the case for the Buttons block: I think the concern about the discoverability of the vertical variant is real, but also that the solution is to improve the interface. Serendipitously, #34535 explores a horizontal version of the Group block, so it has the opposite problem. Like the two nav block variations, the Row block is also just a variant of the Group block. One topic of discussion there is whether we can find an interface that lets you switch orientations, a la how Figma does it (GIF in this comment #34535 (comment)). Such a directional toggle might ultimately benefit both Group, Buttons, Navigation and Social Links. Thoughts? |
Row is interesting. I think it has a strong purpose as a layout block and it feels significantly semantically different to 'group'. Whereas the horizontal/vertical aspects of navigation are implicit to the block and feel more like block settings that are being exposed in the wrong way. I could definitely see the nav block having something like variations in the future, but I think they might have more meaning, like 'Accordion Menu' or 'Sidebar Menu'. Though these could also be patterns/styles 🤷 |
@talldan, the e2e snapshots might need an update. |
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.
This looks good, thanks! 👍
I was wondering though if it makes more sense to remove the default variation flag (isDefault
) and having horizontal
as a default value for the block for orientation
attribute. We would also remove this check: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/navigation/edit.js#L154
Thanks for your help, @ntsekouras. I took your advice and changed the default. There don't seem to be any objections for this change, so I'll go ahead and merge it. But do continue to provide feedback and this can be assessed. |
* trunk: (214 commits) Fix snackbar overflow on nav editor (#34661) Mobile - Allow disabling text and background color via theme.json (#34633) Fix disabled blocks logical error on Widgets screen (#34634) [Mobile] - Global styles - Add support to render font sizes and line height (#34144) ESLint Plugin: Update eslint jsdoc dependency (#34338) Scripts: Add CHANGELOG entry for `jest-dev-server` upgrade (#34657) Bump jest-dev-server to v5 (#34560) Refactor the `core-data` store to thunks (#28389) Only capture toolbars on parent Nav block when not in vertical mode (#34615) Update Changelog for 11.5.0-rc.1 Bump plugin version to 11.5.0-rc.1 Gallery block: Fix media placeholder height in site editor (#34629) Border Controls: Display color indicator and check selected color (#34467) Remove horizontal and vertical navigation block variations from inserter (#34614) AlignmentMatrixControl : Fix/update docs (#34624) Gap block support: force gap change to cause the block to re-render (fix Safari issue) (#34567) [Block Library - Social Links]: Use the new `flex` layout (#34493) [Mobile] Update the bottom sheet header (#34309) Group block: Add a row variation (#34535) Migrate entities.js to thunks (#34582) ...
Description
This is a tiny PR to propose changing something that doesn't feel like a successful experiment:
The horizontal/vertical variants being exposed in the inserter feels messy to me and makes the block library unnecessarily busy. This PR reduces the options to just the block itself (defaulting to horizontal):
The option to switch orientation is still available in the sidebar:
That piece of UI could be improved, but I think that's a separate change. There's probably also an opportunity to use patterns when setting up the block to dictate orientation, but for now I think it's fine to default to horizontal as the only inserter option.
How has this been tested?
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).