Skip to content

Add-on store sort by new#17091

Merged
seanbudd merged 37 commits into
nvaccess:masterfrom
nvdaes:addonsDate
Sep 17, 2024
Merged

Add-on store sort by new#17091
seanbudd merged 37 commits into
nvaccess:masterfrom
nvdaes:addonsDate

Conversation

@nvdaes

@nvdaes nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator

Add ability to view new add-ons

Link to issue number:

Fixes #16681

Summary of the issue:

NVDA should have the ability to present new add-ons first.

Description of user facing changes

  • The add-on list can have a new column with the publication date of add-ons.
  • The publication date can be shown in the add-ons details panel.
  • Add-ons can be sorted by date (from more recent to older and from older to recent), using the sort by column feature.

Description of development approach

  • Functions have been changed in add-on store gui, and propertys have been added in addon.py module of the addonStore.

Testing strategy:

Tested manually, adding a submissionTime key to the json file of various installed add-ons.

Known issues with pull request:

None

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

Summary by CodeRabbit

  • New Features

    • Added a submission time attribute for add-ons to improve tracking and management.
    • Introduced a publication date property for better usability in displaying add-on information.
    • Added a combo box in settings to allow users to configure the order of add-ons displayed in the store.
  • Improvements

    • Enhanced sorting functionality for add-ons based on user-defined preferences.
    • Updated user guide to include new sorting options for better user understanding.
    • Provided clear instructions for sorting options and metadata management in the add-on store documentation.

@nvdaes nvdaes marked this pull request as ready for review September 1, 2024 08:57
@nvdaes nvdaes requested review from a team as code owners September 1, 2024 08:57
@coderabbitai

coderabbitai Bot commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The changes introduce enhancements to the add-on store, including a new attribute for tracking submission times of add-ons, a sorting configuration option, and a user interface update for displaying publication dates. Additionally, a settings dialog feature allows users to select the order of add-ons displayed, improving customization and usability.

Changes

Files Change Summary
source/addonStore/models/addon.py Added submissionTime attribute and publicationDate property to models; updated data creation functions.
source/config/configFlags.py Introduced AddonListOrder class for sorting options with localized display strings.
source/config/configSpec.py Added addonListOrder configuration option for user-defined sorting of add-ons.
source/gui/addonStoreGui/controls/details.py Updated UI to display publication date if available.
source/gui/addonStoreGui/viewModels/addonList.py Enhanced sorting logic in AddonListField based on configuration settings.
source/gui/settingsDialogs.py Added combo box in settings dialog for selecting add-on list order, saving user preferences.
user_docs/en/changes.md Documented new combo box feature for configuring add-on list order in settings.
user_docs/en/userGuide.md Added section on add-on list ordering options in user guide.

Assessment against linked issues

Objective Addressed Explanation
Notify users about new add-ons (16681) The changes do not implement a notification system for new add-ons.

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>, please review it.
    -- 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 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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.
Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI o1 for code reviews: OpenAI's new o1 model is being tested for code reviews. This model has advanced reasoning capabilities and can provide more detailed feedback on your code.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, I have changed the issue title addressing your comment.

@coderabbitai

coderabbitai Bot commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

@nvdaes, thank you for updating the issue title! I appreciate your responsiveness.

Actions performed

Comments resolved.

@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, can you suggest how to document manual testing for this?

@coderabbitai

coderabbitai Bot commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

@nvdaes, to document manual testing for the changes introduced in this PR, you can follow these steps:

1. Verify the New Combo Box in Add-on Store Settings:

  • Step 1: Open the NVDA Add-on Store settings panel.
  • Step 2: Locate the new combo box for selecting the add-on list order.
  • Step 3: Ensure that the combo box is populated with the three sorting options: "Recent add-ons first," "Older add-ons first," and "Alphabetical."
  • Step 4: Select each option and save the settings.
  • Step 5: Reopen the settings panel to verify that the selected option persists.

2. Test the Sorting Behavior:

  • Step 1: With the "Recent add-ons first" option selected, navigate to the add-on store and verify that add-ons are sorted by their publication date, with the most recent add-ons appearing at the top.
  • Step 2: Change the sorting option to "Older add-ons first" and verify that the add-ons are now sorted with the oldest add-ons at the top.
  • Step 3: Select the "Alphabetical" option and verify that the add-ons are sorted alphabetically by their names.

3. Verify the Display of Publication Dates:

  • Step 1: In the add-on store, select an add-on and open its details panel.
  • Step 2: Ensure that the publication date is displayed correctly if the submissionTime is available.
  • Step 3: Verify that the publication date is formatted correctly and is localized according to the user's language settings.
  • Step 4: Check that add-ons without a submissionTime do not display a publication date, and ensure that this does not cause any UI issues.

4. Edge Cases and Error Handling:

  • Step 1: Test the behavior when an add-on does not have a submissionTime. Ensure that the add-on is still listed and that the absence of a publication date does not affect the sorting or display.
  • Step 2: Verify that the sorting options work correctly even when multiple add-ons lack a submissionTime.
  • Step 3: Test the behavior when switching between sorting options rapidly to ensure that the UI updates correctly without any lag or errors.

5. Documenting the Results:

  • Step 1: Record the results of each test, noting any discrepancies or issues encountered.
  • Step 2: If any issues are found, document the steps to reproduce them and any potential workarounds.
  • Step 3: Include screenshots or screen recordings where applicable to provide visual confirmation of the test results.

By following these steps, you can ensure that the new features are thoroughly tested and that the documentation provides a clear record of the manual testing process.

Let me know if you need further assistance or if there are specific areas you'd like to focus on!

Actions performed

Comments resolved.

@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, I'm a blind person and I'd like to know if the size for the publication date column (50) is wider enough.

@coderabbitai

coderabbitai Bot commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

Tip

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

@nvdaes, it appears that there isn't an explicit width setting for the publication date column in the codebase, or it might be set dynamically. Given this, it's challenging to determine if a width of 50 is sufficient without further context.

To ensure that the publication date is fully visible, I recommend considering a slightly wider column, such as 60 or 70, to accommodate different date formats and potential localization variations. This conservative approach should help avoid any truncation of the date information.

Let me know if you'd like further assistance or if you have any specific preferences!

Analysis chain
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the implementation of the publication date column in the codebase.
rg --context 5 'publicationDate' | grep -i 'column\|width'

Length of output: 320


Script:

#!/bin/bash
# Search for the width or size settings related to the publication date column.
rg --context 5 'width\|size' | grep -i 'publicationDate\|column'

Length of output: 66

@nvdaes nvdaes marked this pull request as draft September 1, 2024 09:24
@nvdaes nvdaes marked this pull request as ready for review September 1, 2024 18:42
@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, do you think that this maybe improved in some way?

@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: 0

Outside diff range, codebase verification and nitpick comments (1)
tests/manual/addonStore.md (1)

41-48: Excellent addition of the "Sorting the add-ons list" section!

The new section provides clear and concise instructions on how to sort the add-ons list in the add-on store. The mention of the publication date being displayed in the add-on list and details panel is helpful for users to understand how the sorting works. The instructions on manually adding a publication date to an add-on are useful for testing and debugging purposes, and the example JSON snippet is formatted correctly.

Please consider fixing the following grammar issue:

1. Open the store and check that add-ons are sorted according to your chosen option. If an add-on has a publication date, it will be shown in the add-on list and in the details panel. This can be used to check  that add-ons have been sorted from recent to older, or from older to recent.
Tools
LanguageTool

[grammar] ~44-~44: Did you mean: “according to”? according to: (as stated/in the opinion of)
Context: ...store and check that add-ons are sorted according with your chosen option. If an add-on has a ...

(ACCORDING_TO)

@nvdaes

nvdaes commented Sep 1, 2024

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, I've fixed the grammar issue. Anything else that I can do?

@coderabbitai

coderabbitai Bot commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

@nvdaes, thank you for fixing the grammar issue! After reviewing the changes, everything looks good, and I don't see any further issues that need to be addressed. Great job on this PR! 🎉

Actions performed

Comments resolved.

Comment thread user_docs/en/changes.md Outdated
Comment thread source/addonStore/models/addon.py Outdated
Comment thread source/addonStore/models/addon.py Outdated
Comment thread source/addonStore/models/addon.py Outdated
Comment thread source/config/configSpec.py Outdated
@seanbudd

seanbudd commented Sep 2, 2024

Copy link
Copy Markdown
Member

In contrast, the publication date can be formatted, but sorting items by publication date can produce different results, which may not match timestamp order.
From #16681 (comment)

@nvdaes - you should be able to solve this problem by creating a custom wx.ListCtrl subclass using:

  • SortItems to create a custom sort function
  • GetSortIndicator to get the current column index for SortItems
  • SetItemData to set the date used for sorting
  • ShowSortIndicator to make this indicator more obvious

@nvdaes

nvdaes commented Sep 6, 2024

Copy link
Copy Markdown
Collaborator Author

@CyrilleB79 , thanks for your reply. Seems that I have fixed the mentioned issue where the date header wasn't shown, though I don't know if my approach is visually correct.
But at least this will be useful for completing the work and then a visual person may provide more advice.
I'll explain how to sort add-ons by columns in the user guide, as requested by @seanbudd , and my explanation will be based on your comment about this.

@nvdaes nvdaes marked this pull request as ready for review September 17, 2024 21:02

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

Looks good to me, including the new column widths. Thanks for your work @nvdaes

Comment thread user_docs/en/changes.md Outdated
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.

Add ability to view new available add-ons

3 participants