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

Remove contributors file from NVDA, read license as HTML #17600

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Jan 8, 2025

Link to issue number:

Closes #17529
Closes #16922

Summary of the issue:

There is a transient bug with Windows that prevents opening the "contributors" and "license" file in notepad.
The contributors file is no longer maintained or useful, so this should instead be archived.
The license file is written in markdown, but displayed as plain text in notepad, or as a plain text scrollable text window. This makes it hard for users to read.

Description of user facing changes

  • The license file is now displayed in HTML, generated from markdown.
    From the installer, this is an embedded WebView, from the menu, this is a browseable message.
  • The installer now has a more thorough agreement message to confirm the user has read the license
  • The contributors file can no longer be accessed from NVDA
  • Note: the license file is still not openable in secure screens, but now can be read in secure mode

Description of development approach

  • Use markdown module to convert markdown to html
  • Use nh3 to sanitize generated HTML
  • Generate and cache HTML from the license only when required, on first load.

Testing strategy:

Tested creating an NVDA installer and reading the license and opening the license from the NVDA menu.

Known issues with pull request:

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.

@coderabbitai summary

@seanbudd seanbudd requested review from a team as code owners January 8, 2025 06:15
@seanbudd seanbudd requested a review from gerald-hartig January 8, 2025 07:11
source/documentationUtils.py Outdated Show resolved Hide resolved
source/documentationUtils.py Outdated Show resolved Hide resolved
user_docs/en/userGuide.md Outdated Show resolved Hide resolved
source/documentationUtils.py Show resolved Hide resolved
@CyrilleB79
Copy link
Collaborator

Alternatively:
Why do you generate the HTML at runtime? Couldn't you generate it at build time instead given the content does not change?

@seanbudd
Copy link
Member Author

seanbudd commented Jan 8, 2025

Why do you generate the HTML at runtime? Couldn't you generate it at build time instead given the content does not change?

Simplicity really - we don't need to store or use the HTML file anywhere else unlike other documentation.

@AppVeyorBot
Copy link

See test results for failed build of commit 65aaa9bac2

copying.txt Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be renamed to LICENSE.md while add it? This ensures that GitHub will also be able to view the license. See this documentation

Copy link
Member Author

Choose a reason for hiding this comment

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

we'd have to update every copyright header to reference license.md rather than copying.txt. It doesn't seem worth breaking existing links to the file

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 think its worth doing this in a separate issue/PR



@lru_cache(maxsize=1)
def _getSanitizedHtmlLicense() -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This worries me a bit. It means that from now on, markdown and mh3 are bundled with release builds of NVDA just in case one wants to check the license. Have you considered creating the html in the build process instead? I think I'd prefer that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This worries me a bit. It means that from now on, markdown and mh3 are bundled with release builds of NVDA just in case one wants to check the license.

Could you be more specific why this is worrying? Matter of disk space? Possibilities for add-ons? other?

Have you considered creating the html in the build process instead? I think I'd prefer that.

@seanbudd has already answered to this question in #17600 (comment). Though, I have not found this answer really convincing.
@seanbudd, you invokes simplicity regarding runtime generation, but on the contrary, I feel it more complex: instead of having only one process at build time to generate all HTML files, you have now two processes: one at runtime for license and one at build time for other files.

By the way, the license html file should probably added to .gitignore, no matter if it is generated at runtime or at build time.

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 feel it more complex: instead of having only one process at build time to generate all HTML files, you have now two processes: one at runtime for license and one at build time for other files.

The two processes are very different - one is connected to our translation and documentation hosting system, the other is for rendering a file for use within NVDA. To add it to the build system there's a lot more complexity and chances for something to go wrong (e.g. bad bundling, different sanitation rules). We need to reuse other generated HTML files, but this only needs to be read at most once for most users.

By the way, the license html file should probably added to .gitignore, no matter if it is generated at runtime or at build time.

No file is generated at runtime currently

Copy link
Member Author

Choose a reason for hiding this comment

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

nh3 is already planned on being bundled in #17581

@seanbudd seanbudd marked this pull request as draft January 8, 2025 23:17
@seanbudd seanbudd marked this pull request as ready for review January 8, 2025 23:50
# Translators: The label of the license text which will be shown when NVDA installation program starts.
groupLabel = _("License Agreement")
sizer = wx.StaticBoxSizer(wx.VERTICAL, self, label=groupLabel)
Copy link
Member Author

Choose a reason for hiding this comment

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

note this had to be changed because of wxWidgets/wxWidgets#25058

user_docs/en/changes.md Outdated Show resolved Hide resolved
user_docs/en/userGuide.md Outdated Show resolved Hide resolved
@AppVeyorBot
Copy link

See test results for failed build of commit 77d2f0a914

This is a list of people and organizations that contributed to the NVDA project in various ways since the beginning of the project.
For an overview of code contributors, see also https://github.com/nvaccess/nvda/graphs/contributors.
For a list of active contributors, see the experts list https://github.com/nvaccess/nvda/blob/master/projectDocs/community/expertsList.md
This list is now archived.
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
This list is now archived.
This list was archived in 2025 and is no longer being modified,

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This list is now archived.
This list was archived in January 2025, and is no longer being maintained.

Copy link
Member

@Qchristensen Qchristensen left a comment

Choose a reason for hiding this comment

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

All looks good, and the size of the license on screen looks good for me.

Made a suggestion about noting the date of archiving the contributors file, otherwise all good.

This is a list of people and organizations that contributed to the NVDA project in various ways since the beginning of the project.
For an overview of code contributors, see also https://github.com/nvaccess/nvda/graphs/contributors.
For a list of active contributors, see the experts list https://github.com/nvaccess/nvda/blob/master/projectDocs/community/expertsList.md
This list is now archived.
Copy link
Member

Choose a reason for hiding this comment

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

Should we indicate when this list was archived? I know it's not up to date now, but saying it was archived in 2024 / 2025 may be useful for anyone looking at the file in, say 10 years time.

This is a list of people and organizations that contributed to the NVDA project in various ways since the beginning of the project.
For an overview of code contributors, see also https://github.com/nvaccess/nvda/graphs/contributors.
For a list of active contributors, see the experts list https://github.com/nvaccess/nvda/blob/master/projectDocs/community/expertsList.md
This list is now archived.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This list is now archived.
This list was archived in January 2025, and is no longer being maintained.

groupText = wx.StaticText(self, label=groupLabel)
sizer.Add(groupText, border=gui.guiHelper.SPACE_BETWEEN_ASSOCIATED_CONTROL_VERTICAL)

licenseView: wx.html2.WebView = wx.html2.WebView.New(self, size=self.scaleSize((550, 400)))
Copy link
Member

Choose a reason for hiding this comment

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

Where are these dimensions coming from?

@@ -50,6 +50,8 @@ To use this feature, "allow NVDA to control the volume of other applications" mu
* Updated CLDR to version 46.0. (#17484, @OzancanKaratas)
* Short versions of the most commonly used command line options have been added: `-d` for `--disable-addons` and `-n` for `--lang`.
Prefix matching on command line flags, e.g. using `--di` for `--disable-addons` is no longer supported. (#11644, @CyrilleB79)
* The "Contributors" file was removed from the NVDA menu. (#16922)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* The "Contributors" file was removed from the NVDA menu. (#16922)
* The "Contributors" file has been removed from the NVDA menu. (#16922)

@@ -3,7 +3,7 @@
NVDA is available under the GNU General Public License version 2, with two special exceptions.
The exceptions are outlined in the sections "Non-GPL Components in Plugins and Drivers" and "Microsoft Distributable Code".
NVDA also includes and uses components which are made available under different free and open source licenses.
Information about how to obtain and build the code for yourself is available at http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode
Information about how to obtain and build the code for yourself is available at http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode.
Copy link
Member

Choose a reason for hiding this comment

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

This link no longer works.

Suggested change
Information about how to obtain and build the code for yourself is available at http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode.
Information about how to obtain and build the code for yourself is available at <https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/contributing.md>.

@@ -3,7 +3,7 @@
NVDA is available under the GNU General Public License version 2, with two special exceptions.
The exceptions are outlined in the sections "Non-GPL Components in Plugins and Drivers" and "Microsoft Distributable Code".
NVDA also includes and uses components which are made available under different free and open source licenses.
Information about how to obtain and build the code for yourself is available at http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode
Information about how to obtain and build the code for yourself is available at http://community.nvda-project.org/wiki/AccessingAndRunningSourceCode.
All applicable licenses are included below.

## GNU GENERAL PUBLIC LICENSE
Copy link
Member

Choose a reason for hiding this comment

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

Can you please place the link to the GPL in angle brackets so it's picked up by markdown?

Comment on lines +321 to +323
* mfc*.dll
* Microsoft.VC*.manifest
* msvc*.dll
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* mfc*.dll
* Microsoft.VC*.manifest
* msvc*.dll
* `mfc*.dll`
* `Microsoft.VC*.manifest`
* `msvc*.dll`

Copy link
Member

Choose a reason for hiding this comment

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

Please update copyright header

This is a list of people and organizations that contributed to the NVDA project in various ways since the beginning of the project.
For an overview of code contributors, see also https://github.com/nvaccess/nvda/graphs/contributors.
For a list of active contributors, see the experts list https://github.com/nvaccess/nvda/blob/master/projectDocs/community/expertsList.md
This list is now archived.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move this sentence just after the first sentence of the file for clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants