From aa2054d32394143fb98537e2e6368f80a9be5a89 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Wed, 8 Apr 2026 10:57:24 -0400
Subject: [PATCH] BetterSessions: Fix Margins & New Button
---
.../components/RenameButton.tsx | 12 +++++++++++
.../betterSessions/components/icons.tsx | 8 ++++++++
src/plugins/betterSessions/index.tsx | 20 ++++++-------------
src/plugins/betterSessions/styles.css | 9 +++++++++
src/plugins/decor/index.tsx | 2 +-
src/plugins/experiments/index.tsx | 14 +++++++++----
6 files changed, 46 insertions(+), 19 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..fcdfbfece 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";
@@ -61,7 +61,7 @@ export default definePlugin({
patches: [
{
- find: "#{intl::AUTH_SESSIONS_SESSION_LOG_OUT}",
+ find: "#{intl::AUTH_SESSIONS_OTHERS_LOG_OUT_SELECTED_ACTION}",
replacement: [
// Replace children with a single label with state
{
@@ -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
-
+
)}
>
@@ -143,7 +135,7 @@ export default definePlugin({
color: "var(--background-base-lower)",
}}
>
-
+
}
lowerBadgeSize={{
diff --git a/src/plugins/betterSessions/styles.css b/src/plugins/betterSessions/styles.css
index 47613ac71..adfc283f0 100644
--- a/src/plugins/betterSessions/styles.css
+++ b/src/plugins/betterSessions/styles.css
@@ -7,4 +7,13 @@
.vc-betterSessions-rename-btn {
margin-left: 4px;
translate: 0 -2px;
+ width: fit-content;
+}
+
+.vc-betterSessions-new-btn {
+ margin-left: 4px;
+ translate: 0 -2px;
+ width: fit-content;
+ 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 0a5ff0569..f9a3cf452 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 7cb7646b2..3e39182be 100644
--- a/src/plugins/experiments/index.tsx
+++ b/src/plugins/experiments/index.tsx
@@ -65,10 +65,16 @@ 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(),"
+ },
+ {
+ match: /(?<=marginBottom:16)(?=\},)/,
+ replace: ',flexDirection:"row",alignItems:"center"'
+ }
+ ]
},
// Change top right toolbar button from the help one to the dev one
{