Skip to content

Make CLI help dialog visually readable#16696

Merged
seanbudd merged 4 commits into
masterfrom
makeAppArgsReadable
Jun 17, 2024
Merged

Make CLI help dialog visually readable#16696
seanbudd merged 4 commits into
masterfrom
makeAppArgsReadable

Conversation

@seanbudd

@seanbudd seanbudd commented Jun 14, 2024

Copy link
Copy Markdown
Member

Link to issue number:

None

Summary of the issue:

When using the CLI command nvda.exe --help, a dialog window opens with visual clipping for smaller screens.
image

Description of user facing changes

Make the dialog wider and more legible.
image

Description of development approach

Created a custom formatter to widen the default dialog for CLI help.

Testing strategy:

runnvda.bat --help

Known issues with pull request:

This still will result in clipping, particulary with larger text environment. We can consider shortening the text to improve this, or making custom help on a command level (this is a complex solution).
An alternative would be to find a way to pipe the text out to the console of whatever is running --help.

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.

Summary by CodeRabbit

  • New Features

    • Introduced a custom help formatter for better readability of command-line help messages.
  • Improvements

    • Enhanced type annotations for improved code clarity and error checking.

@seanbudd seanbudd requested a review from a team as a code owner June 14, 2024 07:13
@seanbudd seanbudd requested a review from SaschaCowley June 14, 2024 07:13
@coderabbitai

coderabbitai Bot commented Jun 14, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The updates to the nvda.pyw script include modifications to import statements and type annotations for enhanced clarity and type safety. A new custom help formatter (_WideParserHelpFormatter) is introduced and employed in the NoConsoleOptionParser class to improve help message formatting. Additional type annotations are added to the print_help and error methods. A type annotation is updated for the _acquireMutex function, improving type definitions across the script.

Changes

Files Change Summary
source/nvda.pyw Introduced IO from typing, added _WideParserHelpFormatter, updated type annotations in NoConsoleOptionParser, and _acquireMutex.

Sequence Diagram(s)

No sequence diagrams are necessary, as the changes are primarily focused on type annotations and formatting without altering the control flow or introducing new features.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@seanbudd seanbudd requested a review from gerald-hartig June 14, 2024 07:14
@seanbudd seanbudd removed the request for review from SaschaCowley June 14, 2024 07:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
source/nvda.pyw (1)

Line range hint 339-369: The _acquireMutex function is robust and well-documented, ensuring proper mutex handling. Consider enhancing the logging within this function to include more detailed diagnostics, especially in error scenarios.

- _log.error(f"Unable to create mutex, last error: {createMutexResult}")
+ _log.error(f"Unable to create mutex for desktop {_desktopName}, last error: {createMutexResult}")

Comment thread source/nvda.pyw Outdated
@seanbudd seanbudd merged commit d85dae2 into master Jun 17, 2024
@seanbudd seanbudd deleted the makeAppArgsReadable branch June 17, 2024 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants