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

Another approach would be to add a second key for `shortcut_groups` that could define the groups (and order), along the lines of

```json
"shortcut_groups": [{
  "id": 1
},
{
  "id": 2,
  "name": "Conversations"
}]
```

Which would allow for multiple groups, both named & unnamed. Then the individual `ShortcutItems` could reference the group by its `id`:

```json
"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.

-- 
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#issuecomment-661191091

Received on Monday, 20 July 2020 17:01:10 UTC