[w3c/manifest] Feature Request: Shortcuts categories (#922)

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 the `ShortcutItem` 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 same `category` would be automatically grouped together. So, for example:

```json
{
  "shortcuts": [
    {
      "name": "Timeline",
      "url": "/timeline"
    },
    {
      "name": "Mentions",
      "url": "/mentions",
      "category": "Conversations"
    },
    {
      "name": "Direct Messages",
      "url": "/messages",
      "category": "Conversations"
    }
  ]
}
```

Might result in something like this:


### Shortcuts

* [Timeline](#)

### Conversations

* [Mentions](#)
* [Direct Messages](#)


The same approach could be used in the context of [the forthcoming JS API](https://github.com/rayankans/app-shortcuts) too.

I’d love to hear y’all’s thoughts on this.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/922

Received on Thursday, 16 July 2020 00:00:09 UTC