-
Notifications
You must be signed in to change notification settings - Fork 160
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
Feature Request: Shortcuts categories #922
Comments
We would need to check if this is supported in various OSs... it's definitely easy to add to create the grouping, and would be backwards compatible, so no objection from me. |
Windows supports multiple custom “JumpLists” plus two predefined system-level lists “Recent” and “Frequent” (which refer to files). Documentation. iOS and Android don't seem to support it. macOS send to have multiple collections, but I'm still looking for the documentation. |
Yes, macOS does (sort of). The menus are called Dock Menus. A Dock Menu essentially is an NSMenu that can take different NSMenuItems. Those again can either be a regular item, a submenu, or a separator. With the help of separators, you could build different categories: User agents could even choose to show the category title: func applicationDockMenu(_ sender: NSApplication) -> NSMenu? {
let dockMenu = NSMenu()
dockMenu.autoenablesItems = false
dockMenu.addItem(withTitle: "Timeline", action: #selector(action), keyEquivalent: "T")
dockMenu.addItem(NSMenuItem.separator())
// Uncomment for category title
// dockMenu.addItem(withTitle: "Conversations", action: #selector(action), keyEquivalent: "C").isEnabled = false
dockMenu.addItem(withTitle: "Mentions", action: #selector(action), keyEquivalent: "M")
dockMenu.addItem(withTitle: "Direct Messages", action: #selector(action), keyEquivalent: "D")
return dockMenu
} Generally, I think this feature is super important, and developers would like to have it, so I strongly support it! However, I’m not sure if simply adding the
|
Thanks for the research @christianliebel! Super helpful. |
Awesome info, thank you @christianliebel!
My gut says that categories should be created in the order they are defined and that subsequent members of that category should be pushed into the array of category members. My initial thought is that uncategorized shortcuts should be at the top of the menu (mainly because they read better that way, in my opinion).
I think multiple identical categories (perhaps with the exception of uncategorized shortcuts) would be confusing for users. Do you have some use cases in mind as to how this might be beneficial? Real world examples of this practice would also be helpful. Implementation-wise, even in the connect of the proposed API, I don't see it being a huge headache because the shortcuts would always be written en masse, but I think use cases would still be useful as it feels more complicated from a user standpoint and from a teachability standpoint for developers. |
Perhaps category could perhaps be treated as an opaque-ID (maybe "group"?), not a something to be shown to the user. We should have category labels. |
... there is something not very "DRY" about this that's kinda bugging me. |
@aarongustafson Let’s look at this example dock menu from Apple Music: As you can see here, there are different unnamed categories. Sure, user agents could achieve the same appearance by just dropping the category title on macOS and only show it in jump lists on Windows. Again, I’m strongly supportive of the feature! Just adding the |
Windows 10 seems to take the same approach by taking a |
Another approach would be to add a second key for "shortcut_groups": [{
"id": 1
},
{
"id": 2,
"name": "Conversations"
}] Which would allow for multiple groups, both named & unnamed. Then the individual "shortcuts": [
{
"name": "Timeline",
"url": "/timeline",
"group": 1
},
{
"name": "Mentions",
"url": "/mentions",
"group": 2
},
{
"name": "Direct Messages",
"url": "/messages",
"group": 2
}
] The question I have about this is what to do with orphaned shortcuts, where the author has either intentionally or unintentionally omitted the group indicator. Perhaps to address that we could define a phantom unnamed group that is first int he groups and is only used for ungrouped shortcuts (which would also cover the existing behavior). It’s worth noting that this approach would require that the forthcoming JS API also include the ability to gather group information in order to make informed decisions about which group to assign new shortcuts to. |
For |
I now checked the situation on Linux: At least KDE and Gnome seem to have application actions which cannot be grouped: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#extra-actions
The scenarios on the different desktop platforms seem to be as follows:
So we could indeed go with a
That would make sense then. |
As with other feature requests, I'm inclined to defer this until after we get some more implementation experience - specially with the base |
@diekus is Edge still pursuing this? or can we close? |
A handful of partners have expressed an interest in being able to group shortcuts together under custom headings. For example, a social media app might want to provide shortcuts for your 5 most recent conversations under the heading "Recent Conversations". I’ve been thinking quite a bit about this as a feature and my brain had always gone down the path of thinking about these shortcuts as being nested within a larger data structure, but that would break the existing shortcuts setup and would not be as compatible with platforms that don’t support this kind of shortcut grouping. To that end I had an idea I wanted to log here: Adding an optional
category
(or similarly named) member to theShortcutItem
definition.With this new member, developers would be able to define shortcuts just as they do today, providing additional information that could be used in host browsers/OSes that support the feature, but without locking out browsers/OSes that don’t.
ShortcutItem
s that have the samecategory
would be automatically grouped together. So, for example:Might result in something like this:
Shortcuts
Conversations
The same approach could be used in the context of the forthcoming JS API too.
I’d love to hear y’all’s thoughts on this.
The text was updated successfully, but these errors were encountered: