From a2253cb4aeec1c4e6a69a95d2e3dacb0f0c1fa48 Mon Sep 17 00:00:00 2001 From: V Date: Tue, 5 Aug 2025 23:57:51 +0200 Subject: [PATCH] remove old discord ui workarounds & legacy code (#3585) Co-authored-by: sadan <117494111+sadan4@users.noreply.github.com> Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com> --- .vscode/settings.json | 9 ++- src/api/Notifications/styles.css | 6 +- src/components/CheckedTextInput.tsx | 1 - src/components/settings/AddonCard.css | 16 +--- src/components/settings/QuickAction.css | 14 +--- .../tabs/plugins/ContributorModal.css | 6 +- .../settings/tabs/plugins/LinkIconButton.css | 4 +- src/components/settings/tabs/styles.css | 4 +- src/plugins/_api/chatButtons.ts | 7 +- src/plugins/_core/settings.tsx | 3 +- src/plugins/betterFolders/style.css | 4 +- src/plugins/clientTheme/utils/styleUtils.ts | 4 +- src/plugins/ctrlEnterSend/index.ts | 5 +- src/plugins/decor/index.tsx | 12 --- src/plugins/fakeNitro/index.tsx | 7 +- src/plugins/ircColors/index.ts | 4 +- src/plugins/memberCount/index.tsx | 6 -- src/plugins/messageTags/index.ts | 9 --- src/plugins/openInApp/index.ts | 5 +- src/plugins/permissionFreeWill/index.ts | 5 +- src/plugins/permissionsViewer/utils.ts | 2 +- src/plugins/pinDms/data.ts | 29 ------- src/plugins/showHiddenChannels/index.tsx | 38 ++++----- src/plugins/showHiddenThings/index.ts | 6 +- .../spotifyControls/PlayerComponent.tsx | 1 - src/plugins/spotifyControls/spotifyStyles.css | 60 +++++++++++---- .../visualRefreshSpotifyStyles.css | 77 ------------------- src/plugins/startupTimings/index.tsx | 10 +-- src/plugins/textReplace/index.tsx | 16 ---- src/plugins/userMessagesPronouns/index.ts | 7 -- src/plugins/viewIcons/index.tsx | 6 -- src/utils/constants.ts | 6 +- src/webpack/common/stores.ts | 2 - 33 files changed, 105 insertions(+), 286 deletions(-) delete mode 100644 src/plugins/spotifyControls/visualRefreshSpotifyStyles.css diff --git a/.vscode/settings.json b/.vscode/settings.json index fa543b38..fe123188 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,11 +13,14 @@ "typescript.format.semicolons": "insert", "typescript.preferences.quoteStyle": "double", "javascript.preferences.quoteStyle": "double", - "gitlens.remotes": [ { "domain": "codeberg.org", "type": "Gitea" } - ] -} + ], + "css.format.spaceAroundSelectorSeparator": true, + "[css]": { + "editor.defaultFormatter": "vscode.css-language-features" + } +} \ No newline at end of file diff --git a/src/api/Notifications/styles.css b/src/api/Notifications/styles.css index 52cbc805..471fbf01 100644 --- a/src/api/Notifications/styles.css +++ b/src/api/Notifications/styles.css @@ -4,17 +4,13 @@ display: flex; flex-direction: column; color: var(--text-default); - background-color: var(--background-base-lower-alt); + background-color: var(--background-base-low); border-radius: 6px; overflow: hidden; cursor: pointer; width: 100%; } -.visual-refresh .vc-notification-root { - background-color: var(--background-base-low); -} - .vc-notification-root:not(.vc-notification-log-wrapper > .vc-notification-root) { position: absolute; z-index: 2147483647; diff --git a/src/components/CheckedTextInput.tsx b/src/components/CheckedTextInput.tsx index cf4aa119..8d37a560 100644 --- a/src/components/CheckedTextInput.tsx +++ b/src/components/CheckedTextInput.tsx @@ -18,7 +18,6 @@ import { React, TextInput } from "@webpack/common"; -// TODO: Refactor settings to use this as well interface TextInputProps { /** * WARNING: Changing this between renders will have no effect! diff --git a/src/components/settings/AddonCard.css b/src/components/settings/AddonCard.css index c8a2a81e..d5e3b4d6 100644 --- a/src/components/settings/AddonCard.css +++ b/src/components/settings/AddonCard.css @@ -1,6 +1,7 @@ .vc-addon-card { - background-color: var(--background-base-lower-alt); + background-color: var(--card-primary-bg); color: var(--interactive-active); + border: 1px solid var(--border-subtle); border-radius: 8px; display: block; height: 100%; @@ -11,26 +12,15 @@ box-sizing: border-box; } -.visual-refresh .vc-addon-card { - background-color: var(--card-primary-bg); - border: 1px solid var(--border-subtle); -} - .vc-addon-card-disabled { opacity: 0.6; } .vc-addon-card:hover { - background-color: var(--background-tertiary); transform: translateY(-1px); box-shadow: var(--elevation-high); } -.visual-refresh .vc-addon-card:hover { - /* same as non-hover, here to overwrite the non-refresh hover background */ - background-color: var(--card-primary-bg); -} - .vc-addon-header { margin-top: auto; display: flex; @@ -104,4 +94,4 @@ .vc-addon-title:hover { overflow: visible; animation: vc-addon-title var(--duration) linear infinite; -} +} \ No newline at end of file diff --git a/src/components/settings/QuickAction.css b/src/components/settings/QuickAction.css index f65fba21..8b94bd2d 100644 --- a/src/components/settings/QuickAction.css +++ b/src/components/settings/QuickAction.css @@ -14,7 +14,7 @@ .vc-settings-quickActions-pill { all: unset; - background: var(--background-base-lower); + background: var(--button-secondary-background); color: var(--header-secondary); display: flex; align-items: center; @@ -26,7 +26,7 @@ } .vc-settings-quickActions-pill:hover { - background: var(--background-base-lower-alt); + background: var(--button-secondary-background-hover); transform: translateY(-1px); box-shadow: var(--elevation-high); } @@ -36,15 +36,7 @@ outline-offset: 2px; } -.visual-refresh .vc-settings-quickActions-pill { - background: var(--button-secondary-background); -} - -.visual-refresh .vc-settings-quickActions-pill:hover { - background: var(--button-secondary-background-hover); -} - .vc-settings-quickActions-img { width: 24px; height: 24px; -} +} \ No newline at end of file diff --git a/src/components/settings/tabs/plugins/ContributorModal.css b/src/components/settings/tabs/plugins/ContributorModal.css index 3a698e2c..ef3b2dde 100644 --- a/src/components/settings/tabs/plugins/ContributorModal.css +++ b/src/components/settings/tabs/plugins/ContributorModal.css @@ -11,7 +11,7 @@ .vc-author-modal-name { text-transform: none; flex-grow: 0; - background: var(--background-tertiary); + background: var(--background-base-lowest); border-radius: 0 9999px 9999px 0; padding: 6px 0.8em 6px 0.5em; font-size: 20px; @@ -26,7 +26,7 @@ position: absolute; height: 100%; width: 32px; - background: var(--background-tertiary); + background: var(--background-base-lowest); z-index: -1; left: -32px; top: 0; @@ -48,4 +48,4 @@ display: grid; gap: 0.5em; margin-top: 0.75em; -} +} \ No newline at end of file diff --git a/src/components/settings/tabs/plugins/LinkIconButton.css b/src/components/settings/tabs/plugins/LinkIconButton.css index 1055d6c7..97db0780 100644 --- a/src/components/settings/tabs/plugins/LinkIconButton.css +++ b/src/components/settings/tabs/plugins/LinkIconButton.css @@ -2,11 +2,11 @@ height: 32px; width: 32px; border-radius: 50%; - border: 4px solid var(--background-tertiary); + border: 4px solid var(--background-base-lowest); box-sizing: border-box } .vc-settings-modal-links { display: flex; gap: 0.2em; -} +} \ No newline at end of file diff --git a/src/components/settings/tabs/styles.css b/src/components/settings/tabs/styles.css index c92d588f..2ff8cb9f 100644 --- a/src/components/settings/tabs/styles.css +++ b/src/components/settings/tabs/styles.css @@ -54,7 +54,7 @@ } .vc-settings-theme-links:focus { - background-color: var(--background-tertiary); + background-color: var(--background-base-lowest); } .vc-cloud-settings-sync-grid { @@ -74,4 +74,4 @@ .vc-updater-modal-close-button { float: right; -} +} \ No newline at end of file diff --git a/src/plugins/_api/chatButtons.ts b/src/plugins/_api/chatButtons.ts index d4e1ea8b..26312253 100644 --- a/src/plugins/_api/chatButtons.ts +++ b/src/plugins/_api/chatButtons.ts @@ -16,11 +16,8 @@ export default definePlugin({ { find: '"sticker")', replacement: { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /return\((!)?\i\.\i(?:\|\||&&)(?=\(.+?(\i)\.push)/, - replace: (m, not, children) => not - ? `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),true)&&` - : `${m}(Vencord.Api.ChatButtons._injectButtons(${children},arguments[0]),false)||` + match: /return\(\i\.\i\|\|(?=\(.+?(\i)\.push)/, + replace: "$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),false)||" } } ] diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index 1f942d7d..4a0f297e 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -59,8 +59,7 @@ export default definePlugin({ replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}` }, { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?(?:function\(\){return |\(\)=>))\2/, + match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?\(\)=>)\2/, replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})` } ] diff --git a/src/plugins/betterFolders/style.css b/src/plugins/betterFolders/style.css index a3c82dcb..a0a04966 100644 --- a/src/plugins/betterFolders/style.css +++ b/src/plugins/betterFolders/style.css @@ -3,11 +3,11 @@ } /* These area names need to be hardcoded. Only betterFoldersSidebar is added by the plugin. */ -.visual-refresh .vc-betterFolders-sidebar-grid { +.vc-betterFolders-sidebar-grid { /* stylelint-disable-next-line value-keyword-case */ grid-template-columns: [start] min-content [guildsEnd] min-content [sidebarEnd] min-content [channelsEnd] 1fr [end]; grid-template-areas: "titleBar titleBar titleBar titleBar" "guildsList betterFoldersSidebar notice notice" "guildsList betterFoldersSidebar channelsList page"; -} +} \ No newline at end of file diff --git a/src/plugins/clientTheme/utils/styleUtils.ts b/src/plugins/clientTheme/utils/styleUtils.ts index bc6169d4..ca36730a 100644 --- a/src/plugins/clientTheme/utils/styleUtils.ts +++ b/src/plugins/clientTheme/utils/styleUtils.ts @@ -75,8 +75,8 @@ function createColorsOverrides(styles: string) { const darkThemeBaseLightness = visualRefreshColorsLightness["--neutral-69-hsl"]; createOrUpdateStyle(OVERRIDES_STYLE_ID, [ - `.visual-refresh.theme-light {\n ${generateNewColorVars(visualRefreshColorsLightness, lightThemeBaseLightness)} \n}`, - `.visual-refresh.theme-dark {\n ${generateNewColorVars(visualRefreshColorsLightness, darkThemeBaseLightness)} \n}`, + `.theme-light {\n ${generateNewColorVars(visualRefreshColorsLightness, lightThemeBaseLightness)} \n}`, + `.theme-dark {\n ${generateNewColorVars(visualRefreshColorsLightness, darkThemeBaseLightness)} \n}`, ].join("\n\n")); } diff --git a/src/plugins/ctrlEnterSend/index.ts b/src/plugins/ctrlEnterSend/index.ts index 57a70d52..7b0b26b9 100644 --- a/src/plugins/ctrlEnterSend/index.ts +++ b/src/plugins/ctrlEnterSend/index.ts @@ -44,9 +44,8 @@ export default definePlugin({ { find: ".selectPreviousCommandOption(", replacement: { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(?<=(\i)\.which(?:!==|===)\i\.\i.ENTER(\|\||&&)).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=(?:\|\||&&)\(\i\.preventDefault)/, - replace: (_, event, condition, codeblock) => `${condition === "||" ? "!" : ""}$self.shouldSubmit(${event},${codeblock})` + match: /(?<=(\i)\.which!==\i\.\i.ENTER\|\|).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=\|\|\(\i\.preventDefault)/, + replace: "!$self.shouldSubmit($1,$2)" } }, { diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index a141f2b5..528e9154 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -49,18 +49,6 @@ export default definePlugin({ { find: ".decorationGridItem,", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<==)\i=>{let{children.{20,200}decorationGridItem/, - replace: "$self.DecorationGridItem=$&", - noWarn: true - }, - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<==)\i=>{let{user:\i,avatarDecoration/, - replace: "$self.DecorationGridDecoration=$&", - noWarn: true - }, { match: /(?<==)\i=>{var{children.{20,200}decorationGridItem/, replace: "$self.DecorationGridItem=$&", diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 380147fe..f697c3fd 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -255,11 +255,8 @@ export default definePlugin({ }, { // Disallow the emoji for premium locked if the intention doesn't allow it - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(!)?(\i\.\i\.canUseEmojisEverywhere\(\i\))/, - replace: (m, not) => not - ? `(${m}&&!${IS_BYPASSEABLE_INTENTION})` - : `(${m}||${IS_BYPASSEABLE_INTENTION})` + match: /!(\i\.\i\.canUseEmojisEverywhere\(\i\))/, + replace: m => `(${m}&&!${IS_BYPASSEABLE_INTENTION})` }, { // Allow animated emojis to be used if the intention allows it diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index ce007a57..ebfa735e 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -74,8 +74,8 @@ export default definePlugin({ { find: "#{intl::GUILD_OWNER}),children:", replacement: { - match: /(?<=roleName:\i,)(colorString:)/, - replace: "$1$self.calculateNameColorForListContext(arguments[0]),originalColor:" + match: /(?<=roleName:\i,)colorString:/, + replace: "colorString:$self.calculateNameColorForListContext(arguments[0]),originalColor:" }, predicate: () => settings.store.memberListColors } diff --git a/src/plugins/memberCount/index.tsx b/src/plugins/memberCount/index.tsx index 97f6f23c..7fa6fbcd 100644 --- a/src/plugins/memberCount/index.tsx +++ b/src/plugins/memberCount/index.tsx @@ -66,12 +66,6 @@ export default definePlugin({ { find: "{isSidebarVisible:", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<=let\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/, - replace: ":[$1?.startsWith('members')?$self.render():null,$2", - noWarn: true - }, { match: /(?<=var\{className:(\i),.+?children):\[(\i\.useMemo[^}]+"aria-multiselectable")/, replace: ":[$1?.startsWith('members')?$self.render():null,$2", diff --git a/src/plugins/messageTags/index.ts b/src/plugins/messageTags/index.ts index 90ce0ceb..08b035b1 100644 --- a/src/plugins/messageTags/index.ts +++ b/src/plugins/messageTags/index.ts @@ -17,7 +17,6 @@ */ import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, registerCommand, sendBotMessage, unregisterCommand } from "@api/Commands"; -import * as DataStore from "@api/DataStore"; import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; @@ -89,14 +88,6 @@ export default definePlugin({ settings, async start() { - // TODO(OptionType.CUSTOM Related): Remove DataStore tags migration once enough time has passed - const oldTags = await DataStore.get(DATA_KEY); - if (oldTags != null) { - // @ts-expect-error - settings.store.tagsList = Object.fromEntries(oldTags.map(oldTag => (delete oldTag.enabled, [oldTag.name, oldTag]))); - await DataStore.del(DATA_KEY); - } - const tags = getTags(); for (const tagName in tags) { createTagCommand(tags[tagName]); diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index e1133234..04c4f441 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -100,9 +100,8 @@ export default definePlugin({ replace: "true" }, { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(!)?\(0,\i\.isDesktop\)\(\)/, - replace: (_, not) => not ? "false" : "true" + match: /\(0,\i\.isDesktop\)\(\)/, + replace: "true" } ] }, diff --git a/src/plugins/permissionFreeWill/index.ts b/src/plugins/permissionFreeWill/index.ts index 8a613514..767d4f98 100644 --- a/src/plugins/permissionFreeWill/index.ts +++ b/src/plugins/permissionFreeWill/index.ts @@ -46,9 +46,8 @@ export default definePlugin({ find: "#{intl::ONBOARDING_CHANNEL_THRESHOLD_WARNING}", replacement: [ { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /{(?:\i:(?:function\(\){return |\(\)=>)\i}?,?){2}}/, - replace: m => m.replaceAll(canonicalizeMatch(/(function\(\){return |\(\)=>)\i/g), "$1()=>Promise.resolve(true)") + match: /{(?:\i:\(\)=>\i,?){2}}/, + replace: m => m.replaceAll(canonicalizeMatch(/\(\)=>\i/g), "()=>Promise.resolve(true)") } ], predicate: () => settings.store.onboarding diff --git a/src/plugins/permissionsViewer/utils.ts b/src/plugins/permissionsViewer/utils.ts index 27e7494b..c3f61672 100644 --- a/src/plugins/permissionsViewer/utils.ts +++ b/src/plugins/permissionsViewer/utils.ts @@ -29,7 +29,7 @@ export const { getGuildPermissionSpecMap } = findByPropsLazy("getGuildPermission export const cl = classNameFactory("vc-permviewer-"); export function getSortedRolesForMember({ id: guildId }: Guild, member: GuildMember) { - // the guild id is the @everyone role + // The guild id is the @everyone role return GuildRoleStore .getSortedRoles(guildId) .filter(role => role.id === guildId || member.roles.includes(role.id)); diff --git a/src/plugins/pinDms/data.ts b/src/plugins/pinDms/data.ts index d689bd2a..18782299 100644 --- a/src/plugins/pinDms/data.ts +++ b/src/plugins/pinDms/data.ts @@ -4,8 +4,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import * as DataStore from "@api/DataStore"; -import { Settings } from "@api/Settings"; import { useForceUpdater } from "@utils/react"; import { UserStore } from "@webpack/common"; @@ -28,8 +26,6 @@ let forceUpdateDms: (() => void) | undefined = undefined; export let currentUserCategories: Category[] = []; export async function init() { - await migrateData(); - const userId = UserStore.getCurrentUser()?.id; if (userId == null) return; @@ -154,28 +150,3 @@ export function moveChannel(channelId: string, direction: -1 | 1) { swapElementsInArray(category.channels, a, b); } - -// TODO(OptionType.CUSTOM Related): Remove DataStore PinnedDms migration once enough time has passed -async function migrateData() { - if (Settings.plugins.PinDMs.dmSectioncollapsed != null) { - settings.store.dmSectionCollapsed = Settings.plugins.PinDMs.dmSectioncollapsed; - delete Settings.plugins.PinDMs.dmSectioncollapsed; - } - - const dataStoreKeys = await DataStore.keys(); - const pinDmsKeys = dataStoreKeys.map(key => String(key)).filter(key => key.startsWith(CATEGORY_BASE_KEY)); - - if (pinDmsKeys.length === 0) return; - - for (const pinDmsKey of pinDmsKeys) { - const categories = await DataStore.get(pinDmsKey); - if (categories == null) continue; - - const userId = pinDmsKey.replace(CATEGORY_BASE_KEY, ""); - settings.store.userBasedCategoryList[userId] = categories; - - await DataStore.del(pinDmsKey); - } - - await Promise.all([DataStore.del(CATEGORY_MIGRATED_PINDMS_KEY), DataStore.del(CATEGORY_MIGRATED_KEY), DataStore.del(OLD_CATEGORY_KEY)]); -} diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index 2d0ea368..43cd677e 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -112,11 +112,8 @@ export default definePlugin({ }, { // Prevent Discord from trying to connect to hidden voice channels - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(?=(\|\||&&)\i\.\i\.selectVoiceChannel\((\i)\.id\))/, - replace: (_, condition, channel) => condition === "||" - ? `||$self.isHiddenChannel(${channel})` - : `&&!$self.isHiddenChannel(${channel})` + match: /(?=\|\|\i\.\i\.selectVoiceChannel\((\i)\.id\))/, + replace: (_, channel) => `||$self.isHiddenChannel(${channel})` }, { // Make Discord show inside the channel if clicking on a hidden or locked channel @@ -129,11 +126,8 @@ export default definePlugin({ { find: ".AUDIENCE),{isSubscriptionGated", replacement: { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(!)?(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/, - replace: (m, not, channel) => not - ? `${m}&&!$self.isHiddenChannel(${channel})` - : `${m}||$self.isHiddenChannel(${channel})` + match: /(\i)\.isRoleSubscriptionTemplatePreviewChannel\(\)/, + replace: (m, channel) => `${m}||$self.isHiddenChannel(${channel})` } }, { @@ -183,11 +177,8 @@ export default definePlugin({ }, // Make voice channels also appear as muted if they are muted { - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(?<=\.wrapper:\i\.notInteractive,)(.+?)(if\()?(\i)(?:\)return |\?)(\i\.MUTED)/, - replace: (_, otherClasses, isIf, isMuted, mutedClassExpression) => isIf - ? `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""` - : `${isMuted}?${mutedClassExpression}:"",${otherClasses}${isMuted}?""` + match: /(?<=\.wrapper:\i\.notInteractive,)(.+?)if\((\i)(?:\)return |\?)(\i\.MUTED)/, + replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""` } ] }, @@ -197,8 +188,7 @@ export default definePlugin({ { // Make muted channels also appear as unread if hide unreads is false, using the HiddenIconWithMutedStyle and the channel is hidden predicate: () => settings.store.hideUnreads === false && settings.store.showMode === ShowMode.HiddenIconWithMutedStyle, - // FIXME(Bundler change related): Remove old compatiblity once enough time has passed - match: /(?<=\.LOCKED(?:;if\(|:))(?<={channel:(\i).+?)/, + match: /(?<=\.LOCKED;if\()(?<={channel:(\i).+?)/, replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&` }, { @@ -292,8 +282,8 @@ export default definePlugin({ replacement: [ { // Change the role permission check to CONNECT if the channel is locked - match: /\i\.\i\(\i\.\i\.ADMINISTRATOR,\i\.\i\.VIEW_CHANNEL\)(?<=context:(\i)}.+?)/, - replace: (m, channel) => `$self.fixPermCheck(${m},${channel})` + match: /(forceRoles:.+?)(\i\.\i\(\i\.\i\.ADMINISTRATOR,\i\.\i\.VIEW_CHANNEL\))(?<=context:(\i)}.+?)/, + replace: (_, rest, mergedPermissions, channel) => `${rest}$self.swapViewChannelWithConnectPermission(${mergedPermissions},${channel})` }, { // Change the permissionOverwrite check to CONNECT if the channel is locked @@ -303,7 +293,7 @@ export default definePlugin({ { // Include the @everyone role in the allowed roles list for Hidden Channels match: /getSortedRoles.+?\.filter\(\i=>(?=!)/, - replace: m => `${m}$self.isHiddenChannel(arguments[0].channel)?true:` + replace: m => `${m}$self.isHiddenChannel(arguments[0]?.channel)?true:` }, { // If the @everyone role has the required permissions, make the array only contain it @@ -493,13 +483,13 @@ export default definePlugin({ ], - fixPermCheck(originalPerms: bigint, channel: Channel) { + swapViewChannelWithConnectPermission(mergedPermissions: bigint, channel: Channel) { if (!PermissionStore.can(PermissionsBits.CONNECT, channel)) { - originalPerms &= ~PermissionsBits.VIEW_CHANNEL; - originalPerms |= PermissionsBits.CONNECT; + mergedPermissions &= ~PermissionsBits.VIEW_CHANNEL; + mergedPermissions |= PermissionsBits.CONNECT; } - return originalPerms; + return mergedPermissions; }, isHiddenChannel(channel: Channel & { channelId?: string; }, checkConnect = false) { diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index 96ebf169..c39dccc4 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -72,8 +72,8 @@ export default definePlugin({ find: "#{intl::GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL}),allowOverflow:", predicate: () => settings.store.showModView, replacement: { - match: /(role:)\i(?<=\i\.roles,\i\.highestRoleId,(\i)\].+)/, - replace: "$1$self.findHighestRole(arguments[0],$2)", + match: /(?<=\.highestRole\),)role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+)/, + replace: "role:$self.getHighestRole(arguments[0],$2)", } }, // allows you to open mod view on yourself @@ -87,7 +87,7 @@ export default definePlugin({ } ], - findHighestRole({ member }: { member: GuildMember; }, roles: Role[]): Role | undefined { + getHighestRole({ member }: { member: GuildMember; }, roles: Role[]): Role | undefined { try { return roles.find(role => role.id === member.highestRoleId); } catch (e) { diff --git a/src/plugins/spotifyControls/PlayerComponent.tsx b/src/plugins/spotifyControls/PlayerComponent.tsx index 78a69a14..32c78c36 100644 --- a/src/plugins/spotifyControls/PlayerComponent.tsx +++ b/src/plugins/spotifyControls/PlayerComponent.tsx @@ -17,7 +17,6 @@ */ import "./spotifyStyles.css"; -import "./visualRefreshSpotifyStyles.css"; // TODO: merge with spotifyStyles.css and remove when old UI is discontinued import { Settings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; diff --git a/src/plugins/spotifyControls/spotifyStyles.css b/src/plugins/spotifyControls/spotifyStyles.css index d4afbc83..e9dfeffd 100644 --- a/src/plugins/spotifyControls/spotifyStyles.css +++ b/src/plugins/spotifyControls/spotifyStyles.css @@ -1,8 +1,13 @@ #vc-spotify-player { - padding: 0.375rem 0.5rem; + padding: 12px; + background: var(--bg-overlay-floating, var(--background-base-low, var(--background-base-lower-alt))); + margin: 0; + border-top-left-radius: 10px; + border-top-right-radius: 10px; border-bottom: 1px solid var(--border-subtle); - --vc-spotify-green: var(--spotify, #1db954); /* so custom themes can easily change it */ + /* so custom themes can easily change it */ + --vc-spotify-green: var(--spotify, #1db954); --vc-spotify-green-90: color-mix(in hsl, var(--vc-spotify-green), transparent 90%); --vc-spotify-green-80: color-mix(in hsl, var(--vc-spotify-green), transparent 80%); } @@ -16,12 +21,13 @@ } .vc-spotify-button { + margin: 0 2px; + border-radius: var(--radius-sm); background: none; color: var(--interactive-normal); padding: 0; width: 32px; height: 32px; - border-radius: 100%; display: flex; justify-content: center; align-items: center; @@ -47,13 +53,16 @@ filter: brightness(1.3); } */ -.vc-spotify-shuffle-on, .vc-spotify-repeat-context, .vc-spotify-repeat-track, -.vc-spotify-shuffle-on:hover, +.vc-spotify-shuffle-on { + background-color: var(--vc-spotify-green-90); +} + .vc-spotify-repeat-context:hover, -.vc-spotify-repeat-track:hover { - color: var(--vc-spotify-green); +.vc-spotify-repeat-track:hover, +.vc-spotify-shuffle-on:hover { + background-color: var(--vc-spotify-green-80); } .vc-spotify-tooltip-text { @@ -74,6 +83,15 @@ .vc-spotify-button-row { justify-content: center; + margin-top: 14px; +} + +.vc-spotify-secondary-song-info { + font-size: 12px; +} + +.vc-spotify-song-info-prefix { + display: none; } #vc-spotify-info-wrapper { @@ -127,7 +145,7 @@ .vc-spotify-album { font-size: 12px; text-decoration: none; - color: var(--header-secondary); + color: var(--header-primary); } .vc-spotify-comma { @@ -155,16 +173,26 @@ padding: 0 !important; } -#vc-spotify-progress-bar > [class^="slider"] [class^="bar-"] { - height: 4px !important; +#vc-spotify-progress-bar > [class^="slider"] [class^="bar"] { + height: 3px !important; + top: calc(12px - 4px / 2 + var(--bar-offset)); +} + +#vc-spotify-progress-bar > [class^="slider"] [class^="barFill"] { + background-color: var(--interactive-active); +} + +#vc-spotify-progress-bar > [class^="slider"]:hover [class^="barFill"] { + background-color: var(--vc-spotify-green); } #vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] { /* these importants are necessary, it applies a width and height through inline styles */ - height: 10px !important; - width: 10px !important; - margin-top: 4px; - background-color: var(--interactive-normal); + height: 16px !important; + width: 16px !important; + margin-top: calc(17px/-2 + var(--bar-offset)/2); + margin-left: -0.5px; + background-color: var(--interactive-active); border-color: var(--interactive-normal); color: var(--interactive-normal); opacity: 0; @@ -183,6 +211,8 @@ font-size: 12px; top: 10px; position: absolute; + margin-top: 8px; + font-family: var(--font-code); } .vc-spotify-time-left { @@ -196,4 +226,4 @@ .vc-spotify-fallback { padding: 0.5em; color: var(--text-default); -} +} \ No newline at end of file diff --git a/src/plugins/spotifyControls/visualRefreshSpotifyStyles.css b/src/plugins/spotifyControls/visualRefreshSpotifyStyles.css deleted file mode 100644 index 0d6d30ba..00000000 --- a/src/plugins/spotifyControls/visualRefreshSpotifyStyles.css +++ /dev/null @@ -1,77 +0,0 @@ -/* TODO: merge with spotifyStyles.css and remove when old UI is discontinued */ -.visual-refresh { - #vc-spotify-player { - padding: 12px; - background: var(--bg-overlay-floating, var(--background-base-low, var(--background-base-lower-alt))); - margin: 0; - border-top-left-radius: 10px; - border-top-right-radius: 10px; - } - - .vc-spotify-song-info-prefix { - display: none; - } - - .vc-spotify-artist, .vc-spotify-album { - color: var(--header-primary); - } - - .vc-spotify-secondary-song-info { - font-size: 12px; - } - - #vc-spotify-progress-bar { - position: relative; - color: var(--text-default); - width: 100%; - } - - #vc-spotify-progress-bar > [class^="slider"] { - flex-grow: 1; - width: 100%; - padding: 0 !important; - } - - #vc-spotify-progress-bar > [class^="slider"] [class^="bar"] { - height: 3px !important; - top: calc(12px - 4px / 2 + var(--bar-offset)); - } - - #vc-spotify-progress-bar > [class^="slider"] [class^="barFill"] { - background-color: var(--interactive-active); - } - - #vc-spotify-progress-bar > [class^="slider"]:hover [class^="barFill"] { - background-color: var(--vc-spotify-green); - } - - #vc-spotify-progress-bar > [class^="slider"] [class^="grabber"] { - background-color: var(--interactive-active); - width: 16px !important; - height: 16px !important; - margin-top: calc(17px/-2 + var(--bar-offset)/2); - margin-left: -0.5px; - } - - .vc-spotify-progress-time { - margin-top: 8px; - font-family: var(--font-code); - } - - .vc-spotify-button-row { - margin-top: 14px; - } - - .vc-spotify-button { - margin: 0 2px; - border-radius: var(--radius-sm); - } - - .vc-spotify-repeat-context, .vc-spotify-repeat-track, .vc-spotify-shuffle-on { - background-color: var(--vc-spotify-green-90); - } - - .vc-spotify-repeat-context:hover, .vc-spotify-repeat-track:hover, .vc-spotify-shuffle-on:hover { - background-color: var(--vc-spotify-green-80); - } -} diff --git a/src/plugins/startupTimings/index.tsx b/src/plugins/startupTimings/index.tsx index ac7f3f0c..747850f1 100644 --- a/src/plugins/startupTimings/index.tsx +++ b/src/plugins/startupTimings/index.tsx @@ -25,17 +25,10 @@ export default definePlugin({ name: "StartupTimings", description: "Adds Startup Timings to the Settings menu", authors: [Devs.Megu], + patches: [{ find: "#{intl::ACTIVITY_SETTINGS}", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+}\)}\))/, - replace: (_, commaOrSemi, settings, elements) => "" + - `${commaOrSemi}${settings}?.[0]==="CHANGELOG"` + - `&&${elements}.push({section:"StartupTimings",label:"Startup Timings",element:$self.StartupTimingPage})`, - noWarn: true - }, { match: /(?<=}\)([,;])(\i\.settings)\.forEach.+?(\i)\.push.+\)\)\}\))(?=\)\})/, replace: (_, commaOrSemi, settings, elements) => "" + @@ -44,5 +37,6 @@ export default definePlugin({ }, ] }], + StartupTimingPage }); diff --git a/src/plugins/textReplace/index.tsx b/src/plugins/textReplace/index.tsx index d5d6f4dc..756541cc 100644 --- a/src/plugins/textReplace/index.tsx +++ b/src/plugins/textReplace/index.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import { DataStore } from "@api/index"; import { definePluginSettings } from "@api/Settings"; import { Flex } from "@components/Flex"; import { DeleteIcon } from "@components/Icons"; @@ -241,20 +240,5 @@ export default definePlugin({ // Channel used for sharing rules, applying rules here would be messy if (channelId === TEXT_REPLACE_RULES_CHANNEL_ID) return; msg.content = applyRules(msg.content); - }, - - async start() { - // TODO(OptionType.CUSTOM Related): Remove DataStore rules migrations once enough time has passed - const oldStringRules = await DataStore.get(STRING_RULES_KEY); - if (oldStringRules != null) { - settings.store.stringRules = oldStringRules; - await DataStore.del(STRING_RULES_KEY); - } - - const oldRegexRules = await DataStore.get(REGEX_RULES_KEY); - if (oldRegexRules != null) { - settings.store.regexRules = oldRegexRules; - await DataStore.del(REGEX_RULES_KEY); - } } }); diff --git a/src/plugins/userMessagesPronouns/index.ts b/src/plugins/userMessagesPronouns/index.ts index 1699251e..9eaab235 100644 --- a/src/plugins/userMessagesPronouns/index.ts +++ b/src/plugins/userMessagesPronouns/index.ts @@ -42,13 +42,6 @@ export default definePlugin({ { find: '="SYSTEM_TAG"', replacement: [ - { - // Add next to username (compact mode) - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\),(?=\i)/g, - replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),", - noWarn: true - }, { // Add next to username (compact mode) match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g, diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx index 3b8485fc..a523a681 100644 --- a/src/plugins/viewIcons/index.tsx +++ b/src/plugins/viewIcons/index.tsx @@ -199,12 +199,6 @@ export default definePlugin({ { find: ".overlay:void 0,status:", replacement: [ - { - // FIXME(Bundler spread transform related): Remove old compatiblity once enough time has passed, if they don't revert - match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/, - replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},", - noWarn: true - }, { match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",.{0,100}className:\i,/, replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},", diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 962ea789..eb19bf86 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -93,9 +93,9 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "Mai", id: 722647978577363026n }, - echo: { - name: "ECHO", - id: 712639419785412668n + amy: { + name: "Amy", + id: 603229858612510720n }, katlyn: { name: "katlyn", diff --git a/src/webpack/common/stores.ts b/src/webpack/common/stores.ts index 71abd729..ca867c70 100644 --- a/src/webpack/common/stores.ts +++ b/src/webpack/common/stores.ts @@ -31,8 +31,6 @@ export let MessageStore: Omit & GenericStore & { getMessages(chanId: string): any; }; -// TODO: The correct name for this is ChannelActionCreators and it has already been exported again from utils. Remove this export once enough time has passed -export const PrivateChannelsStore = findByPropsLazy("openPrivateChannel"); export let PermissionStore: GenericStore; export let GuildChannelStore: GenericStore; export let ReadStateStore: GenericStore;