-
-
Notifications
You must be signed in to change notification settings - Fork 119
add option to randomize new tag colors #534
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
base: main
Are you sure you want to change the base?
Conversation
Sorry for getting back to this after so long. Generating the color from the name was an early idea to give unique (pseudo) random colors to tags, without actually needing to store the color. I think we can re-use that idea here? Right now, when using "random colors", the color changes every time a tag is shown, so it should look like a dico or something? 😅 What if the default tag color can be "from name" or "yellow"? |
also tidy up the settings dialog options per feedback
No worries 🙂
I see, makes sense. I don't know if there's a way to keep the from tag name option without have the "disco" colors since changing the tag name would then have to change the color. Maybe the tag color could be generated when the dialog closes, but IMO I'd prefer to see the color in the dialog even if it's changing as you type.
Yeah, agreed that was definitely the most jarring part of this. I've updated the "random" option in the most recent commit to generate the next color once when you open the dialog, and use that for any new tag created in that dialog. It's not perfect since creating multiple tags in the same dialog will result in them all having the same color, but I think it's still an improvement from always having new tags be yellow.
Hopefully I understood this correctly, but I updated the selection options in the settings dialog to be "Yellow", "From Name", and "Random". Yellow = current brand yellow default Let me know what you think! I'd love to get this integrated if you like the changes. |
Oh, and I also added a small bug fix to the random color generation. I noticed it would generate colors with a leading zero, e.g. |
So if I know create a new tag, and have it set to random colors, in what cases will it change color?
|
Nice! 🙏 |
It should only get a new color when the tag is created. It's using the same mechanism as clicking "random" from the edit tag dialog to generate the color, and the color is saved to the tag store like a custom color. Reloading the app should not affect the existing tag colors. |
@almarklein friendly poke🙂 Do you have any other feedback for this PR or could it be merged? |
I think there's still a few problems with this PR, like using the settings to set All of these problems can be solved by using the color by name feature. So two options for the default color: Yellow, or byname. You can still call it random in the form and use the from-name implementation. |
Ah okay, I see the point you were trying to make earlier now regarding the color by name. Thanks for the feedback!
What are the steps to reproduce this? When I tested the pressing the "default" button in the tag color dialog, it still used the default yellow color iirc.
I'm not sure if I entirely agree with this statement however. I think using the color by name will still end up with the "disco" colors while typing out a new tag, unless the tag color is not generated until after the dialog is closed. I think a better option may be to still generate random colors, and store those in color generator class rather than the settings. To fix the issue of new tags sharing the same random color, the random color can just be popped each use to cause the next one to be new. |
This is not too bad in itself. But the thing is that a tag is assigned as soon as it encountered. So let's say that we accept the PR as it is now. What happens for all users is this:
Basically, the fact that tag colors are assigned based on whether they are shown or not is very unpredictable and will be annoying. Using the color-by-name fixes this, because it does not need to store the color. I agree that the tag changing color as you type it looks a bit funny, but IMO that's a small price to pay. |
Gotcha, yeah I was able to reproduce this now with your latest comment. I agree past tags changing color is not the intent, and would be confusing.
This part however was intentional, so I'd like to keep that behavior, and using the from name option is a creative way to solve that issue. I did not realize that currently the default color is not being saved to the DB with each new tag, and that definitely limits the available options. I'll update this PR in a bit with those changes. Thanks for taking a look. |
Hello! This PR is mostly a draft of an idea, so open to suggestions or contributions for how to improve this.
I like to have colorful tags to create visual distinction on my timeline, but I don't really care to set colors myself, and manually randomizing the color each time is somewhat annoying since I commonly make new tags. This PR adds an option to the user settings for how to determine the default tag color. The options I added are:
This seemed mostly functional when I tested it, but there's definitely some room for improvement. A couple notes: