Add context menu for ignoring users#1516
Conversation
e04be62 to
474f053
Compare
|
This unfortunately touches on another sore area, which is the inability to update the configuration at run-time. This, like UI config/preferences, is also blocking a lot of stuff, and there are no good solutions because most YAML libraries don't support "round tripping" (loading into memory, modifying, saving back to YAML) that preserves comments. Because slskd leans heavily on the commented-out config it creates on startup as documentation, this would be a bad experience for a lot of users. I have thought a lot about this over the years and the options are pretty much:
I don't really like either of these, which is why everything that would depend on this has been blocked |
5579238 to
c7733e8
Compare
|
Ok so good news, in addition to the Document api, this yaml library also provides CST parsing which does preserve everything, not just semantically useful stuff (the document api would reformat whitespacing). This seems to work well for me, just a little more complex. Let me know what you think. Referencing: |
|
Hi @jpdillingham, Also getting back to this PR. I see I found a library that I believe does what we want wrt YAML parsing. Do you want me to assemble some sort of test suite to demonstrate various edge cases? That shouldn't be too tedious. |
- adding logic for empty members list - adding logic to handle names with spaces, quotes, backslashes, apostrophes, etc. - added jest test suite to validate behavior
- updating docs - adding ability to select what handlers you want for a context menu - adding dm user handler for context menu in rooms
b2c947a to
68b2109
Compare
|
Ok I found a number of issues with the logic, so I cleaned it up and added a test suite that we can use to validate behavior and prevent regression. I also needed to update after the merge changed the options schema. I also added the ability to select which handlers are implemented on each page so in the future I can add a dm user feature that will only be present on rooms. |
|
I'm going to take a stab at writing a C# library that can handle round-trip serialization of YAML; theoretically it should be straightforward if I don't worry about every edge case and just focus on the slskd options document. If I can pull it off, I'll be able to add an API for updating options and a lot of things get unblocked |
Add Context Menu for Ignoring Users
Description
Adds an option in the context menu to ignore users. Feature works by modifying blacklisted user group in config.
Changes
Justification
I had a hard time chosing how to implement the ignore feature since slskd has two methods of ignoring a user and neither are plainly exposed through an api. Reasons for using blacklisted group in options: