Repository: electron
Issue: [Feature Request]: Make it easier to communicate tray semantics (not just in image)
Labels: enhancement :sparkles:,a11y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

I am currently building a [StatusNotifierHost](https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/) for contexts without graphical output. This means that I cannot use the actual icon files and need to get all relevant information from other fields such as `Title`, `Status`, and `ToolTip`.

This may sound like a toy example, but I imagine that the same information is vital for accessibility.

Unfortunately I have yet to find an electron app that provides *any* useful information. For example, this is the information I get from Skype:

```json
{
    "Id": "Skype1",
    "Category": "ApplicationStatus",
    "Status": "Active",
    "IconName": "Skype1_1",
    "IconAccessibleDesc": "icon",
    "AttentionIconName": "",
    "AttentionAccessibleDesc": "",
    "Title": "skypeforlinux",
    "IconThemePath": "/tmp/.org.chromium.Chromium.Roc3Gg",
    "Menu": "/org/ayatana/NotificationItem/Skype1/Menu",
    "XAyatanaLabel": "",
    "XAyatanaLabelGuide": "",
    "XAyatanaOrderingIndex": 0
}
```

This information stays always the same. Only the `IconName` is incremented each time the icon changes (`Skype1_2`, `Skype1_3`, …). There is a lot of things I would like to see here:

- `Status` should change to `NeedsAttention` when there are new messages.
- `IconAccessibleDesc` and `AttentionAccessibleDesc` should have meaningful content.
- `Title` should be more human, not just the name of the binary.
- `ToolTip` should be included with meaningful content.
- `IconName` should use predictable names (e.g. the same name for the same icon across runs).

### Proposed Solution

As far as i Understand from the [docs](https://www.electronjs.org/docs/latest/api/tray), at least some of these values could be filled from available information (`setTitle()`, `setToolTip()`). These should definitely be mapped to the corresponding StatusNotifierItem fields.

If that is already the case this means that most developers don't bother to provide a title or tooltip. That could be tackled either by adding notes about accessibility to the documentation (example: [bootstrap icons](https://icons.getbootstrap.com/#accessibility)) or by forcing developers to provide an accessible description along with the icon image (like the `alt` attribute in HTML).

Furthermore, it would be great to allow developers to express a machine readable status which maps to `org.freedesktop.StatusNotifierItem.Status`. I am not sure how to do that in a cross-platform way though.

### Alternatives Considered

I have experimented with computing a hash over the actual icon files and then keep a database on my end that maps these hashes to semantic information. This has some major downsides:

- It is a lot of work.
- It does not fix the accessibility issue for most users.
- Icon files sometimes change on updates, so the database breaks regularly.

### Additional Information

_No response_