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

Add new TreeGrid and RovingTabIndex components #19799

Closed
wants to merge 43 commits into from

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Jan 22, 2020

Description

Extracted from PR #18014

This PR adds new components to the block-editor package for implementing a tree grid as described at WAI ARIA authoring practices - Tree Grid.

I've created this as a separate PR as I think the implementation should get some scrutiny.

The new components:

  • TreeGrid, TreeGridRow, TreeGridCell - implements keyboard navigation as described in the above link. up/down arrow keys navigate between grid rows, left/right arrows navigate between focusable elements in a row.
  • RovingTabIndex a component that wraps a UI control that requires a roving tab index. This component keeps track of the last focused element in the structure it wraps.
  • RovingTabIndexItem a component that wraps an individual element/component that is focusable and requires a roving tab index. This component sets the correct tabIndex on the element/component.

How has this been tested?

Testing can be carried out on PR #18014. Testing instructions:

  1. Add a Navigation Block
  2. Add some Navigation Links to the Navigation Block
  3. Access the Block Navigator from the Navigation Block's toolbar
  4. Tab into the navigation list
  5. Tab again—observe the list only has a single tab stop
  6. Shift tab back into the list
  7. Use arrow keys to navigate rows and buttons within the rows
  8. Shift tab out of the list
  9. Tab back into the list—observe the last focused element in the list receives focus again.

Types of changes

New feature (non-breaking change which adds functionality)

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. .

@talldan talldan added [Type] Enhancement A suggestion for improvement. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Jan 22, 2020
@talldan talldan self-assigned this Jan 22, 2020
@talldan talldan changed the title Add new treegrid accessibility components Add new treegrid components Jan 23, 2020
Copy link
Member

@diegohaz diegohaz left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, @talldan!

I tested the Block Navigator modal with VoiceOver + Safari. It works well! It announces that I am in a table (which is probably an effect of role="treegrid"), and I can navigate through the items using arrow keys (or VO + arrow keys). One thing I missed though was knowing my current position in the table, which is something you get for free when using native table elements. I guess this can be achieved by using attributes like aria-setsize and aria-posinset.

Regarding the API, when I read NavigableTreeGrid, I expect that it will render a role="treegrid" element that already manages focus for me, including the roving tabindex method, as the WAI-ARIA practices recommend. It also sounds a bit redundant since a TreeGrid should be navigable already.

I would expect the usage to be something like this:

<TreeGrid>
  <TreeGridRow expanded>
    <TreeGridCell>...</TreeGridCell>
    <TreeGridCell>...</TreeGridCell>
    <TreeGridCell>...</TreeGridCell>
  </TreeGridRow>
  <TreeGridRow level={2}>
    <TreeGridCell>...</TreeGridCell>
    <TreeGridCell>...</TreeGridCell>
    <TreeGridCell>...</TreeGridCell>
  </TreeGridRow>
</TreeGrid>

That would render a markup like this:

<table role="treegrid">
  <tbody>
    <tr role="row" aria-level="1" aria-posinset="1" aria-setsize="1" aria-expanded="true" tabindex="0">
      <td role="gridcell">...</td>
      <td role="gridcell">...</td>
      <td role="gridcell">...</td>
    </tr>
    <tr role="row" aria-level="2" aria-posinset="1" aria-setsize="1" tabindex="-1">
      <td role="gridcell">...</td>
      <td role="gridcell">...</td>
      <td role="gridcell">...</td>
    </tr>
  </tbody>
</table>

(Even though this example uses native table elements, we still need those aria-posinset and aria-setsize attributes to represent the hierarchy in the table. Otherwise, in this example, browsers would guess aria-setsize="2" by default since it has two rows)

This kind of component would require much more effort! As a low hanging fruit, I would try to merge both NavigableTreeGrid and RovingTabIndex into a sort of bidimensional NavigableContainer. I would try to avoid the name TreeGrid as this could be misleading.

<NavigableContainer2D>
  <div role="treegrid">
    ...
  </div>
</NavigableContainer2D>

This would require replacing the role="treeitem" selectors in the NavigableTreeGrid code by something more generic (e.g. a NavigableRow2D component that could be translated into role="treeitem" by the component consumer).

EDIT: Looks like aria-posinset and aria-setsize aren't allowed on role="row". See #19799 (comment)

@diegohaz
Copy link
Member

Also, this is a good candidate to be tested with this @wordpress/test-utils PR.

@talldan
Copy link
Contributor Author

talldan commented Jan 29, 2020

Thanks for the feedback @diegohaz. Hmm, at the moment it looks like my implementation is closer to a Treeview in the examples, I should look at changing the markup to a table. Not sure how I missed that.

Your idea of making the RovingTabIndex behaviour implicit is good as well, I think I'll do that. Cheers for the pointers!

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Great work exploring this pattern. Props to @tellthemachines for raising it in the first place. I'll defer the testing part to @diegohaz who is an expert in the field and has the most experience developing similar features. 😄

I wanted to discuss some other aspects and find out what are your thoughts on the following:

This PR adds new components to the block-editor package for implementing a tree grid ,as described at WAI ARIA authoring practices - Tree Grid.

As noted in other comments, similar components exist in @wordpress/components package. Why do you think it would fit better to the @wordpress/block-editor? For me, it doesn't seem it solves anything specific to the block editor.

I shared 2 components that use different mechanisms for the roving pattern. We discussed it with @diegohaz when he worked on the accessible version of Toolbar components. We agreed that eventually, Reakit's Rover should be the only way supported. This PR introduces yet another way because existing solutions seem to be not flexible enough. Do you have any thoughts if this could be consolidated someday? Does it even make sense in the first place?

Those are open questions, and I'm totally fine with landing this PR in the current shape, even if we have a different vision for the future based on the discussion. I wanted to ensure we have a good plan how to coordinate all the accessibility efforts.

Finally, I think the most important part is that we have those components covered with tests. It echos what @diegohaz shared about unit tests. If there are good reasons to move those components to @wordpress/components we should add Storybook stories to make it easier to test them in isolation.

- [Editor Menu Bar](https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-2/menubar-2.html)
- [Navigation Menu Bar](https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html)
- [Radio Group](https://www.w3.org/TR/wai-aria-practices/examples/radio/radio-1/radio-1.html)
- [Toolbar](https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html)
Copy link
Member

Choose a reason for hiding this comment

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

Noting that for the fully accessible version of Toolbar in @wordpress/components we use Rover from Reakit.

Based on the Reakit's documentation only, I don't think it supports grids though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that in an open PR? I couldn't find it in the codebase.

As you say it doesn't seem to support grids. The RovingTabIndex components in this PR only handle focus management, and they're intended to be composed with a separate component for keyboard navigation, so that's the main difference.

Copy link
Member

Choose a reason for hiding this comment

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

It's part of the codebase. It still isn't integrated with the block editor because of the required refactor to the SlotFill implementation.

You can test it in Storybook:
https://wordpress.github.io/gutenberg/?path=/story/components-toolbar--default

Some patterns that implement a roving tab index are:

- [Layout Grid](https://www.w3.org/TR/wai-aria-practices/examples/grid/LayoutGrids.html)
- [Editor Menu Bar](https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-2/menubar-2.html)
Copy link
Member

Choose a reason for hiding this comment

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

Noting that for the dropdown menus we use NavigableMenu from @wordpress/components which is based on more general NavigableContainer that also implements roving but limited to horizontal or vertical orientation.

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 couldn't see that they do implement the roving tab index in the traditional sense. For example, in the editor more menu it's still possible to tab through the individual menu items. If it were a roving tab index the entire menu would only a single tab stop.

It should be possible to use this component to make it behave with a roving tab index, though. If we wanted to 😄.

Copy link
Member

Choose a reason for hiding this comment

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

The current tabbing behavior for the dropdown menu is broken, similarly to the legacy version of toolbars :)

It should be all refactored to use roving. This is why I raised it and marked as something to coordinate for the future so we don't maintain 3 different ways to deal with roving.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we'd want to have roving behaviour on the more menu. It's a one dimensional dropdown that has to be clicked on to open, so I would expect to be able to tab through it.

Copy link
Member

Choose a reason for hiding this comment

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

@tellthemachines, to be clear. The more menu supports both arrows down/up and tabbing for navigation between menu items as of today. You can also use the arrow down key to open this dropdown.

@talldan
Copy link
Contributor Author

talldan commented Jan 31, 2020

Hey @diegohaz, I've changed the implementation now so it aligns more with your suggestion.

I've also updated #18014 so that it uses the new components. It works for testing this PR, though I still need to update the styles of the block navigator now that it's marked up using a <table>.

packages/block-editor/src/components/tree-grid/README.md Outdated Show resolved Hide resolved

### `isExpanded: boolean`

An optional value that designates whether a row is expanded or collapsed. Currently this value only sets the correct aria-expanded property on a row, it has no other built-in behaviour.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should just use the aria- equivalents of these props rather than aliasing them?

Copy link
Member

Choose a reason for hiding this comment

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

Having those custom props may be useful for supporting React Native as well in the future.

packages/block-editor/src/components/tree-grid/README.md Outdated Show resolved Hide resolved
packages/block-editor/src/components/tree-grid/index.js Outdated Show resolved Hide resolved
@talldan
Copy link
Contributor Author

talldan commented Jan 31, 2020

As noted in other comments, similar components exist in @wordpress/components package. Why do you think it would fit better to the @wordpress/block-editor? For me, it doesn't seem it solves anything specific to the block editor.

@gziolo Yep, that's true. I wasn't sure what the best place for them would be and wasn't sure if /components would just be for visual components.

I'll work on moving them to /components and add some stories.

I'll also look into the testing and give @diegohaz's PR a review, that will probably have to be on Monday, though.

@gziolo
Copy link
Member

gziolo commented Jan 31, 2020

@gziolo Yep, that's true. I wasn't sure what the best place for them would be and wasn't sure if /components would just be for visual components.

I'll work on moving them to /components and add some stories.

@youknowriad introduced a new package by extracting components from @wordpress/components@wordpress/primitives a few days ago for cross-platform components. If you feel like it doesn't belong to @wordpress/components we can discuss alternatives. I don't think we have any guidelines but I see 3 places where it could live:

  • @wordpress/compose
  • @wordpress/components
  • @wordpress/primitives

@youknowriad, can you help to pick home for new components? :)

@talldan talldan changed the title Add new treegrid components Add new TreeGrid and RovingTabIndex components Feb 3, 2020
@talldan talldan force-pushed the try/grid-accessibility-components branch from 81e31fb to c8b8ac0 Compare February 3, 2020 09:38
@diegohaz
Copy link
Member

diegohaz commented Feb 3, 2020

Haven't tested it yet, but after a quick look at the changes the code looks great. Amazing work, @talldan! Things I would add for now:

  • There are places in the docs where <Component>( props ) => ...</Component> should be replaced by <Component>{ ( props ) => ... }</Component>.
  • Storybook and tests
  • I would consider making the new components __experimental in this first iteration so we can change them without incurring in breaking changes until a few of our internal modules is using them consistently.

@talldan talldan force-pushed the try/grid-accessibility-components branch from 7c721a2 to d11e683 Compare February 12, 2020 07:10
@talldan
Copy link
Contributor Author

talldan commented Feb 12, 2020

This should be ready for review. I've added storybook stories and tests (though unfortunately the react-test-renderer tests can't cover much of the functionality).

@tellthemachines
Copy link
Contributor

I tested the components on Storybook with VoiceOver + Safari. RovingTabindex seems fine, but TreeGrid has a few issues:

  • on tabbing in, VoiceOver announces a table with 3 columns and 7 rows, but when navigating around with arrows there is no indication of hierarchy or relationship.
  • the button labels are not always fully read out. So when moving into one of the inset named labels, it often announces "new line" instead of the name. Also moving between the voting buttons, sometimes only "up" or "down" is announced, instead of "vote up" or "vote down", and I can see VoiceOver's focus ring is around the single word, instead of around the whole button.
  • There is an accessibility error shown in the Storybook console: ARIA attributes are not allowed: aria-posinset="1" aria-setsize="2". The spec says posinset should be used with roles listitem or option, so that's probably the issue. As per the spec, we shouldn't need these aria attributes anyway, because all the elements in the list are already present in the DOM.

@diegohaz
Copy link
Member

diegohaz commented Feb 20, 2020

@tellthemachines Good catch! The WAI-ARIA docs may be misleading. They use aria-posinset and aria-setsize on the treegrid examples (https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html):

Image showing a treegrid widget using aria-posinset and aria-setsize on its rows

Looks like the alternative for grids are aria-rowindex and aria-rowcount?

@talldan
Copy link
Contributor Author

talldan commented Feb 20, 2020

My understanding is that aria-posinset and aria-setsize are correct, but they were accidentally missed from the spec in v1.1, and that's being fixed in 1.2:

That they don't seem to be read by voiceover is weird, but the same happens in the examples. I suppose voiceover doesn't support those attributes.

@tellthemachines
Copy link
Contributor

The WAI-ARIA docs may be misleading. They use aria-posinset and aria-setsize on the treegrid examples

@diegohaz I was just noticing that 😅 though VoiceOver works pretty well on that example, so maybe it's not the cause of the bugs I described above.

I also notice that in the WAI-ARIA example, when navigating with Ctrl+Opt+Arrow keys VoiceOver reads out the position when changing rows or columns (e.g. "column 3 of 3", or "row 1 of 3") for all the cells except the ones that only have links in them. So now I'm wondering if what causes the buggy behaviour in Storybook is the fact that all the cells contain buttons. If so, this is likely a VoiceOver bug. I've tried searching the internets but it's really hard to find info on VO bugs 😩

@talldan talldan force-pushed the try/grid-accessibility-components branch from d11e683 to 21a3487 Compare May 5, 2020 03:07
@github-actions
Copy link

github-actions bot commented May 5, 2020

Size Change: +725 B (0%)

Total Size: 822 kB

Filename Size Change
build/annotations/index.js 3.62 kB +1 B
build/api-fetch/index.js 4.08 kB +2 B (0%)
build/block-directory/index.js 6.6 kB -1 B
build/block-editor/index.js 101 kB +9 B (0%)
build/block-library/index.js 115 kB -3 B (0%)
build/blocks/index.js 48.1 kB +2 B (0%)
build/components/index.js 180 kB +728 B (0%)
build/compose/index.js 6.66 kB -1 B
build/data/index.js 8.44 kB -1 B
build/deprecated/index.js 771 B -1 B
build/edit-post/index.js 28.1 kB -5 B (0%)
build/edit-site/index.js 12.3 kB -1 B
build/edit-widgets/index.js 8.33 kB -3 B (0%)
build/element/index.js 4.64 kB -2 B (0%)
build/format-library/index.js 7.64 kB +2 B (0%)
build/list-reusable-blocks/index.js 3.12 kB -1 B
build/media-utils/index.js 5.29 kB +1 B
build/plugins/index.js 2.56 kB +2 B (0%)
build/primitives/index.js 1.5 kB -2 B (0%)
build/rich-text/index.js 14.8 kB -3 B (0%)
build/server-side-render/index.js 2.68 kB +3 B (0%)
build/viewport/index.js 1.84 kB -1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.02 kB 0 B
build/autop/index.js 2.82 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/style-rtl.css 760 B 0 B
build/block-directory/style.css 761 B 0 B
build/block-editor/style-rtl.css 10.2 kB 0 B
build/block-editor/style.css 10.2 kB 0 B
build/block-library/editor-rtl.css 7.08 kB 0 B
build/block-library/editor.css 7.08 kB 0 B
build/block-library/style-rtl.css 7.24 kB 0 B
build/block-library/style.css 7.25 kB 0 B
build/block-library/theme-rtl.css 683 B 0 B
build/block-library/theme.css 685 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/components/style-rtl.css 16.9 kB 0 B
build/components/style.css 16.9 kB 0 B
build/core-data/index.js 11.4 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/date/index.js 5.47 kB 0 B
build/dom-ready/index.js 568 B 0 B
build/dom/index.js 3.1 kB 0 B
build/edit-navigation/index.js 4.05 kB 0 B
build/edit-navigation/style-rtl.css 485 B 0 B
build/edit-navigation/style.css 485 B 0 B
build/edit-post/style-rtl.css 12.2 kB 0 B
build/edit-post/style.css 12.2 kB 0 B
build/edit-site/style-rtl.css 5.19 kB 0 B
build/edit-site/style.css 5.2 kB 0 B
build/edit-widgets/style-rtl.css 4.67 kB 0 B
build/edit-widgets/style.css 4.66 kB 0 B
build/editor/editor-styles-rtl.css 428 B 0 B
build/editor/editor-styles.css 431 B 0 B
build/editor/index.js 44.3 kB 0 B
build/editor/style-rtl.css 5.07 kB 0 B
build/editor/style.css 5.08 kB 0 B
build/escape-html/index.js 734 B 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/hooks/index.js 2.13 kB 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.56 kB 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/keyboard-shortcuts/index.js 2.51 kB 0 B
build/keycodes/index.js 1.94 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/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 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.02 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.18 kB 0 B

compressed-size-action

@ellatrix
Copy link
Member

ellatrix commented May 5, 2020

What will this be used for?

@talldan
Copy link
Contributor Author

talldan commented May 5, 2020

@ellatrix It's something I looked into using for the Block Navigator: #18014

@ellatrix
Copy link
Member

ellatrix commented May 5, 2020

I'm not quite following. Is this for use in the UI or in blocks?

@talldan
Copy link
Contributor Author

talldan commented May 6, 2020

They're components used for managing focus and keyboard interaction, the idea is to use them in the Block Navigator, which is a tree like structure:
Screenshot 2020-05-06 at 4 31 02 pm

@ellatrix
Copy link
Member

ellatrix commented May 6, 2020

Ah I see. It's not to be used for blocks then :)

@gziolo
Copy link
Member

gziolo commented May 6, 2020

@talldan, have you see PR #21333 where @ItsJonQ used the Composite component from Reakit to build AlignmentMatrixControl? Would it be possible to use it rather than RovingTabIndex? /cc @diegohaz

@talldan
Copy link
Contributor Author

talldan commented May 6, 2020

@gziolo Quite possibly! I'll take a look tomorrow.

@diegohaz
Copy link
Member

diegohaz commented May 6, 2020

In case it helps, I've made this proof of concept of a TreeGrid component using Reakit's Composite: https://codesandbox.io/s/reakit-composite-treegrid-sh6uu?file=/src/TreeGrid.js

@talldan
Copy link
Contributor Author

talldan commented May 7, 2020

@gziolo @diegohaz Hmm, that seems like quite a huge refactor.

I'd be open to exploring it as a separate PR, but I'm hesitant to work it into this PR as I've already been through many iterations, and as we all know it's better to iterate and ship rather than iterate and not ship.

The components in this are experimental already, so we should be able to rework them afterwards. An option could be to make them unstable in this PR instead of experimental, as I do agree with the idea of using the Composite.

@talldan
Copy link
Contributor Author

talldan commented May 7, 2020

As for the status of this PR, the arrow key navigation should work consistently. The only outstanding issue that I know of is that screen readers don't read the row or level positions, and I'm guessing that's because the focusables in the treegrid are buttons that are children of the table cells. When the cells themselves can be focused position seems to be read correctly. This seems to be a shortcoming of the screenreader implementation.

In the main PR that uses the TreeGrid (#18014) I've gotten around this by adding descriptions to all the buttons in the grid using aria-describedby, so the position and level is read. The block movers already had this, so it'll work in a similar way:

@talldan
Copy link
Contributor Author

talldan commented May 12, 2020

Merged as part of #18014

@talldan talldan closed this May 12, 2020
@talldan talldan deleted the try/grid-accessibility-components branch May 12, 2020 02:06
@youknowriad
Copy link
Contributor

Related to the comments above from @gziolo and @diegohaz

It seems like we should avoid introducing stable components right now in Gutenberg (RovingIndex and GridTree) that we may remove/refactor later to rely on reakit. How complex would that refactor be, can we mark them unstable?

It's particularly important to not end up with a solution for the BlockNavigator and another one for Alignment.

@talldan
Copy link
Contributor Author

talldan commented May 13, 2020

@youknowriad They should be experimental at the moment, so not stable. RovingTabIndex is the one that would be removed so I'll put together a PR to mark that as unstable.

@gziolo
Copy link
Member

gziolo commented May 14, 2020

@youknowriad They should be experimental at the moment, so not stable. RovingTabIndex is the one that would be removed so I'll put together a PR to mark that as unstable.

Yes, it would be awesome to handle it. I think it's confusing that the docs are exposed in the manifest file. Given that, we are using WordPress 5.4 branch it's fine, but we should take care of it one way or another before the 5.5 release cycle starts. We should either refactor to use Composite from Reakit or find a way to stop exposing README files for experimental components to the developers portal.

@talldan
Copy link
Contributor Author

talldan commented May 15, 2020

@gziolo One of the underlying problems is that if the only option is to not write docs when creating an experimental component, then that becomes a task that has to be done later if the component becomes non-experimental, and it's easy to miss that task.

A nice little feature would be if we could add a text snippet like (experimental) or (unstable) to a header in a README, and then that could be expanded when building the docs to a warning like you see on the MDN website for first-level headings:
Screenshot 2020-05-15 at 12 13 40 pm

And something more concise for headings greater than first level:
Screenshot 2020-05-15 at 12 16 06 pm

@talldan
Copy link
Contributor Author

talldan commented May 15, 2020

Here's the PR to mark them unstable - #22373

@gziolo
Copy link
Member

gziolo commented May 15, 2020

One of the underlying problems is that if the only option is to not write docs when creating an experimental component, then that becomes a task that has to be done later if the component becomes non-experimental, and it's easy to miss that task.

Let me clarify it, I never meant to avoid writing docs or stories in the first place 😬

The idea is to improve our tooling to detect experimental and unstable components and never expose them at https://developer.wordpress.org/block-editor/components/.

This is where the files are collected:

const componentPaths = glob( 'packages/components/src/*/**/README.md', {
// Don't expose documentation for mobile only components just yet.
ignore: '**/mobile/*/README.md',
} );

It might be enough, as you mentioned, if we read the first row and detect whether "experimental" or "unstable" keyword is included. Based on that we could filter out some files from the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants