Feat: Highlighting by username and badges #1054
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
At the moment users were only able to highlight certain phrases in chat messages. They should be able to highlight also dependant on user and badges.
Feature Request: #1027
Types of changes
What types of changes does your code introduce to 7TV?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
Basically 2 new features were added.
Highlighting by username: The users can provide a username. If a chatmessage has an author with that name it is highlighted. Since regex and case sensitivity don't really make sense for usernames I removes the options for those.
![image](https://private-user-images.githubusercontent.com/103491518/347964410-26dbfb2b-e353-447b-b389-5bd1972082f0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODAyOTAsIm5iZiI6MTcyNTk3OTk5MCwicGF0aCI6Ii8xMDM0OTE1MTgvMzQ3OTY0NDEwLTI2ZGJmYjJiLWUzNTMtNDQ3Yi1iMzg5LTViZDE5NzIwODJmMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3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37xa9wDGOe1IaKm6MKPa8WnC54S5ta0)
Additionally a button was added to user cards to quickly toggle highlighting for the user.
Highlighting by badge: The user can select a badge from a list and all users with this badge have their messages highlighted.
![image](https://private-user-images.githubusercontent.com/103491518/347966251-bbd398bf-7ae7-457c-9c5a-9553ea39e3c3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODAyOTAsIm5iZiI6MTcyNTk3OTk5MCwicGF0aCI6Ii8xMDM0OTE1MTgvMzQ3OTY2MjUxLWJiZDM5OGJmLTdhZTctNDU3Yy05YzVhLTk1NTNlYTM5ZTNjMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkxMFQxNDUzMTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lYWQxNWI5ZGZiMmQyYTNkYjk4YjYxZTVlYzU3NDQwN2NmZDkzYTE5ZTBjZGQ0YzY2YjRjZTQ5OTQ0OTBmMWMxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.IdJ28meUmSA1h4T2EDJMMjMbp6PiqBnfteZ0cOsEI8c)
The list of badges is grabbed directly from twitch, so no manual changes have to be made when badges are added or removed.
For a future update it could make sense to also add a way to change priority of highlights (for cases where messages fit multiple highlighting settings). At the moment the highlight which was created last has the highest priority, regardless of which kind of highlight it is.
Another idea for teh future could be adding 3rd party badges to the list for highlighting.