Skip to content

Docs: add JSDoc for getUserLabel in users autocompleter#73651

Merged
juanfra merged 2 commits intoWordPress:trunkfrom
huzaifaalmesbah:docs/users-autocompleter-jsdoc
Dec 1, 2025
Merged

Docs: add JSDoc for getUserLabel in users autocompleter#73651
juanfra merged 2 commits intoWordPress:trunkfrom
huzaifaalmesbah:docs/users-autocompleter-jsdoc

Conversation

@huzaifaalmesbah
Copy link
Member

Adds a JSDoc comment block for the getUserLabel helper function in the users autocompleter. This documents the user parameter and clarifies the returned React component for better maintainability and IDE support.

Why

Improves code readability and provides better tooling support (hover documentation, type hints) without changing any runtime behavior.

Changes

  • Added JSDoc documentation above getUserLabel in packages/editor/src/components/autocompleters/user.js

Files Changed

  • packages/editor/src/components/autocompleters/user.js

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

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: huzaifaalmesbah <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: noruzzamans <[email protected]>

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

@noruzzamans
Copy link
Contributor

Thanks for adding this JSDoc block. It clarifies the user parameter and return value for getUserLabel and should improve editor/IDE hints. Since it only touches documentation and not runtime behavior, this looks good to me.

@juanfra juanfra added [Type] Enhancement A suggestion for improvement. [Type] Developer Documentation Documentation for developers labels Nov 30, 2025
@github-actions
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Type] Enhancement, [Type] Developer Documentation.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@juanfra juanfra removed the [Type] Enhancement A suggestion for improvement. label Nov 30, 2025
Copy link
Member

@juanfra juanfra 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 PR. I'd update the method description and the @return.

@huzaifaalmesbah
Copy link
Member Author

@juanfra Thanks your suggested change applied.

Copy link
Member

@juanfra juanfra left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you

@juanfra juanfra merged commit 31bf6c5 into WordPress:trunk Dec 1, 2025
34 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.3 milestone Dec 1, 2025
@Mamaduka
Copy link
Member

Mamaduka commented Dec 2, 2025

The getUserLabel isn't a public API, and it has no automatically generated documentation. IMO, I would avoid similar PRs in the future, as I don't think they add any real value to the codebase.

The project is also slowly switching to TypeScript, which is better at typing similar arguments.

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.

4 participants