Skip to content

Document logHandler.getOnErrorSoundRequested() extension point#16017

Merged
seanbudd merged 2 commits into
nvaccess:betafrom
CyrilleB79:docExtPoint
Jan 10, 2024
Merged

Document logHandler.getOnErrorSoundRequested() extension point#16017
seanbudd merged 2 commits into
nvaccess:betafrom
CyrilleB79:docExtPoint

Conversation

@CyrilleB79

Copy link
Copy Markdown
Contributor

Link to issue number:

Fix-up of #15691.

Summary of the issue:

In #15691, a new extension point has been created. Unfortunately I have forgotten to document it.

Description of user facing changes

Document this extension point in the dev guide as well as in the change log.

Description of development approach

N/A

Testing strategy:

N/A

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@AppVeyorBot

Copy link
Copy Markdown
  • PASS: Translation comments check.
  • PASS: Unit tests.
  • PASS: Lint check.
  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit 5629cfc4b2

@CyrilleB79 CyrilleB79 changed the base branch from master to beta January 9, 2024 11:10
@CyrilleB79 CyrilleB79 closed this Jan 9, 2024
@CyrilleB79 CyrilleB79 reopened this Jan 9, 2024
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Cc @XLTechie in case you want to review this.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Note that I have inserted the new paragraph following alphabetic order, even if only two paragraphs are not ordered originally.

++ logHandler ++[logHandlerExtPts]

|| Type | Extension Point | Description |
| ``Action`` | ``getOnErrorSoundRequested()`` | Triggered every time an error sound needs to be played. |

@XLTechie XLTechie Jan 9, 2024

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You are not documenting an extension point, but a function which returns, or creates and returns, an extension point. This is not how any other extension point is documented or used.
Either in the table description, or in a note immediately after the table, or both, this should be explained further.
A starting point may be:

Suggested change
| ``Action`` | ``getOnErrorSoundRequested()`` | Triggered every time an error sound needs to be played. |
| ``Action`` | ``getOnErrorSoundRequested()`` | Called to obtain the Action which is used to notify when an error sound should be played. |
In order to avoid difficulties with early or circular importing, this extension point has been encapsulated by a function, and is silently created upon first use.
Other than calling it as a function, it may be used like any other extension point.

I admit that my memory of your work in that module is vague at best, so I may have misunderstood something about how it works. But that's what I got from reading the code a minute ago, and what I remember from the original PR. Hopefully that helps some.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @XLTechie for your review.

I have made an updates in de8ec3e based on your review comment.

Since the dev doc documents extension points in this paragraph, I have documented the private extension point, but have indicated explicitely that you should use the function to retrieve it.

I have also added the rest of the documentation in the code as it is done for other extension points, since the dev doc is only a listing with a basic description of the extension points and it is indicated that more information can be found in the code.

@CyrilleB79 CyrilleB79 marked this pull request as ready for review January 9, 2024 14:25
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner January 9, 2024 14:25
@CyrilleB79 CyrilleB79 requested review from seanbudd and removed request for a team January 9, 2024 14:25
++ logHandler ++[logHandlerExtPts]

|| Type | Extension Point | Description |
| ``Action`` | ``_onErrorSoundRequested`` | Triggered every time an error sound needs to be played. This extension point should not be used directly but retrieved calling ``getOnErrorSoundRequested()`` instead. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd suggest to avoid mentioning _onErrorSoundRequested explicitly both here and in the change log. The fact that this exists as a private variable is irrelevant to developers, and they should only access it via the getter function. By mentioning it were essentially committing to the private part of the API.

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.

I disagree - the dev guide and changes for developers is for core developers and other contributors, not just add-on developers. The distinction here on usage and API boundary is fairly clear.

@seanbudd seanbudd added this to the 2024.1 milestone Jan 9, 2024
@seanbudd seanbudd added the blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. label Jan 9, 2024
@seanbudd seanbudd closed this Jan 10, 2024
@seanbudd seanbudd reopened this Jan 10, 2024
@seanbudd

Copy link
Copy Markdown
Member

hopefully retriggering build

@XLTechie XLTechie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thanks @CyrilleB79!

++ logHandler ++[logHandlerExtPts]

|| Type | Extension Point | Description |
| ``Action`` | ``_onErrorSoundRequested`` | Triggered every time an error sound needs to be played. This extension point should not be used directly but retrieved calling ``getOnErrorSoundRequested()`` instead. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

While initially I agreed with @lukaszgo1's thinking that we shouldn't document a private variable like this, I think the way it is being done here makes clear how it is expected to be used. Documenting the actual variable which holds the extPoint is closer to the spirit of the rest of the Dev Guide chapter. Anyone who misuses it after reading the clear description @CyrilleB79 has written, is taking their own stupid risks.

@seanbudd seanbudd removed the blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. label Jan 10, 2024
@seanbudd seanbudd merged commit ffad3a8 into nvaccess:beta Jan 10, 2024
@CyrilleB79 CyrilleB79 deleted the docExtPoint branch January 10, 2024 07:43
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
…ccess#16017)

Fix-up of nvaccess#15691.

Summary of the issue:
In nvaccess#15691, a new extension point has been created. Unfortunately I have forgotten to document it.

Description of user facing changes
Document this extension point in the dev guide as well as in the change log.
Sign up for free to 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.

5 participants