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

Fix/explorer rules #1079

Merged
merged 6 commits into from
Apr 8, 2024
Merged

Fix/explorer rules #1079

merged 6 commits into from
Apr 8, 2024

Conversation

zorkow
Copy link
Member

@zorkow zorkow commented Mar 29, 2024

Reenables the change of rule sets and preferences for speech generation.

  • Uses a standard variable definition forspeechRules.
  • Switches to clearspeak as default, thereby also fixing a type mathspeek that lead to incorrect speech computation.
  • Fixes an error when the selection box is closed, as it is not attached to a mathitem.

Still two issues:

  • I still need to make an SRE release.
  • Currently one can select rule sets that do not always exist for every locale. There are two solutions for this:
  1. disactivating the menu items that should not be chosen, which would require quite a bit of refactoring of the current speech menu code,
  2. on the other hand I always wanted to ensure that SRE produces reasonable output even with a non-existing rule set is chosen. I go with this solution for now.

@zorkow zorkow requested a review from dpvc March 29, 2024 20:53
Copy link
Member

@dpvc dpvc left a comment

Choose a reason for hiding this comment

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

One change suggestion to simplify the speechRules definition, but other than that looks good.

Comment on lines 510 to 523
{
name: 'speechRules',
getter: () => {
return this.settings['speechRules'];
},
setter: (value: string) => {
const [domain, style] = value.split('-');
this.settings['speechRules'] = value;
this.document.options.sre.domain = domain;
this.document.options.sre.style = style;
this.rerender(STATE.COMPILED);
this.saveUserSettings();
}
},
Copy link
Member

Choose a reason for hiding this comment

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

You should be able to use this.variable() rather than this.a11yvar() to define this, so you don't have to do the getter and setter by hand (and won't need to include lines 517 and 521, which are part of what this.variable() does. So

          this.variable<string>('speechRules', value => {
            const [domain, style] = value.split('-');
            this.document.options.sre.domain = domain;
            this.document.options.sre.style = style;
            this.rerender(STATE.COMPILED);
          }),

should do it (that is, changing a11yvar to variable and adding the rerender() call to the original lines 510 to 514 should be enough).

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that and it not work. And it drove me crazy, so I decided to stick with the pedestrian version.
But I will try again. Maybe I was just too thick the other day.

Copy link
Member

Choose a reason for hiding this comment

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

I just tried this out, and it seemed to work fine for me. Give it another try, and see if you have any problems.

Base automatically changed from fix/ff_safari_issues to develop April 4, 2024 12:46
@zorkow zorkow merged commit 0a66984 into develop Apr 8, 2024
@zorkow zorkow deleted the fix/explorer_rules branch April 8, 2024 17:22
@dpvc dpvc added this to the v4.0 milestone Apr 17, 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.

None yet

2 participants