Skip to content

Reporting table headers can now be configured separately for rows and columns#14132

Merged
seanbudd merged 11 commits into
nvaccess:masterfrom
CyrilleB79:tableHeaders
Sep 20, 2022
Merged

Reporting table headers can now be configured separately for rows and columns#14132
seanbudd merged 11 commits into
nvaccess:masterfrom
CyrilleB79:tableHeaders

Conversation

@CyrilleB79

@CyrilleB79 CyrilleB79 commented Sep 12, 2022

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #14075

Summary of the issue:

It was asked in #14075 to be able to have table row/column headers reporting configured separately.

Description of user facing changes

  • A combo-box in Documentation formatting settings allows to select among 4 options to have table headers reported: Off, Columns and rows, Rows and Columns; it replaces the previous checkbox for table headers reporting.
  • Setting row/column headers in Word or Excel (no UIA) is now possible even if the option to report table headers is disabled. Indeed, it is clearer from a UX point of view to allow it than to disallow it only when reporting table headers in the same direction (row/column) is disabled.
  • The toggle script for table headers reporting has also been adapted to cycle through the 4 options.

Description of development approach

  • Implemented as per Independent setting for report Row/column headers (Document Formatting panel) #14075 (comment).
  • Created an enumeration to store the possible options for this parameter, containing the numeric values for the config file and the display strings for the UI.
  • Not directly linked but a a noqa exception for code complexity of getObjectSpeech has been removed because it was not relevant anymore. Excepted the removal of this #noqa directive, getObjectSpeech is not modified in this PR.

Testing strategy

Manual testing of table navigation commands combining all the following possibilities:

  • Tested in the following applications/controls:
  • Tested with the 4 options: "Off", "Rows and columns", "Rows" and "Columns".
  • Tested that headers were reported with speech with the appropriate options
  • Tested that columns headers were reported with braille when "Rows and columns" or "Columns" option is enabled.

It has also been checked in nvda.ini that saving the config works as expected.

Known issues with pull request:

None

Change log entries:

New features (or Changes ?)
Reporting table headers can now be configured separately for rows and columns. (#14075)

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.

@AppVeyorBot

Copy link
Copy Markdown
  • PASS: Translation comments check.
  • PASS: Unit tests.
  • PASS: Lint check.
  • Build execution time has reached the maximum allowed time for your plan (60 minutes).

See test results for failed build of commit d58cc36794

@CyrilleB79 CyrilleB79 marked this pull request as ready for review September 13, 2022 09:05
@CyrilleB79 CyrilleB79 requested review from a team as code owners September 13, 2022 09:05
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 0c7d4eefb9

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 733f082224

Comment thread source/config/configFlags.py Outdated
Comment thread source/config/configFlags.py
Comment thread source/config/profileUpgradeSteps.py Outdated
Comment thread source/globalCommands.py Outdated
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 03525bd0cc

@seanbudd

This comment was marked as outdated.

@seanbudd seanbudd changed the title Reporting table headers can no be configured separately for rows and columns Reporting table headers can now be configured separately for rows and columns Sep 14, 2022
@seanbudd

This comment was marked as resolved.

@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 @CyrilleB79, generally looks good.

Comment thread source/speech/speech.py
seanbudd
seanbudd previously approved these changes Sep 14, 2022

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

User Guide change looks fine, good work.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Please don't merge yet as I have some suggestions I will post later today.

def script_setColumnHeader(self,gesture):
scriptCount=scriptHandler.getLastScriptRepeatCount()
if not config.conf['documentFormatting']['reportTableHeaders']:
if config.conf['documentFormatting']['reportTableHeaders'] == ReportTableHeaders.OFF:

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.

Shouldn't this only work when column header reporting is enabled? So, only when columns or both are reported?

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.

Actually, setting or removing column headers while only row headers are reported is working. If you remove this "if" statement, i.e. allow this script to work regardless of this reportTableHeaders configuration, it works too.

For simplicity (regarding the error message), I am thinking to remove this if statement, i.e. setting column headers even when reporting table headers is disabled. @LeonarddeR, @seanbudd, Can you see any drawback to this solution?

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.

I have finally allowed setting/removing row/column headers even if reporting table headers is disabled. I have updated the initial description accordingly.
@seanbudd, @LeonarddeR, let me know if this is OK for you.

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.

Great!

def script_setRowHeader(self,gesture):
scriptCount=scriptHandler.getLastScriptRepeatCount()
if not config.conf['documentFormatting']['reportTableHeaders']:
if config.conf['documentFormatting']['reportTableHeaders'] == ReportTableHeaders.OFF:

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.

Shouldn't this only work when row header reporting is enabled? So, only when row headers or both are reported?

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit b57fc75cd1

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

LGTM, thanks @CyrilleB79

@seanbudd seanbudd merged commit 99b2bcf into nvaccess:master Sep 20, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.4 milestone Sep 20, 2022
@CyrilleB79 CyrilleB79 deleted the tableHeaders branch September 20, 2022 06:59
seanbudd pushed a commit that referenced this pull request Sep 26, 2022
…ew schema. (#14183)

fix-up of #14132

Summary of the issue:
When upgrading configurations to the new versions of the schema we often need to check what value was set previously as not to change user preferences. In our profile upgrade steps we relied on the fact that false values in the config are falthy in the boolean context, but at the state where profile is upgraded these are not yet transformed into right types, so a value set to False is set to literal string "False" which is always truthy in a boolean context.
I've discovered this when, after #14132 got merged, in the profile where I had reporting of row and column headers disabled it got re-enabled after the schema update.

Description of user facing changes
People who have reporting of row and column header disabled would still have them disabled after updating to NVDA 2022.4.

Description of development approach
In places where we check if the option is set to True in our profile upgrade steps I used the default configobj converter between string and booleans to convert options into the right values. In addition I've removed some unnecessary pass statements and some variables capturing exceptions which weren't used.
While fixing previous upgrade steps would not help people who are upgrading NVDA regularly it still made sense to do so, to support people who skipped several upgrades and to have consistent style for the upgrade steps.
feerrenrut pushed a commit that referenced this pull request Nov 23, 2022
Closes #14170

Summary:
For some GUI settings, a difference between the default (base) profile and another profile,
could have unexpected results.
An example:
- A profile named 'Notepad' with setting (GUI option) 'line indentation reporting' to 'tones'
- The default profile with the same GUI option set to 'speech' 
- Result: indentation reported with speech and tones instead of tones only when returning to notepad
- Issue #14170 contains detailed steps.

Only one combo-box was used to set line indentation reporting in the UI, but the value of this
combo-box was saved in two items in the configuration.
These two items were then managed separately when dealing with configuration profile switching.

The following combo-boxes in the GUI were impacted by this issue:
* "Line indentation reporting" in doc formatting settings
  - See initial description of #14170
* "Cell borders" in doc formatting settings
  - See #14170 (comment)
* "Show messages" combined with "Message timeout" in braille settings 
  - See #14170 (comment)
* "Tether Braille" in braille settings
  - See #14170 (comment)

Change for users:
The values of the following settings should not change unexpectedly anymore
when switching profile:
* Line indentation in Document formatting settings.
* Cell borders in doc formatting settings
* Show messages in braille settings
* Tether Braille in braille settings

Approach:
* One control in the GUI now matches one and only one item in the config
* Upgrade the config adequately
* Used the same approach as #14132 (and the fix in #14183)

A note on profile upgrade:
Because it is possible for arbitrary stacking order for config profiles it is not possible
to determine the setting which would be expected by the user.
Config stacking can be caused by mixes of the following, default/base, manually enabled profile, app triggered profile, say-all triggered profile
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@seanbudd, I just realize that this PR was an API breaking change, due to the configuration modification and upgrade, but it has been merged in 2022.4 which was not intended to be an API breaking release.

I don't know of an add-on that uses this config keys.

This has no sense to revert it now. However, should this API breaking change be advertised somewhere? I would say at least on the API mailing list. And maybe in the change log, even if usually the log of older releases is not amended.

@josephsl

josephsl commented Jan 19, 2023 via email

Copy link
Copy Markdown
Contributor

@paulber19

paulber19 commented Jan 19, 2023 via email

Copy link
Copy Markdown

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Replying to all in the same message:

@josephsl wrote:

Hi, StationPlaylist add-on uses this config key, but as of now the add-on code will work on both 2022.3 and 2022.4 as integer values above 0 are seen as “true” in Python. I do plan to edit the add-on code son to use 2022.4 changes anyway. Thanks.

Sorry for the unforeseen API change; by chance this did not break your add-on.

@paulber19:

Hi, I would like to know how an API break is defined. It seems to me that any modification of NVDA's code is an API break for add-ons that rely on it. For example, documentBase.py has undergone a major overhaul in version 2022.2 compared to 2022.1 to add in particular the commands for moving tables in tables. And that involved a serious upgrade in one of my add-ons. So it seems to me that for developers of add-ons embedded in NVDA, any new version of NVDA is an API break and it is necessary to systematically check that the NVDA code on which it was based did not not undergone any modification. That's why I don't quite understand the principle of API breaking only when releasing the first version of the year. Best regards.

For packages, modules, classes, functions, variables, they are private if their name begin with a _ (underscore); such private elements do not belong to the API. We are going a bit off-topic however. If you want to discuss about the API definition, you may:

  • open a new issue if you feel that the concept of API should be documented better in NVDA, e.g. in dev docs
  • and/or discuss all this and ask more questions about it on a mailing list, e.g. nvda-addon or nvda-devel

@josephsl

josephsl commented Jan 19, 2023 via email

Copy link
Copy Markdown
Contributor

@paulber19

This comment was marked as resolved.

@seanbudd

Copy link
Copy Markdown
Member

Hi Cyrille,
I plan to announce this on the API mailing list.

Is this an accurate summary of the API breakage?

The configuration specification has been altered in the [documentFormatting] section.
The value of reportTableHeaders is now a member of configFlags.ReportTableHeaders, instead of a boolean.  (#14132)

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.

Independent setting for report Row/column headers (Document Formatting panel)

9 participants