-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
Add setting to prevent or highlight message overflow #3418
Conversation
I would certainly like some sort of indication why text input is disabled. (Note that this criticism applies to the current mechanism of failing silentyl too!) Just spitballing here, there might be better solutions. |
@Mm2PL I think the concern there may be that visual feedback needs to be on the input text itself. Maybe something similar to what Twitter does: |
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.
This PR does not respect our character counter logic, please make change it to take that into account.
It's still possible to paste messages from the emote popup and paste text via Ctrl+V and right-click menu. I personally don't like the way you achieved this feature with whitelisting keys that could be pressed. IMO It's way better to use a character inserted or text changed event.
This should let me insert more spaces because spaces at the end shouldn't matter:
I've updated it to use a textChanged slot instead of a keyPress event which handles both typing and pasting all in one. This still won't allow extra spaces at the end as you mentioned, but I strongly suggest that shouldn't be possible because it makes the UX side of character limitation unclear. I've also gone ahead and added a red highlight option to this setting (similar to what I mentioned above) because it's another good way of solving the core issue all in one setting. |
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.
Pull request looks nice, I like the idea of letting user know what part of the message won't go through anyway. Got a couple things to point out:
- Name of the setting in Settings dialog (
Message overflow
) isn't very descriptive to an average end user imho. I can't really come up with a better naming, but would like to hear others' opinions about it. cc @Felanbird - I think that
Highlight
option makes sense to be set to as a default setting value instead ofAllow
- bringing in new functionality that isn't enabled by default makes it difficult to discover by users; and I think this isn't anything harmful to set by default.
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.
I've got an issue with the feature as is now. If you type out a very loooong message, change the setting to Prevent
. And then type a character into the filled input will lag Chatterino for a good while. From my testing it turns out that it's because the text changed
event triggers itself recursively. With enough characters Chatterino will segfault (~12k is enough), again probably because of a stack overflow. While this is not really a very bad issue per se, I'm thinking that it's a sign of a mistake somewhere. A possible solution would be to take the input text, clip it to 500 chars and then set it back to the input, leaving only one recursive text changed
event which we can live with. Another solution would be to have some kind of a locking mechanism to make sure that the recursively generated events are safely ignored.
Sorry for the pedantic review.
Fun fact: bt
in my gdb is still going as I'm correcting/expanding this message.
I appreciate the feedback! I'll make changes soon. @zneix I spent longer than I'd like trying to find better wording for this. Originally I was using "Input overtype behavior" but that seemed too wordy. |
@zneix I've changed the default to @Mm2PL The |
So after my testing on fecba0e:
Not sure if you're able to add a separate limit for IRC or something? Then would also need the prevent option fixed. Otherwise it seems to work as intended. |
Apologies for leaving this hanging for so long. Is anyone else able to figure out a good fix for ALazyMeme's feedback? My knowledge is limited. |
I fixed the merge conflicts and fixed the issues ALazyMeme mentioned, right now I only have two concerns that I can get to myself later:
2022-10-30.20-38-37.mp4 |
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.
clang-tidy made some suggestions
Pull request checklist:
CHANGELOG.md
was updated, if applicableDescription
Native Twitch chat prevents the user from typing past 500 characters entirely. Right now, Chatterino only enforces this rule by preventing 501+ characters from being sent. This adds a setting to prevent or highlight input overflow to match the native Twitch functionality.
My motivation to add this comes from some frustration in wanting to send a long message but having to manually delete characters until only 500 were left.
Prevent overflow
Highlight overflow