From 4a35cf1769f2f6bc178451b5641140ef06e478b5 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 23 Aug 2025 01:57:27 +0200 Subject: [PATCH] Toolbox: fix & move to the titlebar --- src/plugins/vencordToolbox/index.tsx | 31 ++++++++++------------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/plugins/vencordToolbox/index.tsx b/src/plugins/vencordToolbox/index.tsx index af9fbc87f..1bc97cf56 100644 --- a/src/plugins/vencordToolbox/index.tsx +++ b/src/plugins/vencordToolbox/index.tsx @@ -94,7 +94,7 @@ function VencordPopoutIcon(isShown: boolean) { ); } -function VencordPopoutButton() { +function VencordPopoutButton({ buttonClass }: { buttonClass: string; }) { const buttonRef = useRef(null); const [show, setShow] = useState(false); @@ -111,7 +111,7 @@ function VencordPopoutButton() { {(_, { isShown }) => ( setShow(v => !v)} tooltip={isShown ? null : "Vencord Toolbox"} icon={() => VencordPopoutIcon(isShown)} @@ -122,33 +122,24 @@ function VencordPopoutButton() { ); } -function ToolboxFragmentWrapper({ children }: { children: ReactNode[]; }) { - children.splice( - children.length - 1, 0, - - - - ); - - return <>{children}; -} - export default definePlugin({ name: "VencordToolbox", - description: "Adds a button next to the inbox button in the channel header that houses Vencord quick actions", + description: "Adds a button to the titlebar that houses Vencord quick actions", authors: [Devs.Ven, Devs.AutumnVN], patches: [ { - find: ".controlButtonWrapper,", + find: '"M9 3v18"', replacement: { - match: /(?<=toolbar:function\(.{0,100}\()\i.Fragment,/, - replace: "$self.ToolboxFragmentWrapper," + match: /focusSectionProps:"HELP".{0,20},className:(\i\.button)\}\),/, + replace: "$& $self.renderVencordPopoutButton($1)," } } ], - ToolboxFragmentWrapper: ErrorBoundary.wrap(ToolboxFragmentWrapper, { - fallback: () =>

Failed to render :(

- }) + renderVencordPopoutButton: (buttonClass: string) => ( + + + + ) });