From f4bef87da128ac63cce407125984a53cb63e7113 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Fri, 23 Jan 2026 12:00:30 -0500 Subject: [PATCH] add some vc pr fixes --- packages/discord-types/src/classes.d.ts | 16 ------------ src/api/ChatButton.css | 26 +++++++++++++++++++ src/api/ChatButtons.tsx | 13 ++++++---- src/api/HeaderBar.tsx | 2 +- .../soundBoardLogger/components/Icons.tsx | 6 ++--- .../soundBoardLogger/styles.css | 26 +++++++++++++++++++ src/plugins/betterFolders/index.tsx | 19 ++++++++------ src/plugins/reviewDB/index.tsx | 8 ++---- src/plugins/reviewDB/style.css | 23 +++++++++++++++- src/plugins/showHiddenChannels/index.tsx | 9 +++---- src/plugins/showHiddenChannels/style.css | 10 +++++++ src/plugins/typingIndicator/index.tsx | 2 +- src/plugins/viewIcons/index.tsx | 4 +-- src/webpack/common/classes.ts | 22 ---------------- src/webpack/common/index.ts | 1 - 15 files changed, 115 insertions(+), 72 deletions(-) delete mode 100644 packages/discord-types/src/classes.d.ts delete mode 100644 src/webpack/common/classes.ts diff --git a/packages/discord-types/src/classes.d.ts b/packages/discord-types/src/classes.d.ts deleted file mode 100644 index a7260048d..000000000 --- a/packages/discord-types/src/classes.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface ButtonWrapperClasses { - hoverScale: string; - buttonWrapper: string; - button: string; - iconMask: string; - buttonContent: string; - icon: string; - pulseIcon: string; - pulseButton: string; - notificationDot: string; - sparkleContainer: string; - sparkleStar: string; - sparklePlus: string; - sparkle: string; - active: string; -} diff --git a/src/api/ChatButton.css b/src/api/ChatButton.css index 30869a846..d6f0c712c 100644 --- a/src/api/ChatButton.css +++ b/src/api/ChatButton.css @@ -2,3 +2,29 @@ display: flex; align-items: center; } + +/* FIXME: bad name +_7f7a2c5f23327d73 */ +.vc-chatbar-discord-button { + opacity: .7; + align-items: center; + align-self: center; + border-radius: 8px; + cursor: pointer; + display: flex; + justify-content: center; + padding: 10px; + + &:hover { + background: hsl(0deg 0% 100% / 10%); + opacity: 1 + } +} + +/* _3f4f204c3133fb93 */ +.vc-chatbar-button-wrapper { + align-self: center; + display: flex; + flex-direction: row; + gap: 8px; +} \ No newline at end of file diff --git a/src/api/ChatButtons.tsx b/src/api/ChatButtons.tsx index f4871141d..ce1292318 100644 --- a/src/api/ChatButtons.tsx +++ b/src/api/ChatButtons.tsx @@ -7,17 +7,20 @@ import "./ChatButton.css"; import ErrorBoundary from "@components/ErrorBoundary"; +import { classNameFactory } from "@utils/css"; import { Logger } from "@utils/Logger"; import { classes } from "@utils/misc"; import { IconComponent } from "@utils/types"; import { Channel } from "@vencord/discord-types"; import { waitFor } from "@webpack"; -import { ButtonWrapperClasses, Clickable, Menu, Tooltip } from "@webpack/common"; +import { Clickable, Menu, Tooltip } from "@webpack/common"; import { HTMLProps, JSX, MouseEventHandler, ReactNode } from "react"; import { addContextMenuPatch, findGroupChildrenByChildId } from "./ContextMenu"; import { useSettings } from "./Settings"; +const cl = classNameFactory("vc-chatbar-"); + let ChannelTextAreaClasses: Record<"button" | "buttonContainer", string>; waitFor(["buttonContainer", "channelTextArea"], m => ChannelTextAreaClasses = m); @@ -140,18 +143,18 @@ export const ChatBarButton = ErrorBoundary.wrap((props: ChatBarButtonProps) => { return ( {({ onMouseEnter, onMouseLeave }) => ( -
+
-
+
{props.children}
@@ -174,7 +177,7 @@ addContextMenuPatch("textarea-context", (children, args) => { if (idx === -1) return; group.splice(idx, 0, - + {buttons.map(([id]) => ( ; +const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '"aria-haspopup":') as ComponentType; export interface HeaderBarButtonProps { /** The icon component to render inside the button */ diff --git a/src/equicordplugins/soundBoardLogger/components/Icons.tsx b/src/equicordplugins/soundBoardLogger/components/Icons.tsx index 61de9c097..155351a07 100644 --- a/src/equicordplugins/soundBoardLogger/components/Icons.tsx +++ b/src/equicordplugins/soundBoardLogger/components/Icons.tsx @@ -7,7 +7,7 @@ import { ChatBarButton, ChatBarButtonFactory } from "@api/ChatButtons"; import { cl } from "@equicordplugins/soundBoardLogger/utils"; import { classes } from "@utils/misc"; -import { Button, ButtonWrapperClasses, Tooltip } from "@webpack/common"; +import { Button, Tooltip } from "@webpack/common"; import { openSoundBoardLog } from "./SoundBoardLog"; @@ -45,11 +45,11 @@ export function IconWithTooltip({ text, icon, onClick }) { look={Button.Looks.FILLED} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} - className={ButtonWrapperClasses.button} + className={cl("discord-button")} onClick={onClick} style={{ padding: "0 4px" }} > -
+
{icon}
diff --git a/src/equicordplugins/soundBoardLogger/styles.css b/src/equicordplugins/soundBoardLogger/styles.css index dd1272210..6bec08122 100644 --- a/src/equicordplugins/soundBoardLogger/styles.css +++ b/src/equicordplugins/soundBoardLogger/styles.css @@ -122,4 +122,30 @@ font-size: 100%; box-sizing: border-box; height: 40px; +} + +/* FIXME: bad name +_7f7a2c5f23327d73 */ +.vc-soundlog-discord-button { + opacity: .7; + align-items: center; + align-self: center; + border-radius: 8px; + cursor: pointer; + display: flex; + justify-content: center; + padding: 10px; + + &:hover { + background: hsl(0deg 0% 100% / 10%); + opacity: 1 + } +} + +/* _3f4f204c3133fb93 */ +.vc-soundlog-button-wrapper { + align-self: center; + display: flex; + flex-direction: row; + gap: 8px; } \ No newline at end of file diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index 931dc23a2..eb3bea0b2 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -184,7 +184,10 @@ export default definePlugin({ }, // If we are rendering the Better Folders sidebar, we filter out everything but the Guild List from the Sidebar children { - match: /unreadMentionsFixedFooter\].+?\}\)\]/, + // match the bottom (NEW) footer + // both the top and bottom one use barClassName + // so we match the call to classNames that's only in the bottom one + match: /\}\),barClassName:.+?\}\)\]/, replace: "$&.filter($self.makeGuildsBarSidebarFilter(!!arguments[0]?.isBetterFolders))" } ] @@ -218,7 +221,7 @@ export default definePlugin({ // If we are rendering the normal GuildsBar sidebar, we make Discord think the folder is always collapsed to show better icons (the mini guild icons) and avoid transitions { predicate: () => settings.store.keepIcons, - match: /(?<=let{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/, + match: /(?<=let ?(?:\i,)*?{folderNode:\i,setNodeRef:\i,.+?expanded:(\i),.+?;)(?=let)/, replace: (_, isExpanded) => `${isExpanded}=!!arguments[0]?.isBetterFolders&&${isExpanded};` }, // Disable expanding and collapsing folders transition in the normal GuildsBar sidebar @@ -230,19 +233,19 @@ export default definePlugin({ // If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded { predicate: () => !settings.store.keepIcons, - match: /folderGroupBackground.+?,(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/, - replace: (m, isExpanded) => `${m}$self.shouldRenderContents(arguments[0],${isExpanded})?null:` + match: /(?=\i\(\(\i,\i,\i\)=>{let{key:.{0,70}"ul")(?<=selected:\i,expanded:(\i),.+?)/, + replace: (_, isExpanded) => `$self.shouldRenderContents(arguments[0],${isExpanded})?null:` }, // Decide if we should render the expanded folder background if we are rendering the Better Folders sidebar { predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always, - match: /\.isExpanded\].{0,110}children:\[/, + match: /--custom-folder-color.{0,110}?children:\[/, replace: "$&$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)&&" }, // Decide if we should render the expanded folder icon if we are rendering the Better Folders sidebar { predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always, - match: /(?<=\.folderGroupBackground.*?}\),)(?=\i,)/, + match: /(?<="span",[^,]{0,50}?,)(?=\i,)/, replace: "!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:" } ] @@ -258,12 +261,12 @@ export default definePlugin({ // One is for visual refresh, one is not, // and each has a bunch of conditions &&ed in front of it. // Add the betterFolders sidebar to both, keeping the conditions Discord uses. - match: /(?<=[[,])((?:!?\i&&)+)\(.{0,50}({className:\i\.guilds,themeOverride:\i})\)/g, + match: /(?<=[[,])((?:!?\i&&)+)\(.{0,50}({className:\i\.\i,themeOverride:\i})\)/g, replace: (m, conditions, props) => `${m},${conditions}$self.FolderSideBar(${props})` }, { // Add grid styles to fix aligment with other visual refresh elements - match: /(?<=className:)\i\.base(?=,)/, + match: /(?<=className:)\i\.\i(?=,"data-fullscreen")/, replace: `"${GRID_STYLE_NAME} "+$&` } ] diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index d5d13d282..3f0dc8436 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -23,10 +23,8 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { NotesIcon, OpenExternalIcon } from "@components/Icons"; import { TooltipContainer } from "@components/TooltipContainer"; import { Devs } from "@utils/constants"; -import { classes } from "@utils/misc"; import definePlugin from "@utils/types"; import { Guild, User } from "@vencord/discord-types"; -import { findByPropsLazy } from "@webpack"; import { Alerts, Clickable, Menu, Parser } from "@webpack/common"; import { Auth, initAuth, updateAuth } from "./auth"; @@ -34,9 +32,7 @@ import { openReviewsModal } from "./components/ReviewModal"; import { NotificationType, ReviewType } from "./entities"; import { getCurrentUserInfo, readNotification } from "./reviewDbApi"; import { settings } from "./settings"; -import { showToast } from "./utils"; - -const BannerButtonClasses = findByPropsLazy("bannerButton"); +import { cl, showToast } from "./utils"; const guildPopoutPatch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild, onClose(): void; }) => { if (!guild) return; @@ -154,7 +150,7 @@ export default definePlugin({ openReviewsModal(user.id, user.username, ReviewType.User)} - className={classes(BannerButtonClasses.bannerButton)} + className={cl("banner-button")} > diff --git a/src/plugins/reviewDB/style.css b/src/plugins/reviewDB/style.css index 2240403b8..9967b6dce 100644 --- a/src/plugins/reviewDB/style.css +++ b/src/plugins/reviewDB/style.css @@ -51,7 +51,7 @@ margin-top: 16px; } -.vc-rdb-review-container { +.vc-rdb-review { padding-top: 8px !important; padding-bottom: 8px !important; padding-right: 32px !important; @@ -131,3 +131,24 @@ .vc-rdb-block-modal-unblock { cursor: pointer; } + +.vc-rdb-banner-button { + align-items: center; + background: var(--redesign-button-overlay-alpha-background); + border: 1px solid var(--opacity-white-8); + border-radius: 50%; + box-sizing: border-box; + color: var(--white); + cursor: pointer; + display: flex; + height: var(--custom-button-button-sm-height); + justify-content: center; + transition: background 50ms ease-in; + width: var(--custom-button-button-sm-height); + + &:active, + &:hover { + background: var(--redesign-button-overlay-alpha-pressed-background); + transition: background .15s ease-out + } +} \ No newline at end of file diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index a7c705948..06ebf15a3 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -25,13 +25,10 @@ import { classNameFactory } from "@utils/css"; import { classes } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; import type { Channel, Role } from "@vencord/discord-types"; -import { findByPropsLazy } from "@webpack"; import { ChannelStore, PermissionsBits, PermissionStore, Tooltip } from "@webpack/common"; import HiddenChannelLockScreen from "./components/HiddenChannelLockScreen"; -const ChannelListClasses = findByPropsLazy("modeMuted", "modeSelected", "unread", "icon"); - export const cl = classNameFactory("vc-shc-"); const enum ShowMode { @@ -566,7 +563,7 @@ export default definePlugin({ LockIcon: ErrorBoundary.wrap(() => ( `${rest},onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` + match: /(?<=!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\1,)/, + replace: (_, bannerSrc) => `onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,` } }, // Group DMs top small & large icon diff --git a/src/webpack/common/classes.ts b/src/webpack/common/classes.ts deleted file mode 100644 index daaf023c7..000000000 --- a/src/webpack/common/classes.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2023 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import * as t from "@vencord/discord-types"; -import { findByPropsLazy } from "@webpack"; - -export const ButtonWrapperClasses: t.ButtonWrapperClasses = findByPropsLazy("buttonWrapper", "buttonContent"); diff --git a/src/webpack/common/index.ts b/src/webpack/common/index.ts index 80223b9ad..f75507e9e 100644 --- a/src/webpack/common/index.ts +++ b/src/webpack/common/index.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -export * from "./classes"; export * from "./components"; export * from "./menu"; export * from "./react";