Added colour field to community tags#6290
Conversation
|
Use the american spelling "color". It's more conventional in programming, including in the Lemmy repository |
|
See my comment here:
Hard-coding colors is the wrong solution, I have no idea who came up with it and why they thought it should be applied to tags and nothing else. The correct solution, if ppl do want to "theme" certain elements, is define a set of ordered enums like |
|
The colors are not hardcoded here, applications can choose their own eg showing red as |
…ult to green, fixed some forgotten renames
Good UI frameworks don't do this any more, because they realize there's too many color conflicts and its impossible to get colors to universally work on different themes. What they do is have a limited set of accent colors, things like primary, secondary, and possibly tertiary colors, and these have their own variants within the theme. https://m3.material.io/styles/color/roles . Bootstrap works the same We should never be defining "red" as a theme option. It should be |
|
To put it another way, colors should only ever be specifically defined in theme definition files. This is how its done in every good UI framework, and even things like text editors color schemes. |
Names like The initial logic would be to work like Bootstrap colors where the client still gets to define the actual color values. |
|
I'd be totally fine with We shouldn't use the bootstrap all colors, but rather the theme colors, IE primary, secondary, tertiary, success, info, etc. These specific colors are picked by the theme-makers, and go well with the themes. In both android jetpack compose and bootstrap, I'd create a map or function that converts these numbered color enums to the theme colors, IE |
…rding to the client's theme
… be restored after deletion, removed previous logic when inserting a deleted tag, updated comment
Should a new endpoint be added to be able to retrieve the deleted tags? A parameter could be added to the /community GET endpoint instead to include the deleted tags, but it seems like worse API design to me. |
|
I'm doing the front end for community tags also, and running into some of these issues. IMO we should just return all (even the deleted tags) in the community view. This way admins will be able to view and restore them if they want. Currently there is no way to view and restore deleted tags. All the selects and dropdowns can just filter by Don't worry about that for this issue, I made #6297 |
Ideally deleted tags are only returned for admins and mods, normal users wont see them anyway. |
dessalines
left a comment
There was a problem hiding this comment.
All looks good except the 20 tags -> down to 10.
|
The relevant changes in LemmyNet/lemmy-js-client#837 need to be merged for the pipeline to pass |
|
I tagged version |
|
Great feature, I'll be using this in both jerboa and lemmy-ui. Thx! |
using the base 16 CSS values.- Also fixed bug after deleting a tag and then inserting one with the sameap_id. Since the tag gets soft deleted andap_idhas a unique constraint, the insertion would fail, so I added a query to check if a deleted tag with the sameap_idexists, and in that case updates withdeleted = falseinstead of inserting.deleteparameter to DeleteCommunityTag to allow the client to restore a deleted tag. Duplicate tags will still throw an error upon insertion even if the tag is soft-deleted.Fixes #5880