-
-
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
feat: Warn for commands with duplicate triggers #4322
feat: Warn for commands with duplicate triggers #4322
Conversation
I think the friendliest way to handle this atm will be to not stop the user from renaming or creating commands with specific names, but to mark all commands with duplicate entries. This can be done by making them slightly yellow, or adding a |
Marked it as a draft until it solves it (or you think it solves the issue), feel free to poke me at any time before that if you want a review of the code or way you're trying to handle it |
clang-tidy review says "All clean, LGTM! 👍" |
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
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
@pajlada what do you think of this approach? Am I overcomplicating things? The code is able to set text colors and add/remove the warning label as duplicates are added/removed but currently runs into an issue when it tries to set the color after removing an item or moving it up/down so not sure if I need a mutex somewhere or something. |
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.
Looks alright, let's review in parts so you can work on these things first
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
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.
With this PR I'm able to crash Chatterino by:
- Removing the last row (maybe removing any row?)
- Dragging one row onto another
I don't think a button for this is the right approach - if it cannot be figured out automatically then I don't think it provides much value for users |
If it's just there for you while testing then my bad, bit fast with the comments 😎 |
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
Doesn't seem to be checking duplicates on row removal, and doesn't handle renaming from one duplicate to another duplicate well |
@pajlada that's interesting, both those cases work on my machine. I'll record a video when I get a chance. Should be fun to debug lol. |
…serted, rowsRemoved, and dataChanged signals
Was able to repro. Wasn't happening before since I was testing duplicate commands that weren't the one just added. Changed the signals and seems to work now |
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.
lgtm
Pull request checklist:
CHANGELOG.md
was updated, if applicableDescription
Fixes #2497
Added warning tooltip for when user selected another cell and previous command name was a duplicate. Tried to force selection to the duplicate cell with the following
But didn't seem to work. Could leave as is with just tool tip warning or open to suggestions for methods to force user to change duplicate command name