Skip to content

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 as a browseable message, generated from markdown.
  • From the installer, there is now a button to open the license as a message, rather than a direct embedded panel
  • 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

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
@CyrilleB79
Copy link
Contributor

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

Co-authored-by: Cyrille Bougot <cyrille.bougot2@laposte.net>
@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

@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
@AppVeyorBot
Copy link

See test results for failed build of commit 77d2f0a914

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.

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jan 13, 2025
@seanbudd seanbudd marked this pull request as draft January 14, 2025 02:50
@seanbudd seanbudd marked this pull request as ready for review January 14, 2025 02:58
@LeonarddeR
Copy link
Collaborator

@coderabbitai could you create an issue to investigate renaming copying.txt to LICENSE.md in order for GitHub to pick up the license?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2025

Tip

For best results, initiate chat on the files or code changes.

@LeonarddeR I've created issue #17621 to track the investigation of renaming copying.txt to LICENSE.md for better GitHub license detection.

🔗 Analysis chain

@LeonarddeR I've created a new issue to track the investigation of renaming copying.txt to LICENSE.md for better GitHub license detection.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find the license file location
fd -t f -i copying.txt

# Check if LICENSE.md already exists to avoid potential conflicts
fd -t f -i license.md

Length of output: 60


Script:

#!/bin/bash
gh issue create \
  --title "Investigate renaming copying.txt to LICENSE.md for GitHub license detection" \
  --body "Currently, the NVDA license is stored in copying.txt. GitHub has built-in license detection that automatically identifies repository licenses when they follow common naming patterns like LICENSE.md.

Consider renaming copying.txt to LICENSE.md to:
- Improve repository license visibility on GitHub
- Follow modern open source conventions
- Make the license more discoverable for new contributors

Related PR: #17600 where license file handling was updated.

Note: This change requires careful consideration of:
- Impact on existing documentation/scripts that might reference copying.txt
- Migration plan for existing installations
- Update of any hardcoded references to the file name"

Length of output: 843

@SaschaCowley
Copy link
Member

@seanbudd if I build a launcher from this branch, the HTML view containing the licence is not accessible unless I click on it.

Speech viewer output
NVDA Launcher  dialog  License Agreement
wxWebView
tab
I have read and agree to the license agreement  check box  not checked  Alt+  a
tab
Exit  button  Alt+  x
tab
wxWebView
down arrow
I have read and agree to the license agreement  check box  not checked  Alt+  a
up arrow
wxWebView
down arrow
I have read and agree to the license agreement  check box  not checked  Alt+  a
up arrow
wxWebView
NVDA+shift+m
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 https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/contributing.md. All applicable licenses are included below.
NVDA+[
Left click
document
heading    level 1  NVDA License
down arrow
NVDA is available under the GNU General Public License version 2, with two special exceptions. The 
tab
https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/contributing.md  link  
tab
https://www.gnu.org/licenses/old-licenses/gpl-2.0.html/  link  
tab
https://fsf.org/  link  
tab
https://github.com/nvaccess/nvda-misc-deps/  link  
tab
I have read and agree to the license agreement  check box  not checked  Alt+  a
up arrow
document
link    https://github.com/nvaccess/nvda-misc-deps/
up arrow
the following URL:
down arrow
link    https://github.com/nvaccess/nvda-misc-deps/
down arrow
link    https://github.com/nvaccess/nvda-misc-deps/
tab
https://github.com/nvaccess/nvda/blob/master/projectDocs/dev/contributing.md  link  
tab
https://www.gnu.org/licenses/old-licenses/gpl-2.0.html/  link  
ctrl+end
link    https://github.com/nvaccess/nvda-misc-deps/
https://fsf.org/  link  
https://github.com/nvaccess/nvda-misc-deps/  link  
tab
https://fsf.org/  link  
tab
https://github.com/nvaccess/nvda-misc-deps/  link  
tab
I have read and agree to the license agreement  check box  not checked  Alt+  a
tab
Exit  button  Alt+  x

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.

@seanbudd
Copy link
Member Author

@SaschaCowley - I've reverted 0215d3f, we no longer use the webview anymore, instead the browseable message popup window

@SaschaCowley
Copy link
Member

I don't particularly like this solution, but I can't work out anything better. A subclass of wx.html2.WebView that returns False from AcceptsFocus but True from AcceptsFocusRecursively solves some of the problems, but:

  • Bringing up the launcher now reports:

    NVDA Launcher  dialog  License Agreement
    data:text/html;charset=utf-8;base64,PGgxPk5WREEgTGljZW5zZTwvaDE+CjxwPk5WREEgaXMgYXZhaWxhYmxlIHVuZGVyIHRoZSBHTlUgR2Vu[...]HM6Ly9naXRodWIuY29tL252YWNjZXNzL252ZGEtbWlzYy1kZXBzLzwvYT48L3A+ - Web content  region
    NVDA License
    NVDA is available under the GNU General Public License   version 2, 
    
  • Tabbing in the dialog is still unpredictable, as if on the "I agree" checkbox, shift+tab takes you back to the document, but focuses the document root, so tab lands you on the first link, not back on the checkbox as it should.

Changing the backend to IE makes things no better.

I thought of using a richtext control, but I'm not sure how we'd get the content into it (as far as I can tell they don't accept a standard format); and I'm not sure if there's a way to activate links in a richtext control from the keyboard.

@seanbudd seanbudd merged commit f3b01c3 into master Feb 5, 2025
5 checks passed
@seanbudd seanbudd deleted the remContributorsHTMLLicense branch February 5, 2025 22:38
@github-actions github-actions bot added this to the 2025.1 milestone Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Again Contributors and license files do not open Document the process for adding to the contributors.txt list

7 participants