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

Update PostFormat, PostFormatCheck editor component docs #61732

Merged

Conversation

colorful-tones
Copy link
Member

@colorful-tones colorful-tones commented May 16, 2024

What? & Why?

Addresses two items in #60358

Adding documentation to existing editor components can help with any of the following:

  • encourages knowledge sharing and quicker onboarding for future devs
  • supports maintenance and troubleshooting
  • mitigates risk

How?

Add a JSDoc comment to the PostFormat and PostFormatCheck components and run npm run docs:build to populate the README with the newly added documents.

@colorful-tones colorful-tones changed the title Update PostFormat editor component docs Update PostFormat, PostFormatCheck editor component docs May 16, 2024
@colorful-tones colorful-tones self-assigned this May 16, 2024
@colorful-tones colorful-tones marked this pull request as ready for review May 16, 2024 17:02
Copy link

github-actions bot commented May 16, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

* <PostFormat />
* ```
*
* @returns {React.Element} The rendered PostFormat component.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to cause a linter warning. I saw we usually use @return {JSX.Element} or @return {Component}.

* It filters the post formats based on the supported formats and the current post format.
* It also provides a suggestion for the post format if it's different from the current post format.
*
* @component
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to cause a linter warning. We should remove the @component.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Left a couple of small comments, but this looks good. Thanks!

@@ -38,6 +38,20 @@ export const POST_FORMATS = [
return 0;
} );

/**
* `PostFormat` is a React component that provides a dropdown selector for post formats.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rephrase this a bit to exclude the implementation details (dropdown, fetches etc..) to something like:

... a component that allows changing the post format while also providing a suggestion for the current post.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thank you!

@ntsekouras ntsekouras merged commit 1240294 into WordPress:trunk May 20, 2024
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 18.5 milestone May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants