FireCubeStudios / Protecc

It protecc
https://apps.microsoft.com/store/detail/protecc-2fa-client/9PJX91M06TZS
MIT License
360 stars 43 forks source link

Feature: Copy code to clipboard by double clicking AccountControl #41

Closed DmitryGolubenkov closed 2 years ago

DmitryGolubenkov commented 2 years ago

Description

Solves issue #39. User can double click any part of AccountControl to copy code to clipboard. A Windows notification will be shown that informs user if the operation was successful or if an error occurred.

Changes

FireCubeStudios commented 2 years ago

I see. Interesting use of notifications for notifying it was copied. I am not sure if system wide notifications should be used and instead another notifier can be used like an in app notification or changing the copy icon to a checkmark like the current implementation

DmitryGolubenkov commented 2 years ago

I don't know if changing copy icon to checkmark would be a good implementation in this case as we don't click the button itself, but I might be wrong. Still, its very easy to implement (just copy paste from button handler).

I agree that system-wide notifications can be cumbersome: for example, screenshot app that I use always sends a Windows notification that sometimes stays in Action center for weeks. I've just found a way to remove the notification manually after it goes to Action center. That could be another solution to this problem. But such notification will be shown for 7 seconds before it gets hidden by OS. This is one of two avaliable duration values (and the second is 25 seconds..).

In-app notifications are harder to implement, as there is no native support for them in UWP.. Anyway, I've implemented them using Community Toolkit: image They disappear after 3 seconds, and the duration in configurable.

I think in-app notification should be used. And the notification component itself could be then used in other parts of application if they ever need to

DmitryGolubenkov commented 2 years ago
FireCubeStudios commented 2 years ago

Can the in app notification show also when the copy button is used? I think that would be good

DmitryGolubenkov commented 2 years ago

Done!

FireCubeStudios commented 2 years ago

Looking good! I will update the in app notification stylings to follow GlowUI. Thanks for implementing this feature well! I will merge the pr now