pika
pika copied to clipboard
App hiding behaviour violates Apple Human Interface Guidelines for keyboard inputs
Describe the bug
Firstly, this is a great app. It's pretty, and works nicely. Thanks for making this app! 💖
I am reporting 2 app hiding-related concerns with regards to Pika:
- native Cmd+H functionality should work to hide Pika
- when another application is foregrounded, Pika should not sit on top of all applications
1 - Cmd+H functionality should work to hide Pika
Natively on macOS, users expect to be able to press Cmd+H to hide an application. When pressing Cmd+H to try to hide Pika, it makes a noise and won't close.
This is the clause in the Human Interface Guidelines explaining such:
Respect standard keyboard shortcuts. People expect the standard keyboard shortcuts to work, regardless of the app they’re using. You can also help people learn your app quickly by supporting the system-defined keyboard shortcuts that make sense in your app.
You can read the keyboard guidelines here: https://developer.apple.com/design/human-interface-guidelines/inputs/keyboards
2 - Pika should not sit on top of all applications
It also sits on top of everything, which is not how users expect a native macOS app to behave. Consider making this currently default behaviour an option users can opt out of.
An exception to this could be while colour picking so that the user can see the colours after picking. It's perfectly reasonable to sit on top while the colour picker is active so that it is not dismissed upon selecting a colour.
To Reproduce
Steps to reproduce the behavior:
- Open Pika
- Press Cmd+H
- Notice how it won't dismiss
- Choose another app
- Notice how Pika sits on top of everything
Expected behavior
- When pressing Cmd+H, I would expect Pika to hide
- When focusing another application window, I would expect Pika to not be sitting on top of everything
While a user could modify their behaviour and press Cmd+W to close the app, it's not the default behaviour users use when they want to switch between apps (back and forth to/from Pika and other apps). Users tend to use Cmd+H to hide the current app, or Cmd+Tab to switch to another app (and maybe back to Pika, but this currently isn't possible).
Screenshots
Section of the Human Interface Guidelines documentation Best Practices section.

In the below screenshot, I am focused on Brave but Pika sits on top of Brave after switching to it.

In the below video, I cannot press Cmd+H and hear an error sound (enable sound).
https://user-images.githubusercontent.com/88961088/185517924-e0afd47e-eee5-44e5-8b2c-16f1d932835e.mov
Environment (please complete the following information):
- OS: macOS 12.5 Monterey
- App Version: 0.0.12 (Build 23)
- Architecture: Intel
Additional context
You may want to consider allowing people to switch to/from Pika using Cmd+Tab when cycling between windows, and allowing it to show/hide like other apps. This is the default behaviour macOS users have come to expect for all apps.
You may want to look at a similar app to yours, ColorSlurp, which allows cycling with Cmd+Tab, can be hidden with Cmd+H, and also has a menu bar icon. It is similar in features.
Again, thanks for such a cool app! Let me know if you need any further information.
Hey @techygrrrl. Thanks for taking the time to write this up, and providing references and videos.
The reason for these is that Pika is a menu bar only application, and its primary window is a floating one:
window.level = .floating
The other windows (preferences, about) aren't floating—they behave like standard macOS windows. This was initially to make it easier to access Pika when other windows are open. Pika uses [NSColorSampler](https://developer.apple.com/documentation/appkit/nscolorsampler)
under the hood, which isn't at all customisable (and it would be awesome if it was), so that was an influence in that decision.
On enabling command + tab, Pika is currently a menu bar application, so as you say, it doesn't appear in the tab bar or in the dock. I'd be curious how much interest there would be in Pika being a non-menu bar app by default. I can leave this issue open to see if others feel similarly.
And as you also mention above, one solution would be to add an option to the preferences panel to toggle the floating property (and potentially toggle having Pika appear in the tab bar and in the dock). That way, if someone prefers to have Pika sit above other applications / be tabbable, they can. 🤔 I'd be super happy to review a PR of this if someone wants to take a pass at it, or I can add it to the roadmap for future.
Lastly, ColorSlurp is a great option for a fuller featured colour picker app, and I'd definitely recommend people check it out if it better suits their needs.
As a workaround in the meantime, you can also use a global shortcut to toggle the whole app.
With the release of v0.0.13, I've started noodling on this one in this branch: https://github.com/superhighfives/pika/tree/standard-app
So, currently there are three options. Should the app:
- Display in the dock / be tabbable? (app in dock)
- Display in the menu bar? (app in menu bar)
- Float above other windows? (app floating)
The current default for 1 is no, and for 2 and 3 is yes. Thinking about releasing a beta with these options (with better names), getting feedback on preferred / sensible defaults, and going from there, but keen to get any thoughts in this issue in the meantime.
It's worth noting that changing these requires a restart of the app. I would need to better document that in the preferences.
Alrighty, I have a beta that allows you to choose between Pika as a menubar app and Pika as a standard app, @techygrrrl. It also doesn't require a restart of the app to apply, and is now available in Preferences. You can also opt out of Pika floating above other windows.
https://github.com/superhighfives/pika/releases/tag/0.0.14-beta1
You can either download it above, or run "Check for updates..." in Pika with "Subscribe to beta releases" enabled in the Preferences.
Thanks @superhighfives for this! I downloaded it and am trying it out and it's working perfectly so far! I've chosen Dock mode and it behaves as expected. Thanks for building this, it's awesome! 🚀 🌈
Aww, cheers! This has now been released with 0.0.14
, so going to close this one. Thanks for flagging. 👍