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

Interface: move EditorSkeleton to interface package #21335

Merged
merged 2 commits into from
Apr 3, 2020

Conversation

vindl
Copy link
Member

@vindl vindl commented Apr 1, 2020

Description

Moves EditorSkeleton component from block-editor to interface package.

How has this been tested?

Smoke test the post, site, and widgets editor and verify that they still work as expected.

Types of changes

Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@github-actions
Copy link

github-actions bot commented Apr 1, 2020

Size Change: +3.95 kB (0%)

Total Size: 889 kB

Filename Size Change
build/annotations/index.js 3.4 kB -45 B (1%)
build/api-fetch/index.js 3.79 kB -2 B (0%)
build/autop/index.js 2.58 kB -2 B (0%)
build/block-editor/index.js 102 kB +110 B (0%)
build/block-editor/style-rtl.css 10.2 kB -360 B (3%)
build/block-editor/style.css 10.2 kB -361 B (3%)
build/block-library/index.js 110 kB +33 B (0%)
build/blocks/index.js 57.5 kB -32 B (0%)
build/components/index.js 195 kB -41 B (0%)
build/compose/index.js 6.21 kB -1 B
build/core-data/index.js 10.7 kB +1 B
build/data-controls/index.js 1.04 kB +4 B (0%)
build/data/index.js 8.23 kB -1 B
build/date/index.js 5.36 kB -1 B
build/edit-navigation/index.js 2.71 kB -2 B (0%)
build/edit-post/index.js 92.9 kB +400 B (0%)
build/edit-post/style-rtl.css 12.3 kB +225 B (1%)
build/edit-post/style.css 12.3 kB +222 B (1%)
build/edit-site/index.js 10.1 kB +339 B (3%)
build/edit-site/style-rtl.css 5.02 kB +343 B (6%) 🔍
build/edit-site/style.css 5.02 kB +343 B (6%) 🔍
build/edit-widgets/index.js 7.18 kB +2.74 kB (38%) 🚨
build/edit-widgets/style-rtl.css 3.74 kB -1 B
build/edit-widgets/style.css 3.73 kB -1 B
build/editor/index.js 42.8 kB +24 B (0%)
build/element/index.js 4.45 kB +1 B
build/format-library/index.js 6.95 kB -2 B (0%)
build/hooks/index.js 1.93 kB +1 B
build/media-utils/index.js 4.84 kB +1 B
build/notices/index.js 1.57 kB -1 B
build/nux/index.js 3.01 kB +2 B (0%)
build/plugins/index.js 2.54 kB +2 B (0%)
build/priority-queue/index.js 789 B +9 B (1%)
build/redux-routine/index.js 2.84 kB +1 B
build/server-side-render/index.js 2.54 kB +1 B
build/token-list/index.js 1.28 kB +1 B
build/url/index.js 4.01 kB -1 B
build/viewport/index.js 1.61 kB +2 B (0%)
build/warning/index.js 1.14 kB -1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.02 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/index.js 6.03 kB 0 B
build/block-directory/style-rtl.css 760 B 0 B
build/block-directory/style.css 760 B 0 B
build/block-library/editor-rtl.css 7.22 kB 0 B
build/block-library/editor.css 7.22 kB 0 B
build/block-library/style-rtl.css 7.53 kB 0 B
build/block-library/style.css 7.54 kB 0 B
build/block-library/theme-rtl.css 669 B 0 B
build/block-library/theme.css 671 B 0 B
build/block-serialization-default-parser/index.js 1.65 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/components/style-rtl.css 16.6 kB 0 B
build/components/style.css 16.5 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom-ready/index.js 569 B 0 B
build/dom/index.js 3.05 kB 0 B
build/edit-navigation/style-rtl.css 239 B 0 B
build/edit-navigation/style.css 241 B 0 B
build/editor/editor-styles-rtl.css 423 B 0 B
build/editor/editor-styles.css 426 B 0 B
build/editor/style-rtl.css 3.49 kB 0 B
build/editor/style.css 3.49 kB 0 B
build/escape-html/index.js 733 B 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.57 kB 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/keyboard-shortcuts/index.js 2.3 kB 0 B
build/keycodes/index.js 1.7 kB 0 B
build/list-reusable-blocks/index.js 2.99 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/primitives/index.js 1.5 kB 0 B
build/rich-text/index.js 14.5 kB 0 B
build/shortcode/index.js 1.69 kB 0 B
build/wordcount/index.js 1.17 kB 0 B

compressed-size-action

Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

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

This looks comprehensive, I gave the editors a smoke test and things still seem to be in good shape.

I'm really not sure what package this should live in, but interface seems reasonable.

What is the underlying reason for this migration? To move things usable by both block/site editors to a more neutral package?

@vindl
Copy link
Member Author

vindl commented Apr 2, 2020

I'm really not sure what package this should live in, but interface seems reasonable.
What is the underlying reason for this migration? To move things usable by both block/site editors to a more neutral package?

Yes, and we didn't have the adequate package for that before so block-editor was used temporarily. Also @youknowriad requested it here #20698 (comment).

@Addison-Stavlo
Copy link
Contributor

Addison-Stavlo commented Apr 2, 2020

Makes sense to me.

Do you think we need to note anything in the interface package Readme about these? They don't seem to have been listed in the block-editor one, but maybe it makes more sense as a more permanent home? (or maybe wait since they are both __experimental* ? )

(note for anyone else reading: by 'both' I am also referring to #21334)

@vindl
Copy link
Member Author

vindl commented Apr 2, 2020

(or maybe wait since they are both __experimental* ? )

This is likely going to be their permanent home so I'm not sure if they should still be prefixed as __experimental. I'll defer this to other reviewers. As for the readme - I'm not sure what to write, but happy to include something if you or other folks have ideas. :)

@chrisvanpatten
Copy link
Contributor

Might be worth changing the naming to be a bit more generic, so it’s not specifically named around “editor”? Also I think it might be expected that class names are updated to be prefixed with interface-?

@youknowriad
Copy link
Contributor

Might be worth changing the naming to be a bit more generic, so it’s not specifically named around “editor”?

I agree with this but when we do that, we should also make the "region labels" editable maybe using a "labels" prop or something like that.

@youknowriad
Copy link
Contributor

youknowriad commented Apr 2, 2020

I think (correct me if I'm wrong @jorgefilipecosta ) that the interface package is a "bundled" package that doesn't leak its API to Core. This means we can safely remove "__experimental" and we can still do breaking changes in the future if needed.

@vindl
Copy link
Member Author

vindl commented Apr 2, 2020

Might be worth changing the naming to be a bit more generic, so it’s not specifically named around “editor”?

I'm fine with that. @chrisvanpatten @youknowriad any suggestions for the alternative name?

@chrisvanpatten
Copy link
Contributor

@vindl InterfaceSkeleton? Or just Skeleton?

It's also probably worth coming up with an alternate name for the "publish" region. I'm not sure exactly what that corresponds to in the UI — would it be the publish panel in the normal editor? Perhaps something like "Skeleton Action" region or something? Obviously if the region names are configurable then the consuming package can choose an appropriate name.

@vindl vindl force-pushed the update/editor-skeleton-to-interface branch from adef3ed to 3b4dd23 Compare April 3, 2020 00:20
@vindl
Copy link
Member Author

vindl commented Apr 3, 2020

Renamed to InterfaceSkeleton in 3b4dd233518c7e1b40e1cb1dcb5196d1cee946cd

@vindl
Copy link
Member Author

vindl commented Apr 3, 2020

I'm not sure exactly what that corresponds to in the UI — would it be the publish panel in the normal editor? Perhaps something like "Skeleton Action" region or something?

Yes, it does. I renamed it to actions for now.

I agree with this but when we do that, we should also make the "region labels" editable maybe using a "labels" prop or something like that.

@youknowriad I added the option to pass the labels as props. I'm not sure if changing the region names themselves makes much sense given that their structure and nesting is hardcoded in the component.

sidebar: __( 'Editor settings' ),
actions: __( 'Editor publish' ),
footer: __( 'Editor footer' ),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we should drop the "Editor" from the default labels?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also feel it works better for most UIs without "Editor" (like widgets)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that sounds fine to me. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated in 2e1d036ae02a7f5eceed238059815bb05e750284.

Copy link
Contributor

Choose a reason for hiding this comment

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

So this changes the labels for the widgets and more importantly the "Post editor". For me it's still good names and I like the fact that they are the same across pages. Let's keep them consistent for now and if we have feedback suggesting to go specific for some of these screens, we'll adapt.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we should drop the "Editor" from the default labels?

When used to label the ARIA landmark regions in the context of the WP admin, these labels need to differentiate the Editor landmarks from the other landmarks in the WP UI. This is the reason why they used the word "Editor" at the beginning. For some history, see #7940, #7938, and #2380

Also, the ARIA landmarks labels need to describe the purpose of the content within the region. Labels like "Header", "Footer", and "Left Sidebar" (added in #20951) are arguably og any usefulness for assistive technology users.

If these labels are going to be used also for other purposes, then we'll need to provide specific labels for the ARIA landmarks.

Worth also noting the ARIA regions labels usage is still documented in the regions Readme:

For better accessibility, these elements must be properly labelled to briefly describe the purpose of the content in the region. For more details, see "ARIA landmarks" in the WAI-ARIA specification.

Will create a new issue.

@vindl vindl force-pushed the update/editor-skeleton-to-interface branch from 2e1d036 to 9f64def Compare April 3, 2020 11:17
@@ -61,6 +61,14 @@ function Editor( { settings: _settings } ) {
};
}, [] );

const skeletonLabels = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we really need these now, as the default ones apply generically :)

Copy link
Member Author

@vindl vindl Apr 3, 2020

Choose a reason for hiding this comment

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

Pretty easy to change them later on if needed. I'm going to merge this to avoid more of the rebase hell. 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually scratch that, I updated this in 68c5e26 after reading your comment here.

@vindl vindl merged commit 2e8dc51 into master Apr 3, 2020
@vindl vindl deleted the update/editor-skeleton-to-interface branch April 3, 2020 18:55
@github-actions github-actions bot added this to the Gutenberg 7.9 milestone Apr 3, 2020
@jorgefilipecosta
Copy link
Member

I think (correct me if I'm wrong @jorgefilipecosta ) that the interface package is a "bundled" package that doesn't leak its API to Core.

That is correct :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants