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

Count \t as a character in speech.isBlank. #14102

Closed
wants to merge 1 commit into from
Closed

Count \t as a character in speech.isBlank. #14102

wants to merge 1 commit into from

Conversation

trypsynth
Copy link
Contributor

@trypsynth trypsynth commented Sep 3, 2022

Link to issue number:

Alternative to #13483
Fixes #13431
related to mltony/nvda-indent-nav#6

Summary of the issue:

speech.isBlank() wasn't counting tab as a blank character. This lead to two issues:

  1. A tab not being reported as a blank line unless indentation reporting was on.
  2. The issue outlined in Ignore blank lines containing indentation mltony/nvda-indent-nav#6 (i.e. indent nav would see lines containing tabs only as not being blank).

Description of user facing changes

If a line contains only tabs, it will now be reported as blank.

Description of development approach

added "\t" to speech.BLANK_CHUNK_CHARS

Testing strategy:

Turned off indentation reporting, and attempted to read a line containing only a tab.

Known issues with pull request:

None

Change log entries:

Changes

  • NVDA will now see lines containing only tabs as being blank.

Code Review Checklist:

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

@trypsynth trypsynth requested a review from a team as a code owner September 3, 2022 16:10
@trypsynth trypsynth requested a review from seanbudd September 3, 2022 16:10
@AppVeyorBot
Copy link

See test results for failed build of commit ef312f3f0e

@cary-rowen
Copy link
Contributor

Hi @TheQuinbox

For me it's kind of bad.
If so how can I differentiate between a completely blank line and a line containing a tab?

Thanks

@trypsynth
Copy link
Contributor Author

The same way you differentiate between a blank line and a line containing only spaces. I see no difference here, they're both whitespace

@Brian1Gaff
Copy link

Brian1Gaff commented Sep 4, 2022 via email

@Brian1Gaff
Copy link

Brian1Gaff commented Sep 4, 2022 via email

@trypsynth
Copy link
Contributor Author

Why does it matter how many spaces it is? Go ahead and try this:

  1. Turn off indentation reporting (if you have it on).
  2. Open notepad, or somewhere you can type.
  3. Press tab a few times, and attempt to read the line.
  4. Delete that line, and press space a few times, and attempt to read the line.

@seanbudd
Copy link
Member

seanbudd commented Sep 5, 2022

@michaelDCurran - do you think we should accept this PR?

@TheQuinbox - please fix up the system tests. Note the behaviour described in the "TODO" comments should be the behaviour that occurs as result of this PR.

@seanbudd seanbudd marked this pull request as draft September 5, 2022 05:22
@michaelDCurran
Copy link
Member

It certainly better standardizes NVDA's behaviour for whitespace characters.
And I agree that There is no real difference between a line of tabs verses a line of spaces for the majority of users. A sighted person can't generally tell the difference either.
However, they can if they explicitly set their editor to show whitespace characters, or if the cursor is a certain way across the line.
Also, it would be a change in behavior, and could have the possibility of breaking an add-on that may make assumptions about what is in that blank chars set.
I would not want to accept this pr as is, especially as it looks like the primary motivator is to improve one particular add-on. I think that issue can be addressed in the add-on instead.
I would accept the pr if the change was controlled by an option, with the default being current behavior. At very least until a .1 release.

@trypsynth
Copy link
Contributor Author

I sadly don't have the time to fix this up. I assumed the AppVeyor tests failing was just because they do that, I saw it for other PRs that got merged, so ignored it. With exams and such I just don't have the time to add a config option and all this, but someone else can pick this up if they feel so inclined.

@trypsynth trypsynth closed this Sep 5, 2022
@seanbudd seanbudd linked an issue Sep 7, 2022 that may be closed by this pull request
@seanbudd
Copy link
Member

seanbudd commented Sep 7, 2022

Also, it would be a change in behavior, and could have the possibility of breaking an add-on that may make assumptions about what is in that blank chars set.

@michaelDCurran - I'm surprised that we would consider this an API breaking change. I can't imagine a scenario which would break add-ons, it would just be an intentional change of behaviour which means they may process tabs like they would process other whitespace characters. This could create a change of behaviour in the add-on, but I don't think we have considered a change like this to be a breakage of compatibility in the past.
Is it because this character set is uniquely important?

If API breakage is a concern, I suggest this PR be resurrected for 2023.1 with the system tests fixed.

I would not want to accept this pr as is, especially as it looks like the primary motivator is to improve one particular add-on. I think that issue can be addressed in the add-on instead.

It was recently raised that we actually had #13431 scheduled as work to do. We were not aware as the author of the PR did not put it in the PR description initially. There is also an alternative PR #13483

@michaelDCurran
Copy link
Member

michaelDCurran commented Sep 7, 2022 via email

@trypsynth
Copy link
Contributor Author

@michaelDCurran, should I also document this change when the time comes, then?

@seanbudd, how should I go about fixing the system tests? I can't see what broke (not sure how to use Appveyor).

@seanbudd
Copy link
Member

seanbudd commented Sep 8, 2022

@TheQuinbox yes, breaking changes must be documented.

To be able to fix these system tests you should try running them locally.
Using the build system to check if you have fixed them properly will waste a lot of time.

@SamKacer
Copy link
Contributor

Is there still a desire for this? If the author is too busy, then I think I could quickly put this together. I am familiar with the failing tests since they are the same ones I had to change for #13483

@ruifontes
Copy link
Contributor

For me, a line with a tab or various spaces is not a blank line...

@SamKacer
Copy link
Contributor

@ruifontes so are you saying the current behavior of a line with just spaces being read as "blank" is incorrect? What would you suggest should be spoken instead?

@ruifontes
Copy link
Contributor

Nothing or space for 1 space symbol or x spaces...
For me, a blank line do not contain any symbols... I know that visually the line may seems blank, but that is not true if cursor is in the end of line or if symbols are marked to be seen...
So, for me, any line with any character should not be announced as blank. Or, if NVDA team wants to keep the behaviour, allow a configuration to be announced with silence... or the number of symbols present...

@SamKacer
Copy link
Contributor

@ruifontes

Nothing or space for 1 space symbol or x spaces...

You already have the option for turning that on. If you set indentation reporting to "report indentation with speech" then it will read a line with just spaces as exactly that. This wouldn't change that

@ruifontes
Copy link
Contributor

But why I have to hear indentation if I don't want that?
When I want to know the identation I use the Braille display...

@SamKacer
Copy link
Contributor

@ruifontes

But why I have to hear indentation if I don't want that?

In your previous comment you said you don't want to hear "blank" if there are spaces onn a line. You said instead you want to hear x spaces. That is the behavior you get when you turn on "report indentation with speech".

@ruifontes
Copy link
Contributor

@SamKacer, please do not put in my mouth words I have not said...
For me, as it is now it is very good...
Hear spaces was given by me as an option different of silence...
With your suggestion, I will hear x spaces in a lot of lines and not only in a line where there are only spaces or tabs...

@XLTechie
Copy link
Collaborator

XLTechie commented Jun 22, 2023 via email

@XLTechie
Copy link
Collaborator

XLTechie commented Jun 22, 2023 via email

@SamKacer
Copy link
Contributor

@ruifontes Apologies, I didn't mean to put any words in your mouth. I just saw you write the following and that's how I interpreted it. I think I get now what you meant from @XLTechie explanation

Nothing or space for 1 space symbol or x spaces...

@SamKacer
Copy link
Contributor

@XLTechie Ah ok, thanks. I think I get it now. Essentially what you 2 want is like indentation reportingwith speech, but only for blank lines

@XLTechie
Copy link
Collaborator

XLTechie commented Jun 23, 2023 via email

@CyrilleB79
Copy link
Collaborator

Could you please comment in an open issue or open a new one? All these comments will be easily lost or unread.

@XLTechie
Copy link
Collaborator

XLTechie commented Jun 23, 2023 via email

@seanbudd
Copy link
Member

seanbudd commented Jun 23, 2023

NV Access does not track closed PRs or closed issues.

If there are outstanding requests on a closed issue or PR, it won't be addressed by us.
We might read it, but it's not gonna be on our project boards as it's be documented on an open issue that we can close via a PR.

Users looking for an active issue with NVDA are less unlikely to search closed issues

@ruifontes
Copy link
Contributor

@SamKacer, I agree with @XLTechie!
If silence should be replaced, should be by the number of white characters.

@SamKacer
Copy link
Contributor

@seanbudd Hi, I started on here because I was asking if this PR is still desired. I saw that the issue was that author didn't fix the system tests. I offered to make this changes and fix the tests, but asked here first. Thought it was appropriate

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.

Tab characters should be considered blank
10 participants