From c914bd17c1ee1be272f86d80e777eb08f3c2a9bc Mon Sep 17 00:00:00 2001 From: Rico Date: Thu, 21 May 2026 22:57:44 +0200 Subject: [PATCH 1/4] fix: unbreak twitch chat input --- .../ChatInputControllerModule.vue | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue b/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue index 68974e9b5..355c8c8c1 100644 --- a/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue +++ b/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue @@ -33,16 +33,20 @@ useComponentHook( if (!inst.component.container.parentElement.classList.contains("chat-input")) return cur; const props = (cur as ReactExtended.ReactRuntimeElement).props ?? {}; - const child = (props.children as ReactExtended.ReactRuntimeElement[]).find( + const child = normalizeReactChildren(props.children).find( (c) => c.props.className === "chat-input__buttons-container", ); if (!child) return cur; - const buttons = child.props.children.at(-1); + const buttons = normalizeReactChildren(child.props.children).at(-1); if (!buttons) return cur; + const buttonChildren = normalizeReactChildren(buttons.props.children).filter( + (c) => c.type !== "seventv-chat-input-button-container", + ); + for (const btn of tButtons.values()) { - buttons.props.children.splice(buttons.props.children.length - btn.offset, 0, { + buttonChildren.splice(Math.max(0, buttonChildren.length - btn.offset), 0, { [REACT_TYPEOF_TOKEN]: REACT_ELEMENT_SYMBOL, key: null, ref: btn.parent, @@ -51,6 +55,8 @@ useComponentHook( }); } + buttons.props.children = buttonChildren; + return cur; }, }, @@ -84,6 +90,15 @@ function addButton( return track; } +function normalizeReactChildren(children: React.ReactNode): ReactExtended.ReactRuntimeElement[] { + if (!children) return []; + + return (Array.isArray(children) ? children : [children]).filter( + (child): child is ReactExtended.ReactRuntimeElement => + typeof child === "object" && child !== null && "props" in child, + ); +} + interface InsertedButton { key: string; offset: number; From 12e9e7ef147a45fc84dc7ad3c379a8f22e006366 Mon Sep 17 00:00:00 2001 From: Rico Date: Thu, 21 May 2026 23:50:42 +0200 Subject: [PATCH 2/4] fix: icon alignment --- .../ChatInputControllerModule.vue | 165 +++++++++++------- 1 file changed, 101 insertions(+), 64 deletions(-) diff --git a/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue b/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue index 355c8c8c1..aa8bf940c 100644 --- a/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue +++ b/src/site/twitch.tv/modules/chat-input-controller/ChatInputControllerModule.vue @@ -1,15 +1,13 @@ + + From 561df212f3db02a86788ecceb6be85aea8908436 Mon Sep 17 00:00:00 2001 From: Rico Date: Thu, 21 May 2026 23:56:29 +0200 Subject: [PATCH 3/4] docs: update changelog --- CHANGELOG-nightly.md | 4 ++++ CHANGELOG.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG-nightly.md b/CHANGELOG-nightly.md index e289cce6a..48300760e 100644 --- a/CHANGELOG-nightly.md +++ b/CHANGELOG-nightly.md @@ -1,3 +1,7 @@ +### 3.1.22.1000 + +- Fixed an issue that caused chat input to break after a Twitch update + ### 3.1.21.1000 - Added new extension notice diff --git a/CHANGELOG.md b/CHANGELOG.md index 5825b18ca..c611ac158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 3.1.22 + +- Fixed an issue that caused chat input to break after a Twitch update + ### 3.1.21 - Added new extension notice From 326acb9256ae0455b4d7b0ae1e2e43df3c6c4e36 Mon Sep 17 00:00:00 2001 From: Rico Date: Thu, 21 May 2026 23:56:46 +0200 Subject: [PATCH 4/4] chore(release): bump to 3.1.22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac07570c9..de4728006 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "7TV", "description": "Improve your viewing experience on Twitch & Kick with new features, emotes, vanity and performance.", "private": true, - "version": "3.1.21", + "version": "3.1.22", "dev_version": "1.0", "scripts": { "start": "cross-env NODE_ENV=dev yarn build:dev && cross-env NODE_ENV=dev vite --mode dev",