Skip to content

Improvements to battery reporting script#19087

Merged
seanbudd merged 9 commits into
nvaccess:masterfrom
tareh7z:improvements-to-battery-reporting
Oct 14, 2025
Merged

Improvements to battery reporting script#19087
seanbudd merged 9 commits into
nvaccess:masterfrom
tareh7z:improvements-to-battery-reporting

Conversation

@tareh7z

@tareh7z tareh7z commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #9003.

Summary of the issue:

Battery time script was reporting redundant "0 hours" and "0 minutes", and using plural forms for single hours and minutes.

Description of user facing changes:

NVDA will no longer speak remaining time when it reaches zero, for both hours and minutes.

Description of developer facing changes:

None.

Description of development approach:

  • Added logic to skip time reporting when both hours and minutes are zero
  • Separated hour and minute handling to only display non-zero values
  • Used proper singular/plural forms via ngettext for 1 hour/1 minute cases

Testing strategy:

Manually tested running from source.

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.

@tareh7z tareh7z marked this pull request as ready for review October 11, 2025 15:25
@tareh7z tareh7z requested a review from a team as a code owner October 11, 2025 15:25
@tareh7z tareh7z requested a review from seanbudd October 11, 2025 15:25
@CyrilleB79

Copy link
Copy Markdown
Contributor

Thanks for fixing the singular issue; seems that it was my mistake.

@seanbudd seanbudd 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.

Thanks for addressing this @hdzrvcc0X74, just some minor suggestions

Comment thread source/winAPI/_powerTracking.py Outdated
Comment thread source/winAPI/_powerTracking.py Outdated
Comment thread source/winAPI/_powerTracking.py Outdated
@tareh7z

tareh7z commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

@seanbudd Thanks for the feedback! I've implemented your suggestions.

This is my first GitHub contribution, so please let me know if I missed anything in the process.

@seanbudd seanbudd 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.

Thanks @hdzrvcc0X74

Comment thread source/winAPI/_powerTracking.py
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Oct 14, 2025
@tareh7z

tareh7z commented Oct 14, 2025

Copy link
Copy Markdown
Contributor Author

@seanbudd Translator comments added for all new strings. Thanks again for the guidance!

@seanbudd seanbudd enabled auto-merge (squash) October 14, 2025 04:23
@seanbudd seanbudd merged commit 43dfc2e into nvaccess:master Oct 14, 2025
29 checks passed
@github-actions github-actions Bot added this to the 2026.1 milestone Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion of some enhancements to the say_battery_status script.

3 participants