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

Add buttons to alert on shortcut taken by system to allow user to use it anyway #125

Closed
wants to merge 1 commit into from

Conversation

sohocoke
Copy link

Fixes issue #33 (assuming it didn't cover the 'used by menu item' case)

@romadryud
Copy link

@sindresorhus Could you please merge this one?

for: self.window,
title: "keyboard_shortcut_used_by_system".localized,
// TODO: Add button to offer to open the relevant system settings pane for the user.
message: "keyboard_shortcuts_can_be_changed".localized
message: "keyboard_shortcuts_can_be_changed".localized,
buttonTitles: [
Copy link
Owner

Choose a reason for hiding this comment

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

The first item should be OK, the second item should be Use Anyway, since the default choice should be OK.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @sindresorhus, I'm a great fan of your work. Using many of the projects you released for the apps I'm working on – thanks.

I had a quick look at the Apple HIG on this, and this example on alerts is the closest I could get to.
Screenshot 2023-04-04 at 22 23 22

So things boil down to what the primary choice would be in this situation.

My rationale for the order of the buttons, which I think fits with what's outlined in the HIG, is: a 'cancel' action at the left (or bottom now?) for the user to go back and re-take an action, or a 'go ahead' action at the right (or top?) for her to proceed with the choice, having digested the message in the dialog. I.e. 'go ahead' should be the primary action.

So I think that, even if the action were to be interpreted as strongly inadvisable, the button to go ahead should be the first one. Else, the default choice would be to cancel the action, which I can't remember to be the order of choices in alerts I've seen.

I'm happy to be proven wrong with any example alert available in a recent version of macOS though!

Copy link
Owner

Choose a reason for hiding this comment

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

In this case, the primary button should be "OK." The primary button should represent the default, recommended, or most likely action that users would take. Since "Use Anyway" is not recommended, it should not be the primary button. Making "OK" the primary button will help guide users towards the safer and more desirable action. This follows user interface design best practices, which prioritize guiding users to make the right decisions and avoid potential issues.

This one is closer to ours:

Screen Shot 2018-10-10 at 09

@sindresorhus
Copy link
Owner

You also need to fix the lint warning.

@sohocoke
Copy link
Author

sohocoke commented Apr 4, 2023

Let me know where I can see these lint errors and I'd be happy to fix them.

@@ -3,3 +3,4 @@
"keyboard_shortcut_used_by_menu_item" = "This keyboard shortcut cannot be used as it’s already used by the “%@” menu item.";
"keyboard_shortcut_used_by_system" = "This keyboard shortcut cannot be used as it’s already a system-wide keyboard shortcut.";
"keyboard_shortcuts_can_be_changed" = "Most system-wide keyboard shortcuts can be changed in “System Settings › Keyboard › Keyboard Shortcuts”.";
"force_use_shortcut" = "Use Anyway";
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
"force_use_shortcut" = "Use Anyway";
"force_use_shortcut" = "Use Anyway";

@sindresorhus
Copy link
Owner

Bump

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.

None yet

3 participants