Skip to content

Hide non-display roles in chat, and fix live role updates - #1652

Merged
SpikeViper merged 1 commit into
version/0.8.0from
fix/hide-non-display-role-in-chat
Aug 20, 2026
Merged

SpikeViper merged 1 commit into
version/0.8.0from
fix/hide-non-display-role-in-chat

Conversation

@SkyJoshua

Copy link
Copy Markdown
Contributor

Summary

Closes #1479. Rather than adding a new setting, this reuses the existing "Display Role" permission that role admins can already toggle per role. The chat window's role tag next to a username was pulling from a member's raw highest-authority role, completely ignoring that permission — so a separator/organizational role with Display Role turned off would still show up beside people's names in chat, even though it's already correctly hidden in the member list.

While tracking this down, found and fixed two related realtime gaps in the same area: editing a role's own permissions or color (e.g. toggling Display Role) didn't update anyone already looking at a member with that role until a full client reload, and giving or removing someone's role didn't move them between member list sections either — both now update instantly.

Changes

  • GetAuthorRoleTag() / GetAuthorColor() in MessageComponent.razor now go through a GetChatDisplayedRole() helper that skips roles without the Display Role permission, same as the member list already does, falling back to the default (@everyone) role so chat always shows something
  • UserInfoComponent.razor and MessageComponent.razor both now subscribe to role updates (Planet.Roles.Changed) and recompute a member's shown color/tag live when a role they hold has its permissions or color edited
  • MemberListComponent.razor had a DetermineDisplayedRole(member) method that already did the work of moving a member between role sections, but nothing ever called it — the handler for a member's role change was a literal // TODO stub. Wired it up so gaining/losing a role now re-buckets the member list live instead of requiring a rejoin

Test plan

  • A role with Display Role disabled no longer shows next to a member's name in chat
  • A member with only a hidden role still shows the default role's name/color in chat, not blank or "Unknown Role"
  • Giving or removing a role from a member moves them between member list sections live, without leaving and rejoining the planet
  • Member list role grouping for someone with no displayable role is unaffected (still no group, sits under Online)

The role tag next to a name in chat wasn't checking the Display Role
permission at all, so separator/organizational roles showed up there even
though they're already hidden everywhere else. Chat still falls back to the
default role so there's always something to show.

While in there, fixed two related realtime gaps: editing a role's own
permissions/color didn't update anyone already looking at a member with
that role (member list or chat) until a full reload, and giving/removing
someone a role didn't move them between member list sections either - both
now update live.
@SkyJoshua
SkyJoshua requested a review from a team as a code owner August 2, 2026 03:43
@SpikeViper
SpikeViper merged commit e097c43 into version/0.8.0 Aug 20, 2026
2 checks passed
@SpikeViper
SpikeViper deleted the fix/hide-non-display-role-in-chat branch August 20, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📦 Feature - Option to Hide Top Role Beside Name if Not a Display Role

3 participants