Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions rfcs/rfc-0015-roleicons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
- Feature Name: Role Icons
- Start Date: 02/04/2025
- Linked to: https://github.com/revoltchat/backend/pull/401
- Tracking Issue: N/A
- Status: draft

# Summary
<!-- One paragraph overview of the feature -->
This RFC proposes the addition of role icons to Revolt, allowing users to assign custom icons to roles within their servers.

# Motivation
<!-- Why is this RFC being made, what does it achieve or solve, what is the expected outcome -->
Some people may want to use role icons to allow users to easily identify roles. For example, a server may have a role for moderators with the colour blue, and a bots role with a similar colour.
By adding a role icon, users can easily identify the moderator or bot role by the icon, even if the colours are similar.

This is not the only use case; some users may want to use role icons purely for aesthetic reasons, or to make their server look cooler.

# Guide-level explanation
<!--
Explain the proposal as if it's already in Revolt and you were teaching it to new users.
- Introduce new concepts
- Explain the feature with examples
- What this fixes or adds and what users should think of the feature
- Discuss how this impacts using Revolt, how it makes it harder or easier to use

For internal oriented RFCs such as internal code changes, this should largely talk about how contributors should think about the change and give examples on the impacts.
-->

Most of this has been said in the Motivation section.
- Some examples I can think of:
- A server containing roles with similar colours, but different icons, can allow for easy identification of roles in chat.
- To make a certain section of roles feel more 'powerful' (such as Moderator, Admin, etc.), but having other roles just have colours for instance, levelling roles (Level 1, Level 5, etc.)
- What users should think of the feature
- Providing the example above, definitely quite helpful to some, but also just nice to have.

# Reference-level explanation
<!--
This is the technical section of the RFC, it should go over in detail:
- Its interaction with other features
- How this will be implemented
- Corner or edge cases

This section should reference the examples in the previous section and disect them in more detail.
-->

- Clients should allow users to upload an icon for a role. They should also be able to remove the icon.
- The icon should be displayed in the role list on member profiles, and in the member list (next to the user's name).
- The icon should also be displayed in chat, next to the user's name.

The icon that is displayed next to a member's name should be the highest role assigned to the user, that has an icon.

## PATCH - `/servers/[serverid]/roles/[roleid]`
To add an icon to a role, this should be present in the body:
- `icon` - An Autumn file ID (uploaded to the `icons` endpoint of Autumn)
To remove an icon from a role, this should be present in the body:
- `remove` (array of strings) - Just like a server icon, you can supply `remove: ["Icon"]` to remove the icon from the role. Keep in mind the captial `I` in `Icon`.

Example request for adding icon:
```json
{
"id":"01JP27A2CNBAAB2MAZL9R2XPTZ",
"name":"my cool role - updated name",
"rank":1,
"colour":"#ff7800",
"icon": "d7Ni7IYclpySW6aIB3K_DNzS4KQy4nxcgIPXxlqH5k"
}
```

Example request for removing icon:
```json
{
"id":"01JP27A2CNBAAB2MAZL9R2XPTZ",
"name":"my cool role - updated name again because cool",
"rank":1,
"colour":"#ff7800",
"remove": ["Icon"]
}
```

# Drawbacks
I do not see any drawbacks to this feature.

# Rationale and alternatives
<!--
- Why is this design the best
- Are there alternative ways to solve this
- Could this be done with existing features or existing solutions
-->

Other platforms, like Discord, have the exact same design (which is what I am basing this off of), therefore I see no issues.

# Prior art
<!-- This should include both good and bad outlooks on the proposal. This could include how other platforms, software and hardware solve similar issues if relevent or how any existing proposals have tried to solve the same problem. -->
- Discord has this feature, where you can upload an icon for a role. As said above, this is what I am basing this off of.

# Unresolved questions
<!--
- Are there any parts which are not yet designed or you believe need further discussion?
- Do you expect any part of this proposal to change?
- Are there any related issues which you believe are out of the scope of this RFC that could be addressed in a seperate RFC?
-->

- Should there be an option to change how role icons are displayed? (e.g. in chat & member list, member list only, chat only, none)
- Should GIFs be allowed? If so, there should be an option to choose how it plays (e.g. always, when hovered over, never) for accessibility/reduced motion.

# Security concerns
<!-- How does this RFC impact security - This section might not always be applicable and if you believe it is not, please write your reasoning in this section. -->
This RFC does not impact security, primarily because it uses functions copied from existing code (just slightly modified to work, of course).

# Future ideas
No future ideas. :)