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

Components: Add more prominent documentation around popover use #39709

Merged
merged 5 commits into from
Mar 28, 2022

Conversation

aaronrobertshaw
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw commented Mar 24, 2022

What?

Highlights usage of the Popover and Tooltip components to ensure correct positioning.

Why?

When using the Tooltip component, and therefore Popover by proxy, outside the block or site editors, it isn't immediately obvious why each Popover is being rendered inline and out of position.

This was encountered during the development of new border controls where improving the docs was suggested.

How?

A prominent section relating to using Popover and ToolTip components is added to the main readme for the components package which can then be linked to from individual component docs that are likely to need Popovers rendered via a SlotFill.

Testing Instructions

Proofread edited docs.

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Mar 24, 2022
@aaronrobertshaw aaronrobertshaw self-assigned this Mar 24, 2022
Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

This reads well to me @aaronrobertshaw, thanks for following up with an update to the docs!

For the URLs linking the documents to each other, I was wondering if they need to be absolute paths instead so that the URLs get transformed correctly when the docs are rolled out to the block editor handbook (e.g. https://developer.wordpress.org/block-editor/reference-guides/components/)

I'm not too sure how it's all hooked together, but I see in the Button component for example that a link to the icon readme is written as [Icon](/packages/components/src/icon/README.md).

@aaronrobertshaw
Copy link
Contributor Author

Good catch @andrewserong.

For the URLs linking the documents to each other, I was wondering if they need to be absolute paths instead

This was an oversight on my behalf. I meant to update them as I copied them in.

Copy link
Contributor

@andrewserong andrewserong 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 the update, LGTM! 🎉

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Great, thanks for improving the docs! The explanation is very helpful.

If this only affects consumers that are building for outside the editor, should we perhaps lead with that information? (e.g. "If you're using the component outside of the editor, make sure to...") I'm guessing the majority of wp-component consumers are building for inside the editor, so they don't need to add their own SlotFill.

packages/components/README.md Outdated Show resolved Hide resolved
packages/components/src/color-palette/README.md Outdated Show resolved Hide resolved
@aaronrobertshaw aaronrobertshaw force-pushed the update/components-docs-for-popovers branch from 7a96330 to 5e56284 Compare March 28, 2022 00:38
Copy link
Contributor

@glendaviesnz glendaviesnz left a comment

Choose a reason for hiding this comment

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

LGTM with the suggested changes included - :shipit:

@aaronrobertshaw aaronrobertshaw merged commit 01668d3 into trunk Mar 28, 2022
@aaronrobertshaw aaronrobertshaw deleted the update/components-docs-for-popovers branch March 28, 2022 05:25
@github-actions github-actions bot added this to the Gutenberg 13.0 milestone Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants