Skip to content

Enable/disable the 'Report normalized' checkbox when opening the speech panel#16810

Merged
seanbudd merged 1 commit into
nvaccess:betafrom
CyrilleB79:disableNormalizeCheckbox
Jul 3, 2024
Merged

Enable/disable the 'Report normalized' checkbox when opening the speech panel#16810
seanbudd merged 1 commit into
nvaccess:betafrom
CyrilleB79:disableNormalizeCheckbox

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

Link to issue number:

Fix-up of #16521.

Summary of the issue:

When opening the speech settings panel, the checkbox "Report 'Normalized' when navigating by character" is enabled, no matter the value of the "Unicode normalization" combo-box.

Description of user facing changes

When opening the speech settings panel, the checkbox "Report 'Normalized' when navigating by character" will be enabled or disabled (greyed out), depending on the value of the "Unicode normalization" combo-box, as it is already the case when the selection of this combo-box is modified.

Description of development approach

As done for "Ignore blank lines for line indentation reporting" checkbox in Document formatting settings, explicitly call the .Enable method when the panel is initialized.

Testing strategy:

Manual testing.

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

  • New Features
    • Enabled the "Report Normalized for Character Navigation" checkbox based on Unicode normalization settings.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Cc @LeonarddeR FYI.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Good catch. I thought I covered this by adding onChoiceEventHandler to the combo box before calling SetSelection on the combobox. I was pretty sure it once worked. May be it has to do with timing.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Good catch. I thought I covered this by adding onChoiceEventHandler to the combo box before calling SetSelection on the combobox. I was pretty sure it once worked. May be it has to do with timing.

I do not know if it has worked this way in the past. In any case, for the normalize combo-box, it would not have worked because the checkbox to enable/disable is not yet created when you call SetSelection on the combo-box.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Ah yeah, that's pretty obvious actually.

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

Thank you!

@CyrilleB79 CyrilleB79 marked this pull request as ready for review July 3, 2024 14:27
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner July 3, 2024 14:27
@CyrilleB79 CyrilleB79 requested review from gerald-hartig and removed request for a team July 3, 2024 14:27
@coderabbitai

coderabbitai Bot commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The change in source/gui/settingsDialogs.py involves enabling reportNormalizedForCharacterNavigationCheckBox based on the current state of unicodeNormalizationCombo. This adds a conditional check in the makeSettings method of SomeClass to control the behavior of a checkbox depending on the normalization setting.

Changes

File Summary of Changes
source/gui/settingsDialogs.py Enabled reportNormalizedForCharacterNavigationCheckBox conditionally based on unicodeNormalizationCombo.

Tip

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between eb452d6 and 90e7ffe.

Files selected for processing (1)
  • source/gui/settingsDialogs.py (1 hunks)
Additional context used
Path-based instructions (1)
source/gui/settingsDialogs.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.


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

Additional comments not posted (1)
source/gui/settingsDialogs.py (1)

1617-1619: Ensure correct initialization of the checkbox state.

The added lines correctly enable or disable the reportNormalizedForCharacterNavigationCheckBox based on the state of unicodeNormalizationCombo. This aligns with the PR objective to ensure the checkbox state reflects the combo-box value when the panel is initialized.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@seanbudd seanbudd added this to the 2024.3 milestone Jul 3, 2024
@seanbudd seanbudd merged commit fbbb188 into nvaccess:beta Jul 3, 2024
Comment on lines 1614 to 1616
self.reportNormalizedForCharacterNavigationCheckBox.SetValue(
config.conf["speech"]["reportNormalizedForCharacterNavigation"]
)

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.

@CyrilleB79 - I just realised, should this have been removed? Why wasn't this working?

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.

@seanbudd, it was (and it is) working. These lines control the checkbox's value, i.e. checked vs unchecked.

On the other hand, the modification of this PR instead deal with the control's state, i.e. enabled (normally activable) / disabled (greyed out, not activable).

These are two separate thing.

@CyrilleB79 CyrilleB79 deleted the disableNormalizeCheckbox branch July 5, 2024 08:12
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.

3 participants