From 96ee0c13514bfb967ac642cf582ecd0e6f84e032 Mon Sep 17 00:00:00 2001 From: fawn Date: Fri, 4 Apr 2025 16:01:41 +0200 Subject: [PATCH 01/17] fix notification background on new ui (#3344) --- src/api/Notifications/styles.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/Notifications/styles.css b/src/api/Notifications/styles.css index 98dff6df..ad5c9cbc 100644 --- a/src/api/Notifications/styles.css +++ b/src/api/Notifications/styles.css @@ -11,6 +11,10 @@ width: 100%; } +.visual-refresh .vc-notification-root { + background-color: var(--bg-overlay-floating, var(--background-base-low)); +} + .vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) { position: absolute; z-index: 2147483647; From eeea8d929194f81c586158f8602ebed0202c81f0 Mon Sep 17 00:00:00 2001 From: Elvyra <88881326+EepyElvyra@users.noreply.github.com> Date: Fri, 4 Apr 2025 16:22:46 +0200 Subject: [PATCH 02/17] fix IrcColors and ShowMeYourName (#3343) --- src/plugins/ircColors/index.ts | 2 +- src/plugins/showMeYourName/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index d547a0e1..74175269 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -66,7 +66,7 @@ export default definePlugin({ { find: '="SYSTEM_TAG"', replacement: { - match: /(?<=className:\i\.username,style:.{0,50}:void 0,)/, + match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0,)/, replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])}," } }, diff --git a/src/plugins/showMeYourName/index.tsx b/src/plugins/showMeYourName/index.tsx index bb22ee79..1f04f1f3 100644 --- a/src/plugins/showMeYourName/index.tsx +++ b/src/plugins/showMeYourName/index.tsx @@ -50,7 +50,7 @@ export default definePlugin({ { find: '?"@":""', replacement: { - match: /(?<=children:)\(\i\?"@":""\)\+\i(?=,|\})/, + match: /(?<=onContextMenu:\i,children:)\i\+\i/, replace: "$self.renderUsername(arguments[0])" } }, From 478699d1b08e817db1358d953b284181410e1d29 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 4 Apr 2025 16:46:01 -0400 Subject: [PATCH 03/17] Fix broken stuff for discord update (#3349) Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com> Co-authored-by: Vending Machine --- src/plugins/consoleJanitor/index.tsx | 9 +++++---- src/plugins/customidle/index.ts | 8 -------- src/plugins/decor/ui/modals/CreateDecorationModal.tsx | 2 +- src/plugins/ircColors/index.ts | 4 ++-- src/plugins/messageLogger/index.tsx | 2 +- src/plugins/newGuildSettings/index.tsx | 2 +- src/plugins/nsfwGateBypass/index.ts | 4 ++-- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/plugins/consoleJanitor/index.tsx b/src/plugins/consoleJanitor/index.tsx index 5a3b3cd1..d32f525e 100644 --- a/src/plugins/consoleJanitor/index.tsx +++ b/src/plugins/consoleJanitor/index.tsx @@ -117,6 +117,7 @@ export default definePlugin({ this.settings.store.whitelistedLoggers?.split(";").map(x => x.trim()).forEach(logAllow.add.bind(logAllow)); }, + Noop, NoopLogger: () => NoopLogger, shouldLog(logger: string, level: keyof AllowLevels) { @@ -148,15 +149,15 @@ export default definePlugin({ { find: "is not a valid locale.", replacement: { - match: /\i\.error\(""\.concat\(\i," is not a valid locale."\)\);/, - replace: "" + match: /\i\.error(?=\(""\.concat\(\i," is not a valid locale."\)\))/, + replace: "$self.Noop" } }, { find: '"AppCrashedFatalReport: getLastCrash not supported."', replacement: { - match: /console\.log\("AppCrashedFatalReport: getLastCrash not supported\."\);/, - replace: "" + match: /console\.log(?=\("AppCrashedFatalReport: getLastCrash not supported\."\))/, + replace: "$self.Noop" } }, { diff --git a/src/plugins/customidle/index.ts b/src/plugins/customidle/index.ts index 7d353f15..9ffa889f 100644 --- a/src/plugins/customidle/index.ts +++ b/src/plugins/customidle/index.ts @@ -47,19 +47,11 @@ export default definePlugin({ { match: /\i\.\i\.dispatch\({type:"IDLE",idle:!1}\)/, replace: "$self.handleOnline()" - }, - { - match: /(setInterval\(\i,\.25\*)\i\.\i/, - replace: "$1$self.getIntervalDelay()" // For web installs } ] } ], - getIntervalDelay() { - return Math.min(6e5, this.getIdleTimeout()); - }, - handleOnline() { if (!settings.store.remainInIdle) { FluxDispatcher.dispatch({ diff --git a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx index eb39c16d..4afb7464 100644 --- a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx +++ b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx @@ -19,7 +19,7 @@ import { AvatarDecorationModalPreview } from "../components"; const FileUpload = findComponentByCodeLazy("fileUploadInput,"); -const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE=3]="POSITIVE', { +const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positive', { HelpMessageTypes: filters.byProps("POSITIVE", "WARNING", "INFO"), HelpMessage: filters.byCode(".iconDiv") }); diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index 74175269..50630372 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -66,8 +66,8 @@ export default definePlugin({ { find: '="SYSTEM_TAG"', replacement: { - match: /(?<=\i.gradientClassName]\),style:.{0,80}:void 0,)/, - replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])}," + match: /\i.gradientClassName]\),style:/, + replace: "$&{color:$self.calculateNameColorForMessageContext(arguments[0])},_style:" } }, { diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index dee58f2f..4bce7f5e 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -401,7 +401,7 @@ export default definePlugin({ { // Updated message transformer(?) - find: "THREAD_STARTER_MESSAGE?null===", + find: "THREAD_STARTER_MESSAGE?null==", replacement: [ { // Pass through editHistory & deleted & original attachments to the "edited message" transformer diff --git a/src/plugins/newGuildSettings/index.tsx b/src/plugins/newGuildSettings/index.tsx index e613f7a0..f8a517fa 100644 --- a/src/plugins/newGuildSettings/index.tsx +++ b/src/plugins/newGuildSettings/index.tsx @@ -128,7 +128,7 @@ export default definePlugin({ { find: ",acceptInvite(", replacement: { - match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!==.+?;/, + match: /INVITE_ACCEPT_SUCCESS.+?,(\i)=null!=.+?;/, replace: (m, guildId) => `${m}$self.applyDefaultSettings(${guildId});` } }, diff --git a/src/plugins/nsfwGateBypass/index.ts b/src/plugins/nsfwGateBypass/index.ts index e6f3ee40..6d0cb702 100644 --- a/src/plugins/nsfwGateBypass/index.ts +++ b/src/plugins/nsfwGateBypass/index.ts @@ -28,11 +28,11 @@ export default definePlugin({ find: ".nsfwAllowed=null", replacement: [ { - match: /(?<=\.nsfwAllowed=)null!==.+?(?=[,;])/, + match: /(?<=\.nsfwAllowed=)null!=.+?(?=[,;])/, replace: "true", }, { - match: /(?<=\.ageVerificationStatus=)null!==.+?(?=[,;])/, + match: /(?<=\.ageVerificationStatus=)null!=.+?(?=[,;])/, replace: "3", // VERIFIED_ADULT } ], From 8d0256bde81213b6429dbf9cce912184efe5317c Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 4 Apr 2025 22:54:27 +0200 Subject: [PATCH 04/17] Vesktop: force disable broken DeepLinks experiment --- src/plugins/disableDeepLinks.vesktop/index.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/plugins/disableDeepLinks.vesktop/index.ts diff --git a/src/plugins/disableDeepLinks.vesktop/index.ts b/src/plugins/disableDeepLinks.vesktop/index.ts new file mode 100644 index 00000000..c917181b --- /dev/null +++ b/src/plugins/disableDeepLinks.vesktop/index.ts @@ -0,0 +1,23 @@ +/* + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +import { Devs } from "@utils/constants"; +import definePlugin from "@utils/types"; + +export default definePlugin({ + name: "DisableDeepLinks", + description: "Disables Discord stupid DeepLinks experiment which makes the app unusable", + authors: [Devs.Ven], + required: true, + + patches: [{ + find: "2025-03_desktop_deeplinks", + replacement: { + match: /config:{enabled:!0/, + replace: "config:{enabled:!1", + } + }] +}); From 7246bface3050ebfdcf2371bb7ae90cb05ccf0a4 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 4 Apr 2025 22:59:21 +0200 Subject: [PATCH 05/17] update vesktop build target name --- scripts/build/build.mjs | 2 +- scripts/build/common.mjs | 4 ++-- scripts/generatePluginList.ts | 4 ++-- src/components/PluginSettings/index.tsx | 4 ++-- src/modules.d.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/build/build.mjs b/scripts/build/build.mjs index 9c2b4970..0d796ddb 100755 --- a/scripts/build/build.mjs +++ b/scripts/build/build.mjs @@ -184,7 +184,7 @@ const buildConfigs = ([ globalName: "Vencord", sourcemap, plugins: [ - globPlugins("vencordDesktop"), + globPlugins("vesktop"), ...commonRendererPlugins ], define: { diff --git a/scripts/build/common.mjs b/scripts/build/common.mjs index 920e5926..9bcbc7f0 100644 --- a/scripts/build/common.mjs +++ b/scripts/build/common.mjs @@ -129,7 +129,7 @@ export const makeAllPackagesExternalPlugin = { }; /** - * @type {(kind: "web" | "discordDesktop" | "vencordDesktop") => import("esbuild").Plugin} + * @type {(kind: "web" | "discordDesktop" | "vesktop") => import("esbuild").Plugin} */ export const globPlugins = kind => ({ name: "glob-plugins", @@ -168,7 +168,7 @@ export const globPlugins = kind => ({ (target === "web" && kind === "discordDesktop") || (target === "desktop" && kind === "web") || (target === "discordDesktop" && kind !== "discordDesktop") || - (target === "vencordDesktop" && kind !== "vencordDesktop"); + (target === "vesktop" && kind !== "vesktop"); if (excluded) { const name = await resolvePluginName(fullDir, file); diff --git a/scripts/generatePluginList.ts b/scripts/generatePluginList.ts index 3d7c16c0..2f7ac731 100644 --- a/scripts/generatePluginList.ts +++ b/scripts/generatePluginList.ts @@ -39,7 +39,7 @@ interface PluginData { hasCommands: boolean; required: boolean; enabledByDefault: boolean; - target: "discordDesktop" | "vencordDesktop" | "desktop" | "web" | "dev"; + target: "discordDesktop" | "vesktop" | "desktop" | "web" | "dev"; filePath: string; } @@ -163,7 +163,7 @@ async function parseFile(fileName: string) { const target = getPluginTarget(fileName); if (target) { - if (!["web", "discordDesktop", "vencordDesktop", "desktop", "dev"].includes(target)) throw fail(`invalid target ${target}`); + if (!["web", "discordDesktop", "vesktop", "desktop", "dev"].includes(target)) throw fail(`invalid target ${target}`); data.target = target as any; } diff --git a/src/components/PluginSettings/index.tsx b/src/components/PluginSettings/index.tsx index 371c3082..27eb10a3 100644 --- a/src/components/PluginSettings/index.tsx +++ b/src/components/PluginSettings/index.tsx @@ -177,10 +177,10 @@ function ExcludedPluginsList({ search }: { search: string; }) { const matchingExcludedPlugins = Object.entries(ExcludedPlugins) .filter(([name]) => name.toLowerCase().includes(search)); - const ExcludedReasons: Record<"web" | "discordDesktop" | "vencordDesktop" | "desktop" | "dev", string> = { + const ExcludedReasons: Record<"web" | "discordDesktop" | "vesktop" | "desktop" | "dev", string> = { desktop: "Discord Desktop app or Vesktop", discordDesktop: "Discord Desktop app", - vencordDesktop: "Vesktop app", + vesktop: "Vesktop app", web: "Vesktop app and the Web version of Discord", dev: "Developer version of Vencord" }; diff --git a/src/modules.d.ts b/src/modules.d.ts index b6e6b247..082b169d 100644 --- a/src/modules.d.ts +++ b/src/modules.d.ts @@ -25,7 +25,7 @@ declare module "~plugins" { folderName: string; userPlugin: boolean; }>; - export const ExcludedPlugins: Record; + export const ExcludedPlugins: Record; } declare module "~pluginNatives" { From 7450ecd6f3cb33e8a0eaf718636bdc948e3433f1 Mon Sep 17 00:00:00 2001 From: dolfies Date: Fri, 4 Apr 2025 17:04:20 -0400 Subject: [PATCH 06/17] ImplicitRelationships: update logic (#3338) --- src/plugins/implicitRelationships/README.md | 2 +- src/plugins/implicitRelationships/index.ts | 58 ++++++++++++--------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/plugins/implicitRelationships/README.md b/src/plugins/implicitRelationships/README.md index a76e298f..b560bf2c 100644 --- a/src/plugins/implicitRelationships/README.md +++ b/src/plugins/implicitRelationships/README.md @@ -2,6 +2,6 @@ Shows your implicit relationships in the Friends tab. -Implicit relationships on Discord are people with whom you've frecently interacted and share a mutual server; even though Discord thinks you should be friends with them, you haven't added them as friends. +Implicit relationships on Discord are people with whom you've frecently interacted and don't have a relationship with. Even though Discord thinks you should be friends with them, you haven't added them as friends! ![](https://camo.githubusercontent.com/6927161ee0c933f7ef6d61f243cca3e6ea4c8db9d1becd8cbf73c45e1bd0d127/68747470733a2f2f692e646f6c66692e65732f7055447859464662674d2e706e673f6b65793d736e3950343936416c32444c7072) diff --git a/src/plugins/implicitRelationships/index.ts b/src/plugins/implicitRelationships/index.ts index f0be9ee5..13c12ed9 100644 --- a/src/plugins/implicitRelationships/index.ts +++ b/src/plugins/implicitRelationships/index.ts @@ -20,7 +20,7 @@ import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { findStoreLazy } from "@webpack"; -import { ChannelStore, Constants, FluxDispatcher, GuildStore, RelationshipStore, SnowflakeUtils, UserStore } from "@webpack/common"; +import { Constants, FluxDispatcher, GuildStore, RelationshipStore, RestAPI, SnowflakeUtils, UserStore } from "@webpack/common"; import { Settings } from "Vencord"; const UserAffinitiesStore = findStoreLazy("UserAffinitiesStore"); @@ -121,55 +121,61 @@ export default definePlugin({ : comparator(row); }, + async refreshUserAffinities() { + try { + await RestAPI.get({ url: "/users/@me/affinities/users", retries: 3 }).then(({ body }) => { + FluxDispatcher.dispatch({ + type: "LOAD_USER_AFFINITIES_SUCCESS", + affinities: body, + }); + }); + } catch (e) { + // Not a critical error if this fails for some reason + } + }, + async fetchImplicitRelationships() { // Implicit relationships are defined as users that you: // 1. Have an affinity for - // 2. Do not have a relationship with // TODO: Check how this works with pending/blocked relationships - // 3. Have a mutual guild with + // 2. Do not have a relationship with + await this.refreshUserAffinities(); const userAffinities: Set = UserAffinitiesStore.getUserAffinitiesUserIds(); + const relationships = RelationshipStore.getRelationships(); const nonFriendAffinities = Array.from(userAffinities).filter( id => !RelationshipStore.getRelationshipType(id) ); + nonFriendAffinities.forEach(id => { + relationships[id] = 5; + }); + RelationshipStore.emitChange(); - // I would love to just check user cache here (falling back to the gateway of course) - // However, users in user cache may just be there because they share a DM or group DM with you - // So there's no guarantee that a user being in user cache means they have a mutual with you - // To get around this, we request users we have DMs with, and ignore them below if we don't get them back - const dmUserIds = new Set( - Object.values(ChannelStore.getSortedPrivateChannels()).flatMap(c => c.recipients) - ); - const toRequest = nonFriendAffinities.filter(id => !UserStore.getUser(id) || dmUserIds.has(id)); + const toRequest = nonFriendAffinities.filter(id => !UserStore.getUser(id)); const allGuildIds = Object.keys(GuildStore.getGuilds()); const sentNonce = SnowflakeUtils.fromTimestamp(Date.now()); let count = allGuildIds.length * Math.ceil(toRequest.length / 100); // OP 8 Request Guild Members allows 100 user IDs at a time - const ignore = new Set(toRequest); - const relationships = RelationshipStore.getRelationships(); + // Note: As we are using OP 8 here, implicit relationships who we do not share a guild + // with will not be fetched; so, if they're not otherwise cached, they will not be shown + // This should not be a big deal as these should be rare const callback = ({ chunks }) => { - for (const chunk of chunks) { - const { nonce, members } = chunk; - if (nonce !== sentNonce) return; - members.forEach(member => { - ignore.delete(member.user.id); - }); + const chunkCount = chunks.filter(chunk => chunk.nonce === sentNonce).length; + if (chunkCount === 0) return; - nonFriendAffinities.map(id => UserStore.getUser(id)).filter(user => user && !ignore.has(user.id)).forEach(user => relationships[user.id] = 5); - RelationshipStore.emitChange(); - if (--count === 0) { - // @ts-ignore - FluxDispatcher.unsubscribe("GUILD_MEMBERS_CHUNK_BATCH", callback); - } + count -= chunkCount; + RelationshipStore.emitChange(); + if (count <= 0) { + FluxDispatcher.unsubscribe("GUILD_MEMBERS_CHUNK_BATCH", callback); } }; - // @ts-ignore FluxDispatcher.subscribe("GUILD_MEMBERS_CHUNK_BATCH", callback); for (let i = 0; i < toRequest.length; i += 100) { FluxDispatcher.dispatch({ type: "GUILD_MEMBERS_REQUEST", guildIds: allGuildIds, userIds: toRequest.slice(i, i + 100), + presences: true, nonce: sentNonce, }); } From c8b54234fa934e5216796e8bf9bcd00064ccab7f Mon Sep 17 00:00:00 2001 From: Ethan <45918948+IchiiDev@users.noreply.github.com> Date: Fri, 4 Apr 2025 23:19:03 +0200 Subject: [PATCH 07/17] SpotifyShareCommands: add message argument like inbuilt commands (#3320) also cleans up the plugin's code Co-authored-by: Vendicated --- src/plugins/spotifyShareCommands/index.ts | 104 +++++++--------------- 1 file changed, 34 insertions(+), 70 deletions(-) diff --git a/src/plugins/spotifyShareCommands/index.ts b/src/plugins/spotifyShareCommands/index.ts index 8c485666..ed793963 100644 --- a/src/plugins/spotifyShareCommands/index.ts +++ b/src/plugins/spotifyShareCommands/index.ts @@ -16,8 +16,9 @@ * along with this program. If not, see . */ -import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands"; +import { ApplicationCommandInputType, Command, findOption, OptionalMessageOption, sendBotMessage } from "@api/Commands"; import { Devs } from "@utils/constants"; +import { sendMessage } from "@utils/discord"; import definePlugin from "@utils/types"; import { findByPropsLazy } from "@webpack"; import { FluxDispatcher, MessageActions } from "@webpack/common"; @@ -55,21 +56,36 @@ interface Track { const Spotify = findByPropsLazy("getPlayerState"); const PendingReplyStore = findByPropsLazy("getPendingReply"); -function sendMessage(channelId, message) { - message = { - // The following are required to prevent Discord from throwing an error - invalidEmojis: [], - tts: false, - validNonShortcutEmojis: [], - ...message - }; - const reply = PendingReplyStore.getPendingReply(channelId); - MessageActions.sendMessage(channelId, message, void 0, MessageActions.getSendMessageOptionsForReply(reply)) - .then(() => { - if (reply) { - FluxDispatcher.dispatch({ type: "DELETE_PENDING_REPLY", channelId }); +function makeCommand(name: string, formatUrl: (track: Track) => string): Command { + return { + name, + description: `Share your current Spotify ${name} in chat`, + inputType: ApplicationCommandInputType.BUILT_IN, + options: [OptionalMessageOption], + execute(options, { channel }) { + const track: Track | null = Spotify.getTrack(); + if (!track) { + return sendBotMessage(channel.id, { + content: "You're not listening to any music." + }); } - }); + + const data = formatUrl(track); + const message = findOption(options, "message"); + + // Note: Due to how Discord handles commands, we need to manually create and send the message + + sendMessage( + channel.id, + { content: message ? `${message} ${data}` : data }, + false, + MessageActions.getSendMessageOptionsForReply(PendingReplyStore.getPendingReply(channel.id)) + ).then(() => { + FluxDispatcher.dispatch({ type: "DELETE_PENDING_REPLY", channelId: channel.id }); + }); + + } + }; } export default definePlugin({ @@ -77,60 +93,8 @@ export default definePlugin({ description: "Share your current Spotify track, album or artist via slash command (/track, /album, /artist)", authors: [Devs.katlyn], commands: [ - { - name: "track", - description: "Send your current Spotify track to chat", - inputType: ApplicationCommandInputType.BUILT_IN, - options: [], - execute: (_, ctx) => { - const track: Track | null = Spotify.getTrack(); - if (track === null) { - sendBotMessage(ctx.channel.id, { - content: "You're not listening to any music." - }); - return; - } - // Note: Due to how Discord handles commands, we need to manually create and send the message - sendMessage(ctx.channel.id, { - content: `https://open.spotify.com/track/${track.id}` - }); - } - }, - { - name: "album", - description: "Send your current Spotify album to chat", - inputType: ApplicationCommandInputType.BUILT_IN, - options: [], - execute: (_, ctx) => { - const track: Track | null = Spotify.getTrack(); - if (track === null) { - sendBotMessage(ctx.channel.id, { - content: "You're not listening to any music." - }); - return; - } - sendMessage(ctx.channel.id, { - content: `https://open.spotify.com/album/${track.album.id}` - }); - } - }, - { - name: "artist", - description: "Send your current Spotify artist to chat", - inputType: ApplicationCommandInputType.BUILT_IN, - options: [], - execute: (_, ctx) => { - const track: Track | null = Spotify.getTrack(); - if (track === null) { - sendBotMessage(ctx.channel.id, { - content: "You're not listening to any music." - }); - return; - } - sendMessage(ctx.channel.id, { - content: track.artists[0].external_urls.spotify - }); - } - } + makeCommand("track", track => `https://open.spotify.com/track/${track.id}`), + makeCommand("album", track => `https://open.spotify.com/album/${track.album.id}`), + makeCommand("artist", track => track.artists[0].external_urls.spotify) ] }); From 7eeb719eacf6f818d6b30bde83f04be2d8b3b31b Mon Sep 17 00:00:00 2001 From: rini c Date: Fri, 4 Apr 2025 18:55:08 -0300 Subject: [PATCH 08/17] Update Plugin Settings, GameActivityToggle & TypingTweaks for new ui (#3326) --- src/components/Switch.tsx | 2 +- src/plugins/consoleShortcuts/index.ts | 11 ++++++++++- src/plugins/gameActivityToggle/index.tsx | 1 + src/plugins/gameActivityToggle/style.css | 2 +- src/plugins/typingTweaks/index.tsx | 25 +++++++++--------------- src/plugins/typingTweaks/style.css | 5 +++++ 6 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 src/plugins/typingTweaks/style.css diff --git a/src/components/Switch.tsx b/src/components/Switch.tsx index 10904e14..87af25e2 100644 --- a/src/components/Switch.tsx +++ b/src/components/Switch.tsx @@ -27,7 +27,7 @@ interface SwitchProps { disabled?: boolean; } -const SWITCH_ON = "var(--green-360)"; +const SWITCH_ON = "var(--brand-500)"; const SWITCH_OFF = "var(--primary-400)"; const SwitchClasses = findByPropsLazy("slider", "input", "container"); diff --git a/src/plugins/consoleShortcuts/index.ts b/src/plugins/consoleShortcuts/index.ts index 49ac671b..5afdbdd9 100644 --- a/src/plugins/consoleShortcuts/index.ts +++ b/src/plugins/consoleShortcuts/index.ts @@ -153,7 +153,16 @@ function makeShortcuts() { openModal: { getter: () => ModalAPI.openModal }, openModalLazy: { getter: () => ModalAPI.openModalLazy }, - Stores: Webpack.fluxStores + Stores: Webpack.fluxStores, + + // e.g. "2024-05_desktop_visual_refresh", 0 + setExperiment: (id: string, bucket: number) => { + Common.FluxDispatcher.dispatch({ + type: "EXPERIMENT_OVERRIDE_BUCKET", + experimentId: id, + experimentBucket: bucket, + }); + }, }; } diff --git a/src/plugins/gameActivityToggle/index.tsx b/src/plugins/gameActivityToggle/index.tsx index c1301411..97885177 100644 --- a/src/plugins/gameActivityToggle/index.tsx +++ b/src/plugins/gameActivityToggle/index.tsx @@ -69,6 +69,7 @@ function GameActivityToggleButton() { icon={makeIcon(showCurrentGame)} role="switch" aria-checked={!showCurrentGame} + redGlow={!showCurrentGame} onClick={() => ShowCurrentGame.updateSetting(old => !old)} /> ); diff --git a/src/plugins/gameActivityToggle/style.css b/src/plugins/gameActivityToggle/style.css index 3e6fd6b7..e13e2425 100644 --- a/src/plugins/gameActivityToggle/style.css +++ b/src/plugins/gameActivityToggle/style.css @@ -1,3 +1,3 @@ -[class*="panels"] [class*="avatarWrapper"] { +[class^="panels"] [class^="avatarWrapper"] { min-width: 88px; } diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index ff68a486..22013992 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -25,6 +25,8 @@ import { Avatar, GuildMemberStore, React, RelationshipStore } from "@webpack/com import { User } from "discord-types/general"; import { PropsWithChildren } from "react"; +import managedStyle from "./style.css?managed"; + const settings = definePluginSettings({ showAvatars: { type: OptionType.BOOLEAN, @@ -60,24 +62,19 @@ interface Props { const TypingUser = ErrorBoundary.wrap(function ({ user, guildId }: Props) { return ( { openUserProfile(user.id); }} style={{ - display: "grid", - gridAutoFlow: "column", - gap: "4px", color: settings.store.showRoleColors ? GuildMemberStore.getMember(guildId, user.id)?.colorString : undefined, - cursor: "pointer" }} > {settings.store.showAvatars && ( -
- -
+ )} {GuildMemberStore.getNick(guildId!, user.id) || (!guildId && RelationshipStore.getNickname(user.id)) @@ -94,6 +91,8 @@ export default definePlugin({ authors: [Devs.zt], settings, + managedStyle, + patches: [ { find: "#{intl::THREE_USERS_TYPING}", @@ -101,7 +100,7 @@ export default definePlugin({ { // Style the indicator and add function call to modify the children before rendering match: /(?<=children:\[(\i)\.length>0.{0,200}?"aria-atomic":!0,children:)\i(?<=guildId:(\i).+?)/, - replace: "$self.renderTypingUsers({ users: $1, guildId: $2, children: $& }),style:$self.TYPING_TEXT_STYLE" + replace: "$self.renderTypingUsers({ users: $1, guildId: $2, children: $& })" }, { // Changes the indicator to keep the user object when creating the list of typing users @@ -118,12 +117,6 @@ export default definePlugin({ } ], - TYPING_TEXT_STYLE: { - display: "grid", - gridAutoFlow: "column", - gridGap: "0.25em" - }, - buildSeveralUsers, renderTypingUsers: ErrorBoundary.wrap(({ guildId, users, children }: PropsWithChildren<{ guildId: string, users: User[]; }>) => { diff --git a/src/plugins/typingTweaks/style.css b/src/plugins/typingTweaks/style.css new file mode 100644 index 00000000..28d0042a --- /dev/null +++ b/src/plugins/typingTweaks/style.css @@ -0,0 +1,5 @@ +.vc-typing-user [class^="wrapper"] { + display: inline-block; + margin-right: 0.25em; + vertical-align: -4px; +} From cdd8f3096203cbb6e33c2d062aabc053299d3dcd Mon Sep 17 00:00:00 2001 From: James McKee Date: Fri, 4 Apr 2025 23:22:43 +0100 Subject: [PATCH 09/17] oneko: Fix oneko being hidden under some elements (#3274) --- src/plugins/oneko/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/oneko/index.ts b/src/plugins/oneko/index.ts index 90a3901a..cabe4db9 100644 --- a/src/plugins/oneko/index.ts +++ b/src/plugins/oneko/index.ts @@ -26,7 +26,7 @@ export default definePlugin({ authors: [Devs.Ven, Devs.adryd], start() { - fetch("https://raw.githubusercontent.com/adryd325/oneko.js/8fa8a1864aa71cd7a794d58bc139e755e96a236c/oneko.js") + fetch("https://raw.githubusercontent.com/adryd325/oneko.js/c4ee66353b11a44e4a5b7e914a81f8d33111555e/oneko.js") .then(x => x.text()) .then(s => s.replace("./oneko.gif", "https://raw.githubusercontent.com/adryd325/oneko.js/14bab15a755d0e35cd4ae19c931d96d306f99f42/oneko.gif") .replace("(isReducedMotion)", "(false)")) From 094a7852b1ebc0f5e2e526e942bf93f1a5397f9c Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 4 Apr 2025 18:32:15 -0400 Subject: [PATCH 10/17] Fix size of chat bar buttons on new ui (#3351) --- src/plugins/invisibleChat.desktop/index.tsx | 4 ++-- src/plugins/previewMessage/index.tsx | 4 ++-- src/plugins/sendTimestamps/index.tsx | 4 ++-- src/plugins/silentMessageToggle/index.tsx | 4 ++-- src/plugins/silentTyping/index.tsx | 2 +- src/plugins/translate/TranslateIcon.tsx | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/invisibleChat.desktop/index.tsx b/src/plugins/invisibleChat.desktop/index.tsx index f98ab176..f5e8cbb5 100644 --- a/src/plugins/invisibleChat.desktop/index.tsx +++ b/src/plugins/invisibleChat.desktop/index.tsx @@ -80,8 +80,8 @@ const ChatBarIcon: ChatBarButtonFactory = ({ isMainChat }) => { diff --git a/src/plugins/previewMessage/index.tsx b/src/plugins/previewMessage/index.tsx index 7b03e31d..ded408f9 100644 --- a/src/plugins/previewMessage/index.tsx +++ b/src/plugins/previewMessage/index.tsx @@ -105,8 +105,8 @@ const PreviewButton: ChatBarButtonFactory = ({ isMainChat, isEmpty, type: { atta diff --git a/src/plugins/sendTimestamps/index.tsx b/src/plugins/sendTimestamps/index.tsx index 57b9de0d..6bfac736 100644 --- a/src/plugins/sendTimestamps/index.tsx +++ b/src/plugins/sendTimestamps/index.tsx @@ -144,8 +144,8 @@ const ChatBarIcon: ChatBarButtonFactory = ({ isMainChat }) => {