-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[GH-190] Add global option to disable randomized card icons #310
[GH-190] Add global option to disable randomized card icons #310
Conversation
const toggleRandomIcons = () => { | ||
UserSettings.prefillRandomIcons = !UserSettings.prefillRandomIcons | ||
setRandomIcons(!randomIcons) | ||
} |
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 is admittedly a little odd because the setting state is maintained in two separate spots (UserSettings
and randomIcons
) but I couldn't find a better way to make the component re-render when changing the setting. Would be happy to hear recommendations on this.
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.
Yes, probably we can move this into its own hook and make the concept of "userSettings" something that is properly encapsulated. But for now I think is ok as is now.
5a23226
to
5493e8a
Compare
Hm, I'm unsure what the error here is. 🤔 |
…card icons Relates to: mattermost-community#190
5493e8a
to
7c07ef8
Compare
Eliminated the enum in favor of string literals. I think the linting error was a false positive but I couldn't find out how to silence it and keep the enum. |
I like this idea, but I don't know if this should be per user, or per board, and probably we should store that information on the server. What do you think @chenilim? |
I think this is fine as a per-user setting for now. For Personal Desktop it makes no difference, and we haven't implemented any other configurable per-server (actually per-workspace) settings yet. In the long run, I can imagine multiple layers, i.e.:
|
@Johennes Thank you for your PR this is wonderful! I completely understand your wish and I have the same. But I think all our wishes are different. I'm not certain if this is the right way to cover all the wishes. Wouldn't it be more helpful to redefine/edit the default-template for a new card per board? Pro
Con
|
@signalwerk being able to change the default card template for a board would be great, agreed. For my personal use case that would be slightly less convenient than a single global "no random icons" setting. But I could live with that since I only have a small number of boards. @chenilim / @jespino what do you think? Should we rather make the default template per board editable? For the time being, I converted this PR to a draft because storing the global setting currently doesn't work in the native apps due to #314.
Ah, no worries about that. What I did here so far was pretty basic so I wouldn't have hard feelings if it was discarded for something better. 🙂 |
Thanks for adding to the discussion. In the long run, I see several buckets of settings / preferences, e.g.:
In general, for non-security related things, the precedence should be bottom up. i.e. a user can override board or server defaults. Auto-emoji is an example of this, because the user can always set a random emoji anyway. The setting just saves them time. Also, at this point in the project, we should err on the side of speed. It's ok to add desired functionality that can be refined later. So, I'm happy to merge this change, and keep issue #190 open to add the other levels of settings later. |
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 good to me. Thanks @Johennes! 🎉
Summary
This does the minimum work for #190 by adding a global settings option to disable random icons on newly created cards.
Ticket Link
Partially fixes #190