Skip to content

Implemented documentation for privacy-tools.js - #6690

Open
narenin wants to merge 3 commits into
WordPress:trunkfrom
narenin:49381-added-documentation-privacy-tool-js
Open

Implemented documentation for privacy-tools.js#6690
narenin wants to merge 3 commits into
WordPress:trunkfrom
narenin:49381-added-documentation-privacy-tool-js

Conversation

@narenin

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/49381


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions

github-actionsBot commented May 31, 2024

Copy link
Copy Markdown

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props narenin, mukesh27, vladimiraus, masteradhoc.

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

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@mukeshpanchal27mukeshpanchal27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docblock indention is not aligned.

@narenin

Copy link
Copy Markdown
Author

@mukeshpanchal27 I have implemented suggestions please check.

@narenin

Copy link
Copy Markdown
Author

@mukeshpanchal27 Please let me know if any other changes needs to be made.

}

/**
* Set the export progress percentage.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion to make it clear: Updates the export progress indicator based on the current exporter index.

/**
* Set the export progress percentage.
*
* @param {number} exporterIndex - The current exporter index.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion to clarify the parameter: The index of the current exporter being processed. Should be between 0 and exportersCount.

@masteradhoc

Copy link
Copy Markdown

Hey @narenin
Thank you very much for this PR! I'd like to get this merged in an upcoming WordPress Release.

Thanks for adding these JSDoc blocks — nice to see this function set documented! A few things to fix before this is ready per the [JS inline documentation standards]:

1. Missing @since tags
None of the new docblocks include an @since x.x.x tag. The standard requires this for every documented function (use svn blame to find the version each function was introduced in. Please add this to all blocks.

2. Drop the dash in @param descriptions
The standard format is @param {type} var Description. — no separator between the var name and description. Right now every param uses a dash, e.g.:

@param{object}$action-jQueryobjectrepresentingtheactionelement.

should be:

@param{object}$actionjQueryobjectrepresentingtheactionelement.

3. Align multi-param blocks
Where a function has more than one @param, the standard asks for the type/name/description columns to be padded so they line up. E.g. in appendResultsAfterRow:

* @param{object}$requestRow-jQueryobjectrepresentingtherequestrow.* @param{string}classes-CSSclassestoaddtotheresultsrow.* @param{string}summaryMessage-Summarymessagetodisplay.* @param{array}additionalMessages-Additionalmessagestodisplay.

(this also applies to setActionState and the doNextExport/doNextErasure two-param blocks) — once the dash is removed per #2, please still pad so descriptions start in a consistent column.

4. Type casing
{array} should be {Array} to match the capitalization convention used for {object}/{Array} elsewhere (primitives like string/number stay lowercase, built-in object types like Array/Object are capitalized).

5. Following up on @VladimirAus's comments
Agreed with both — the setExportProgress summary could be more specific about what drives the update, and the exporterIndex param description should mention its valid range (0 to exportersCount). Worth applying similar clarity passes to the analogous erasure-side functions (setErasureProgress/eraserIndex) for consistency.

Happy to take another pass once these are in!

Sign up for freeto 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.

4 participants

@narenin@masteradhoc@VladimirAus@mukeshpanchal27