From 51cc8562329b65df60c03e71caed93def8e0d1e6 Mon Sep 17 00:00:00 2001
From: Luca <45944543+AfoxDesignz@users.noreply.github.com>
Date: Sat, 18 Jul 2026 19:08:19 +0200
Subject: [PATCH] fix(sric): add compact mode support (#1263)
* fix(sric): add compact mode support
* fix(sric): cleaner
---
src/equicordplugins/showRolesInChat/index.tsx | 28 +++++++++++++------
.../showRolesInChat/styles.css | 10 ++++++-
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/src/equicordplugins/showRolesInChat/index.tsx b/src/equicordplugins/showRolesInChat/index.tsx
index b7520178a..d13888e78 100644
--- a/src/equicordplugins/showRolesInChat/index.tsx
+++ b/src/equicordplugins/showRolesInChat/index.tsx
@@ -12,9 +12,10 @@ import { EyeIcon } from "@components/Icons";
import { EquicordDevs } from "@utils/constants";
import { classNameFactory } from "@utils/css";
import { getCurrentGuild } from "@utils/discord";
+import { classes } from "@utils/misc";
import definePlugin, { OptionType } from "@utils/types";
import { User } from "@vencord/discord-types";
-import { ChannelStore, ContextMenuApi, GuildMemberStore, GuildRoleStore, Menu, useStateFromStores } from "@webpack/common";
+import { ChannelStore, ContextMenuApi, GuildMemberStore, GuildRoleStore, Menu, Tooltip, useStateFromStores } from "@webpack/common";
import type React from "react";
const cl = classNameFactory("vc-sric-");
@@ -76,7 +77,7 @@ function ShieldUserIcon({ color }: { color: string; }) {
);
}
-const HighestRoleIndicator = ErrorBoundary.wrap(({ user, channelId }: { user: User; channelId: string; }) => {
+const HighestRoleIndicator = ErrorBoundary.wrap(({ user, channelId, isCompact }: { user: User; channelId: string; isCompact?: boolean; }) => {
const { showBots, useRoleColor, excludedRoles } = settings.use(SETTINGS_KEYS);
const guildId = (!user.bot || showBots) ? ChannelStore.getChannel(channelId)?.guild_id : null;
@@ -114,12 +115,20 @@ const HighestRoleIndicator = ErrorBoundary.wrap(({ user, channelId }: { user: Us
};
return (
-
-
-
- {role.name}
-
-
+
+ {tooltipProps => (
+
+
+
+ {role.name}
+
+
+ )}
+
);
}, { noop: true });
@@ -147,10 +156,11 @@ export default definePlugin({
);
}
},
- renderMessageDecoration: ({ message }) => (
+ renderMessageDecoration: ({ message, compact }) => (
)
});
diff --git a/src/equicordplugins/showRolesInChat/styles.css b/src/equicordplugins/showRolesInChat/styles.css
index 016d7361c..487681687 100644
--- a/src/equicordplugins/showRolesInChat/styles.css
+++ b/src/equicordplugins/showRolesInChat/styles.css
@@ -1,6 +1,7 @@
.vc-sric-indicator {
display: inline-flex;
align-items: center;
+ gap: 4px;
box-sizing: border-box;
height: 16px;
padding: 0 6px 0 4px;
@@ -16,7 +17,6 @@
.vc-sric-icon {
width: 14px;
height: 14px;
- margin-right: 4px;
flex-shrink: 0;
}
@@ -25,4 +25,12 @@
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
+}
+
+.vc-sric-indicator-compact {
+ padding: 0 2px;
+}
+
+.vc-sric-indicator-compact .vc-sric-name {
+ display: none;
}
\ No newline at end of file