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

Provide speech symbols file name path on creation #17346

Merged
merged 5 commits into from
Nov 4, 2024
Merged

Provide speech symbols file name path on creation #17346

merged 5 commits into from
Nov 4, 2024

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Nov 1, 2024

Link to issue number:

Fixes #17344

Summary of the issue:

The SpeechSymbols only sets the filename to write to when the dictionary is loaded.
Before 826ef91, dictionary files were always loaded before they were saved.
Afterwards, dictionaries are saved without being loaded.
When trying to save dictionary files the following error occurs, due to no file name being set

Speaking [LangChangeCommand ('en_US'), 'pressed']
ERROR - unhandled exception (17:00:20.842) - MainThread (9964):
Traceback (most recent call last):
  File "gui\settingsDialogs.pyc", line 5350, in onOk
  File "characterProcessing.pyc", line 364, in save
ValueError: No file name

Description of user facing changes

Users can now save the speech dictionary dialog.
Add-ons which use custom speech dictionaries are also saved correctly now.

Description of development approach

Create optional parameter to set filename path for speech dictionaries.

Testing strategy:

Manual testing issue described in #17345
Manually testing Perky Duck add-on which uses a custom speech dictionary

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.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced support for new braille displays with automatic detection.
    • Enhanced support for Microsoft Office applications, including better formatting and table reporting.
    • Added functionality for reading and interacting with mathematical content in web browsers and Office.
    • Implemented automatic language switching based on document language.
    • Launched a new "Add-on Store" for managing NVDA add-ons.
  • Improvements

    • Significant enhancements to web browsing support, including a new "browse mode."
    • Improved stability and performance with numerous bug fixes.
  • Version Update

    • Minor version updated from 0 to 1.

@seanbudd seanbudd requested a review from a team as a code owner November 1, 2024 08:19
user_docs/en/changes.md Outdated Show resolved Hide resolved
Copy link
Contributor

coderabbitai bot commented Nov 1, 2024

Walkthrough

The pull request introduces several changes across multiple files. It updates the minor version number of NVDA software in source/buildVersion.py, modifies the SpeechSymbols class to accept a filename parameter in source/characterProcessing.py, and includes various enhancements and bug fixes in user_docs/en/changes.md. These changes aim to improve functionality, support for new features, and overall user experience.

Changes

File Change Summary
source/buildVersion.py Updated version_minor from 0 to 1.
source/characterProcessing.py Updated SpeechSymbols constructor to accept an optional filename parameter; modified _initSymbols to pass the formatted path to SpeechSymbols.
user_docs/en/changes.md Documented significant changes including new features, improvements, and bug fixes across NVDA.

Assessment against linked issues

Objective Addressed Explanation
NVDA will fail to close the pronunciation/symbol pronunciation dialog when the OK button is invoked. (#17344) The changes do not address the dialog closing issue.

Possibly related PRs

Suggested labels

conceptApproved, merge-early

Suggested reviewers

  • Qchristensen

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

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

I definitely prefer this approach, thanks!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
source/characterProcessing.py (1)

240-244: LGTM! Consider adding type hints for the return type.

The addition of the optional filename parameter to the constructor is a good change that allows setting the filename during initialization. This fixes the issue where the filename was only set during load(), enabling saving without loading first.

Consider adding a return type hint to the constructor:

-    def __init__(self, filename: str | None = None):
+    def __init__(self, filename: str | None = None) -> None:
user_docs/en/changes.md (1)

Line range hint 12-24: Consider adding version numbers for dependencies

When listing updated dependencies like eSpeak-NG and LibLouis, consider including the specific version numbers in the highlights section for better clarity.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 57923e2 and 1280f0d.

📒 Files selected for processing (3)
  • source/buildVersion.py (1 hunks)
  • source/characterProcessing.py (2 hunks)
  • user_docs/en/changes.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
source/buildVersion.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious. When providing code suggestions, particularly when requested, ensure GitHub's suggestion format is used, i.e.: suggestion <code changes>


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

source/characterProcessing.py (2)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious. When providing code suggestions, particularly when requested, ensure GitHub's suggestion format is used, i.e.: suggestion <code changes>


Pattern **/*.py: _, pgettext, ngettext, and ngettext are defined globally, errors for this being undefined can be ignored.

user_docs/en/changes.md (3)

Pattern **/*: Focus on code smells, logic errors, edge cases, missing test cases, security flaws and serious issues. Avoid commenting on minor issues such as linting, formatting and style issues. This project uses tabs instead of spaces, do not suggest usage of spaces over tabs. Are there any 'red flags' in this code that might warrant closer investigation from a security standpoint? Explain what makes them suspicious. When providing code suggestions, particularly when requested, ensure GitHub's suggestion format is used, i.e.: suggestion <code changes>


Pattern **/*.md: Focus on grammar, spelling, and punctuation. Also consider readability and clarity of contents. Ensure that changes follow the style of one sentence per line, suggest changes if this is not met.


Pattern user_docs/en/changes.md: Ensure each change log entry references an issue or pull request number. Change log entries can also include a reference to a GitHub author. Examples of valid change log entries: * Item with sub-items (#123, @username): * sub-item * bar (#342) * Item with. Multiple lines. (#143)

🔇 Additional comments (5)
source/buildVersion.py (1)

68-68: Verify if the minor version increment is justified.

While the changes in this PR fix important issues with speech dictionaries and dialog behavior, let's verify if these changes are significant enough to warrant a minor version bump from 0 to 1. According to semantic versioning principles, minor version increments typically indicate new functionality added in a backward-compatible manner.

Let's analyze recent changes to confirm the scope:

✅ Verification successful

Let me check the changelog to better understand the changes that justify this version bump.


Minor version increment is justified

The version bump from 2024.4.0 to 2024.4.1 is appropriate as this is a patch release that fixes two specific bugs:

  1. A fix for Outlook on certain Windows 10 systems
  2. A critical bug fix for saving speech dictionaries and dialog closure (nvda will fail to close the pronounciation/symbol pronounciation dialog when the ok button is envoked. #17344)

The changes involve providing the speech symbols filename path during creation, which fixes the speech dictionary saving functionality. This type of bug fix is correctly reflected in a patch version increment (0 to 1) rather than a minor version bump.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check recent changes to assess version bump justification

# Get recent commits and their impact
git log -n 10 --oneline

# Check for other significant changes in this PR
git diff HEAD~1 --name-status

# Look for other version-related changes
rg -g '!*.pyc' -g '!*.pyo' "2024.4." 

Length of output: 3202


Script:

#!/bin/bash
# Check the changelog for details about the changes
cat user_docs/en/changes.md | head -n 20

# Look at the actual code changes in the relevant commit
git show f40c93c1

Length of output: 2118

source/characterProcessing.py (1)

829-829: LGTM! The filename is now properly initialized.

Passing the formatted path to the SpeechSymbols constructor ensures the filename is set immediately upon creation, which works in conjunction with the constructor changes to fix the saving issue.

user_docs/en/changes.md (3)

1-7: LGTM: Clear changelog header and introduction

The header and introduction provide a good overview of the latest changes. The formatting follows standard Markdown conventions.


8-11: LGTM: Well-organized highlights section

The highlights section effectively summarizes the key changes in this release, making it easy for users to quickly understand the major updates.


Line range hint 25-1000: LGTM: Well-structured changelog entries

The changelog entries are well organized with:

  • Clear version headers
  • Consistent categorization (New Features, Changes, Bug Fixes, etc.)
  • Issue/PR references
  • Detailed descriptions

@nvdaes
Copy link
Collaborator

nvdaes commented Nov 1, 2024

For me this sounds good, but I'm not able to test this. I get the following error:

CRITICAL - main (09:37:46.570) - MainThread (6652):
core failure
Traceback (most recent call last):
File "nvda.pyw", line 526, in
core.main()
File "core.py", line 843, in main
import UIAHandler
File "UIAHandler_init_.py", line 30, in
import IAccessibleHandler.internalWinEventHandler
File "IAccessibleHandler_init_.py", line 51, in
import NVDAObjects.IAccessible
File "NVDAObjects\IAccessible_init_.py", line 31, in
from comInterfaces.tom import ITextDocument
File "comInterfaces\tom.py", line 3, in
import comtypes.gen._8CC497C9_A1DF_11CE_8098_00AA0047BE5D_0_1_0 as wrapper_module
File "comInterfaces_8CC497C9_A1DF_11CE_8098_00AA0047BE5D_0_1_0.py", line 2816, in
_check_version('1.4.6', 1728029317.614646)
File "monkeyPatches\comtypesMonkeyPatches.py", line 197, in _check_version
raise ImportError("Wrong version")
ImportError: Wrong version

user_docs/en/changes.md Outdated Show resolved Hide resolved
@nvdaes
Copy link
Collaborator

nvdaes commented Nov 1, 2024

Sorry, I didn't mereged this into rc but into master. I'm recreating the virtual environment on my machine to test properly.

Co-authored-by: Noelia Ruiz Martínez <nrm1977@gmail.com>
@nvdaes
Copy link
Collaborator

nvdaes commented Nov 1, 2024

I'll test the artifact when appveyord creates it.

@nvdaes
Copy link
Collaborator

nvdaes commented Nov 1, 2024

Also, in source/addonAPIVersion.py, I think we should made this change:

  • BACK_COMPAT_TO: AddonApiVersionT = (2025, 1, 0)
  • BACK_COMPAT_TO: AddonApiVersionT = (2024, 1, 0)

2024.4.1 doesn't exist in the server as an API version, so add-ons cannot be retrievet when trying the artifact.

@kolohekai
Copy link

lets hope this issue is resolved. looking forward to testing the alpha snapshot!!!

user_docs/en/changes.md Outdated Show resolved Hide resolved
@seanbudd
Copy link
Member Author

seanbudd commented Nov 3, 2024

@nvdaes - no, we just need to update nvdaAPIVersions.json. This is a 2024.4.1 release, we are not using the 2025.1 API

@seanbudd seanbudd merged commit d21c8ba into rc Nov 4, 2024
5 checks passed
@seanbudd seanbudd deleted the fix-17345 branch November 4, 2024 00:32
@github-actions github-actions bot added this to the 2025.1 milestone Nov 4, 2024
@seanbudd seanbudd modified the milestones: 2025.1, 2024.4.1 Nov 4, 2024
seanbudd added a commit that referenced this pull request Nov 4, 2024
Provide speech symbols file name path on creation (#17346)
@coderabbitai coderabbitai bot mentioned this pull request Nov 4, 2024
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