UserVoiceShow: fix visual issues (#4457)

This commit is contained in:
theo 2026-08-17 21:20:25 +01:00 • committed by GitHub
parent de489fc6bd
commit 32b463059b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 6 deletions

View file

@ -116,13 +116,14 @@ function VoiceChannelTooltip({ channel, isLocked }: VoiceChannelTooltipProps) {
export interface VoiceChannelIndicatorProps {
userId: string;
isProfile?: boolean;
isMessage?: boolean;
isActionButton?: boolean;
shouldHighlight?: boolean;
}
const clickTimers = new Map<string, any>();
export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, isActionButton, shouldHighlight }: VoiceChannelIndicatorProps) => {
export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, isMessage, isActionButton, shouldHighlight }: VoiceChannelIndicatorProps) => {
const channelId = useStateFromStores([VoiceStateStore], () => VoiceStateStore.getVoiceStateForUser(userId)?.channelId);
const { isMuted, isDeaf } = useStateFromStores([VoiceStateStore], () => {
@ -192,7 +193,7 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, is
isActionButton && shouldHighlight && ActionButtonClasses.highlight,
cl(isProfile && "profile-speaker")
)}
size={isActionButton ? 20 : 16}
size={(isActionButton || isMessage) ? 20 : 16}
/>
)}
</Tooltip>

View file

@ -60,8 +60,8 @@ export default definePlugin({
{
find: "#{intl::USER_PROFILE_PRONOUNS}",
replacement: {
match: /(?<=children:\[\i," ",\i)(?=\])/,
replace: ",$self.VoiceChannelIndicator({userId:arguments[0]?.user?.id,isProfile:true})"
match: /(user:(\i).{0,100}onClickDisplayName:\i,trailing:)(\i)/,
replace: "$1[$self.VoiceChannelIndicator({userId:$2.id,isProfile:true}),$3]"
},
predicate: () => settings.store.showInUserProfileModal
},
@ -100,7 +100,7 @@ export default definePlugin({
addMemberListDecorator("UserVoiceShow", ({ user }) => user == null ? null : <VoiceChannelIndicator userId={user.id} />);
}
if (settings.store.showInMessages) {
addMessageDecoration("UserVoiceShow", ({ message }) => message?.author == null ? null : <VoiceChannelIndicator userId={message.author.id} />);
addMessageDecoration("UserVoiceShow", ({ message }) => message?.author == null ? null : <VoiceChannelIndicator userId={message.author.id} isMessage={true} />);
}
},

View file

@ -14,8 +14,9 @@
}
.vc-uvs-profile-speaker {
width: var(--custom-nickname-icon-size);
height: var(--custom-nickname-icon-size);
margin-right: 4px;
transform: translateY(1.3px);
}
.vc-uvs-tooltip-container {