From 0d75636ee7b8bf7bc9ebdad67717901b93523552 Mon Sep 17 00:00:00 2001 From: thororen <78185467+thororen1234@users.noreply.github.com> Date: Sun, 12 Apr 2026 15:14:15 -0400 Subject: [PATCH] fix Decor, BetterSession & Experiments (#4107) --- .../betterSessions/components/RenameButton.tsx | 12 ++++++++++++ src/plugins/betterSessions/components/icons.tsx | 8 ++++++++ src/plugins/betterSessions/index.tsx | 16 ++++------------ src/plugins/betterSessions/styles.css | 7 +++++++ src/plugins/decor/index.tsx | 2 +- src/plugins/experiments/index.tsx | 16 ++++++++++++---- src/plugins/reviewDB/components/ReviewsView.tsx | 7 ++++--- 7 files changed, 48 insertions(+), 20 deletions(-) diff --git a/src/plugins/betterSessions/components/RenameButton.tsx b/src/plugins/betterSessions/components/RenameButton.tsx index b9857f01d..c1c24d2e2 100644 --- a/src/plugins/betterSessions/components/RenameButton.tsx +++ b/src/plugins/betterSessions/components/RenameButton.tsx @@ -30,3 +30,15 @@ export function RenameButton({ session, state }: { session: SessionInfo["session ); } + +export function NewButton() { + return ( + + ); +} diff --git a/src/plugins/betterSessions/components/icons.tsx b/src/plugins/betterSessions/components/icons.tsx index a9f0f989e..cbfbe0053 100644 --- a/src/plugins/betterSessions/components/icons.tsx +++ b/src/plugins/betterSessions/components/icons.tsx @@ -25,6 +25,7 @@ export const DiscordIcon = (props: React.PropsWithChildren @@ -35,6 +36,7 @@ export const ChromeIcon = (props: React.PropsWithChildren @@ -48,6 +50,7 @@ export const EdgeIcon = (props: React.PropsWithChildren> {...props} fill="currentColor" viewBox="0 0 24 24" + style={{ marginLeft: "0.0.0043403em", marginTop: "0.46px" }} > @@ -58,6 +61,7 @@ export const FirefoxIcon = (props: React.PropsWithChildren @@ -68,6 +72,7 @@ export const IEIcon = (props: React.PropsWithChildren>) {...props} fill="currentColor" viewBox="0 0 512 512" + style={{ marginLeft: "0.0.00434028em", marginTop: "0.456px" }} > @@ -78,6 +83,7 @@ export const OperaIcon = (props: React.PropsWithChildren {...props} fill="currentColor" viewBox="0 0 496 512" + style={{ marginLeft: "0.00434027777em", marginTop: "2px" }} > @@ -88,6 +94,7 @@ export const SafariIcon = (props: React.PropsWithChildren @@ -98,6 +105,7 @@ export const UnknownIcon = (props: React.PropsWithChildren diff --git a/src/plugins/betterSessions/index.tsx b/src/plugins/betterSessions/index.tsx index b6dabbaa0..a0b5291e7 100644 --- a/src/plugins/betterSessions/index.tsx +++ b/src/plugins/betterSessions/index.tsx @@ -26,7 +26,7 @@ import definePlugin, { OptionType } from "@utils/types"; import { findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack"; import { Constants, React, RestAPI, SettingsRouter, Tooltip } from "@webpack/common"; -import { RenameButton } from "./components/RenameButton"; +import { NewButton, RenameButton } from "./components/RenameButton"; import { Session, SessionInfo } from "./types"; import { fetchNamesFromDataStore, getDefaultName, GetOsColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils"; @@ -74,8 +74,8 @@ export default definePlugin({ }, // Replace the icon { - match: /children:\[(?=.{0,125}?width:"32")(?<=,icon:(\i)\}.+?)/, - replace: "children:[$self.renderIcon({...arguments[0],DeviceIcon:$1}),false&&" + match: /(?<=Icon:(\i).{0,250}className:\i\.\i,children:\[)/, + replace: "$self.renderIcon({...arguments[0],DeviceIcon:$1}),false&&" } ] } @@ -92,15 +92,7 @@ export default definePlugin({ <> {title} {(savedSession == null || savedSession.isNew) && ( -
- NEW -
+ )} diff --git a/src/plugins/betterSessions/styles.css b/src/plugins/betterSessions/styles.css index 47613ac71..fafba1ed0 100644 --- a/src/plugins/betterSessions/styles.css +++ b/src/plugins/betterSessions/styles.css @@ -7,4 +7,11 @@ .vc-betterSessions-rename-btn { margin-left: 4px; translate: 0 -2px; +} + +.vc-betterSessions-new-btn { + margin-left: 4px; + translate: 0 -2px; + pointer-events: none; + padding: 1px 4px; } \ No newline at end of file diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index fc2e93a99..f47cc1f1b 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -50,7 +50,7 @@ export default definePlugin({ find: "80,onlyAnimateOnHoverOrFocus:!", replacement: [ { - match: /(?<==)\i=>{let{children.{20,200}isSelected:\i=!1.{0,5}\}=\i/, + match: /(?<==)\i=>{let{children.{20,200}isSelected:\i.{0,5}\}=\i/, replace: "$self.DecorationGridItem=$&", }, { diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 8085a0ca3..ede964457 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -74,10 +74,18 @@ export default definePlugin({ }, { find: 'placeholder:"Search experiments"', - replacement: { - match: /(?<=children:\[)(?=\(0,\i\.jsx?\)\(\i\.\i,{placeholder:"Search experiments")/, - replace: "$self.WarningCard()," - } + replacement: [ + { + match: /(?<=children:\[)(?=null!=.{0,150}"Installation ID:)/, + replace: "$self.WarningCard()," + }, + // for some reason the installation id and copy buttons are on + // different lines so it looks stupid when the card above is added + { + match: /(?<=,marginBottom:16)(?=\},children:\[)/, + replace: ',flexDirection:"row",alignItems:"center"' + } + ] }, // Change top right toolbar button from the help one to the dev one { diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 55bedf48f..e53e0bbd5 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -65,10 +65,11 @@ export default function ReviewsView({ fallbackValue: null, deps: [refetchSignal, signal, page], onSuccess: data => { - if (settings.store.hideBlockedUsers) - data!.reviews = data!.reviews?.filter(r => !RelationshipStore.isBlocked(r.sender.discordID)); + if (settings.store.hideBlockedUsers) data!.reviews = data!.reviews?.filter(r => !RelationshipStore.isBlocked(r.sender.discordID)); + const systemReviews = data!.reviews.filter(r => r.type === ReviewType.System); + const normalReviews = data!.reviews.filter(r => r.type !== ReviewType.System); - data!.reviews.reverse(); + data!.reviews = [...systemReviews, ...normalReviews.reverse()]; scrollToTop?.(); onFetchReviews(data!); }