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

Fix: Consistent UI #23202

Merged
merged 13 commits into from
Jun 22, 2020
Merged

Fix: Consistent UI #23202

merged 13 commits into from
Jun 22, 2020

Conversation

jasmussen
Copy link
Contributor

This PR does a number of things in the name of addressing or almost addressing the remaining items in #18667. In additionally, it fixes all items from #19904. Here's what it does:

It makes the buttongroup consistent with regards to toggles:

Screenshot 2020-06-16 at 13 18 45

Screenshot 2020-06-16 at 13 19 51

Note to third parties, the inactive buttons aren't secondary, they're just buttons.

It makes the sidebar tabs consistent with the inserter:

Screenshot 2020-06-16 at 13 19 55

You'll also note in that one, that the text color is now uniformly the same dark gray everywhere in the UI.

It makes all panels the same height, previously some panels were 50px tall, others 48, some arbitrary multiples. It also removes a $panel-padding variable, so as to encourage the grid system instead:

Screenshot 2020-06-16 at 11 43 54

It adds a new small close icon, and uses it for both sidebar and prepublish panels. It also vertically aligns it to the chevrons:

Screenshot 2020-06-16 at 13 24 38

Screenshot 2020-06-16 at 13 24 44

It removes the I/O icons from the form toggle, because they added complexity that wasn't helping convey the active/inactive state:

Screenshot 2020-06-16 at 13 25 37

It fixes so this chevron isn't scaled down:

Screenshot 2020-06-16 at 13 26 30

I would like to do much more to improve things, including do an audit of button style usage in the sidebar — small, secondary, tertiary, labels, etc. — for all blocks, including doing some positioning improvements. But instead of creating one mega PR, I'm breaking it up.

Would appreciate your thoughts.

@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Type] Code Quality Issues or PRs that relate to code quality labels Jun 16, 2020
@jasmussen jasmussen self-assigned this Jun 16, 2020
@github-actions
Copy link

github-actions bot commented Jun 16, 2020

Size Change: -195 B (0%)

Total Size: 1.12 MB

Filename Size Change
build/annotations/index.js 3.62 kB -2 B (0%)
build/api-fetch/index.js 3.4 kB -1 B
build/autop/index.js 2.82 kB -2 B (0%)
build/block-directory/index.js 7.26 kB -4 B (0%)
build/block-editor/index.js 107 kB -13 B (0%)
build/block-library/index.js 129 kB +3 B (0%)
build/blocks/index.js 48.1 kB +1 B
build/components/index.js 195 kB -140 B (0%)
build/components/style-rtl.css 15.8 kB -99 B (0%)
build/components/style.css 15.7 kB -99 B (0%)
build/core-data/index.js 11.4 kB -1 B
build/data/index.js 8.44 kB -2 B (0%)
build/date/index.js 5.47 kB -2 B (0%)
build/dom-ready/index.js 569 B +1 B
build/edit-navigation/index.js 8.26 kB -1 B
build/edit-post/index.js 303 kB +44 B (0%)
build/edit-post/style.css 5.5 kB -5 B (0%)
build/edit-site/index.js 16.7 kB +53 B (0%)
build/edit-site/style-rtl.css 3.02 kB -4 B (0%)
build/edit-site/style.css 3.02 kB -5 B (0%)
build/edit-widgets/index.js 9.33 kB -5 B (0%)
build/edit-widgets/style-rtl.css 2.42 kB -10 B (0%)
build/edit-widgets/style.css 2.42 kB -11 B (0%)
build/editor/index.js 44.8 kB +105 B (0%)
build/editor/style-rtl.css 3.81 kB +2 B (0%)
build/editor/style.css 3.81 kB +2 B (0%)
build/format-library/index.js 7.72 kB +1 B
build/i18n/index.js 3.56 kB +1 B
build/keyboard-shortcuts/index.js 2.51 kB -1 B
build/list-reusable-blocks/index.js 3.13 kB -1 B
build/media-utils/index.js 5.3 kB +1 B
build/plugins/index.js 2.56 kB -1 B
build/rich-text/index.js 14 kB +2 B (0%)
build/server-side-render/index.js 2.68 kB -1 B
build/viewport/index.js 1.85 kB -1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/style-rtl.css 937 B 0 B
build/block-directory/style.css 937 B 0 B
build/block-editor/style-rtl.css 10.7 kB 0 B
build/block-editor/style.css 10.7 kB 0 B
build/block-library/editor-rtl.css 7.59 kB 0 B
build/block-library/editor.css 7.59 kB 0 B
build/block-library/style-rtl.css 8.02 kB 0 B
build/block-library/style.css 8.02 kB 0 B
build/block-library/theme-rtl.css 730 B 0 B
build/block-library/theme.css 732 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/compose/index.js 9.6 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom/index.js 3.17 kB 0 B
build/edit-navigation/style-rtl.css 1.02 kB 0 B
build/edit-navigation/style.css 1.02 kB 0 B
build/edit-post/style-rtl.css 5.5 kB 0 B
build/editor/editor-styles-rtl.css 468 B 0 B
build/editor/editor-styles.css 469 B 0 B
build/element/index.js 4.65 kB 0 B
build/escape-html/index.js 733 B 0 B
build/format-library/style-rtl.css 547 B 0 B
build/format-library/style.css 548 B 0 B
build/hooks/index.js 2.13 kB 0 B
build/html-entities/index.js 622 B 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/style-rtl.css 450 B 0 B
build/list-reusable-blocks/style.css 451 B 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 663 B 0 B
build/nux/style.css 660 B 0 B
build/primitives/index.js 1.5 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.85 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.28 kB 0 B
build/url/index.js 4.06 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.17 kB 0 B

compressed-size-action

font-weight: 400;
color: $dark-gray-900;
font-weight: 500;
color: $dark-gray-primary;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we remove the color and rely on the inheritance instead or is this really needed?

position: relative;
z-index: z-index(".edit-post-sidebar__panel-tab.is-active");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a z-index?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2020-06-16 at 15 09 34

It makes the tab border more visible

@@ -17,7 +17,7 @@ import {
} from '@wordpress/components';
import { withSelect, withDispatch } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { close } from '@wordpress/icons';
import { closeSmall } from '@wordpress/icons';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we replace all close icons or do you think there's a need for a small and a big one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's a use case for both, honestly, it's okay they're big in the modal dialogs, but in the sidebar contexts they should not be quite as notable.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

While I didn't test deeply, by looking at the code, the changes seem safe for me.

@youknowriad
Copy link
Contributor

youknowriad commented Jun 16, 2020

Also, let's try to not add new changes and use separate PRs to make things easy to test. Ideally, each change happens in its own PR.

@youknowriad
Copy link
Contributor

in my testing, the toggle with I/O feels a bit too wide (especially when it's unchecked), do you think we can reduce its width?

@youknowriad
Copy link
Contributor

Its border width also feels inconsistent with the inputs... a 1px border might look better IMO.

@youknowriad
Copy link
Contributor

1px border might look better IMO.

This is also the same for checkbox so we might want to do it separately if ever.

@jasmussen
Copy link
Contributor Author

I updated the margin to match that of the checkbox.

Its border width also feels inconsistent with the inputs... a 1px border might look better IMO.

I think I agree, but I'd like to polish both the toggle and checkbox and radio separately, they're all 2px now.

@youknowriad
Copy link
Contributor

youknowriad commented Jun 16, 2020

I updated the margin to match that of the checkbox.

I actually was thinking about the toggle width itself :)

Regardless this PR looks good.

@jasmussen
Copy link
Contributor Author

I actually was thinking about the toggle width itself :)

Ah. Yep, I've seen a G2 design that I want to look at. Thanks.

@jasmussen jasmussen force-pushed the fix/consistent-ui branch 7 times, most recently from 7c7cf7a to 504af49 Compare June 18, 2020 17:01
@gziolo
Copy link
Member

gziolo commented Jun 19, 2020

I see failing e2e tests that block this PR. It’s a recurring issue that visual changes break them. We need to rethink approach how user interactions are coded, my guess is that tests fail when mouse cursor is moved. @youknowriad, could we limit mouse interactions in e2e tests to absolute minimum and use keyboard interactions instead?

@jasmussen
Copy link
Contributor Author

Thanks so much for looking, Gzregorz. I'm banging my head against the tests on this one, I'd love to learn how to fix them, I've definitely fixed a few in the past. But these confuse me to no end. It's the same, frankly, with #22213, which is a great code quality improvement that would be nice to land also.

@jasmussen
Copy link
Contributor Author

Tests are passing! Turns out there are two ways to update snapshots and I was only familiar with the one: npm run test-unit -- --updateSnapshot. This one needed running: npm run test-e2e -- -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Code Quality Issues or PRs that relate to code quality [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants