-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emote Side Panel #212
Emote Side Panel #212
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple notes for you, but the main thing is you need to set enabled to true in the manifest.
src/emote-side-panel/index.js
Outdated
class EmoteSidePanel extends Addon { | ||
|
||
getContainer() { | ||
return document.querySelector("[aria-label='Chat messages']"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use .chat-list--default
to get this element. Using an aria-label
to pick an element is a bad practice because it's a localized string. This means it'll only work for users with Twitch in English.
if (emoteOnly && !keepEmoteMessages) msg.ffz_removed = true; | ||
|
||
// Add emotes to the list | ||
for (const token of tokens) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Messages can be re-tokenized for various reasons, which can cause this code to run again. Given the design of your add-on, you might want to put a flag on the message object as a sort of "we already processed this" so you don't re-add emotes from old chat messages you already handled before. Just like if ( msg.esp_handled ) return tokens;
and msg.esp_handled = true;
src/emote-side-panel/manifest.json
Outdated
@@ -0,0 +1,13 @@ | |||
{ | |||
"enabled": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to set "enabled" to true
, otherwise your add-on won't be built and published.
Thanks for the review! Made all suggested changes. For me, the chat panel doesn't have this class, but .chat-list--other, so i'm selecting both. |
New Add-On: Emote Side Panel
Based this on the Emote Less Chat add-on by EchtkPvL, but instead of only deleting the emote chat lines, I display the emotes on a side panel located right side to the chat. The emotes are removed after a configurable timeout.
If more than one chat contains the same emote, they are gathered and a counter is displayed on top of it.
There's also a setting to capture emotes from all chat lines, and an option to only capture emotes and do not remove the chat line.
With this, fast rolling chats are much more readable.