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

Rich command: Context + Restore #11472

Merged
merged 11 commits into from
Feb 27, 2023
Merged

Conversation

cinqmilleans
Copy link
Contributor

@cinqmilleans cinqmilleans commented Feb 26, 2023

Resolved / Related Issues
This pr adds the first and main context used by actions. A context is an observable service that easily provides actions with properties that are difficult to know. To observe properties of the current page, you must notify the properties when it changes or when a parent or ancestor object changes.

  • Added ContentPageContext. The data is always from the current page. Selected items are easily notified (whether it's a selection or a page change).
  • Added RestoreRecycleBin and RestoreAllRecycleBin commands.
  • Improved EmptyRecycleBin with context.

Validation
How did you test these changes?

  • Built and ran the app
  • Tested the changes for accessibility

@QuaintMako QuaintMako mentioned this pull request Feb 26, 2023
78 tasks
@yaira2 yaira2 requested review from d2dyno1 and QuaintMako February 27, 2023 15:18
@cinqmilleans
Copy link
Contributor Author

I updated to resolve an incompatibility with the latest commits. This forced me to integrate the management of OpacityIcon

  • RichGlyph can be of type OpacityIcon
  • ColoredIcon is removed.
  • Restore(All) uses OpacityIcon.
  • Added ContextMenuFlyoutItemViewModelBuilder. This new class avoids having to read the properties of the command when it is not displayed in the menu, to improve performance.

When all the commands have been converted, it will be possible to replace ContextMenuFlyoutItemViewModel with an interface and 3 implementations to improve code and performance.

Known bug: In the context menu, the Restore entry of a RecycleBin item has no icon. However, the element does have an OpacityIcon content. I don't think the bug is related to this code.

@yaira2
Copy link
Member

yaira2 commented Feb 27, 2023

Known bug: In the context menu, the Restore entry of a RecycleBin item has no icon. However, the element does have an OpacityIcon content. I don't think the bug is related to this code.

I noticed this as well, I think we can leave as is for now (same issue in main)

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Feb 27, 2023
@yaira2 yaira2 merged commit 70b9065 into files-community:main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants