Skip to content

Make topics a "tag/label" system instead of a "category" system #11

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

Open
JelteF opened this issue Jan 31, 2025 · 4 comments
Open

Make topics a "tag/label" system instead of a "category" system #11

JelteF opened this issue Jan 31, 2025 · 4 comments
Assignees

Comments

@JelteF
Copy link
Collaborator

JelteF commented Jan 31, 2025

Often patches fall in multiple of the topics. So we should replace it with a many-to-many system as opposed to a many-to-one relationship. We should probably also rename it to "tag" instead of "topic". These changes would allow us to add many more useful labeling, like "good-first-review".

@JelteF JelteF changed the title Make topics a "tag" system instoad of a "category" system Make topics a "tag" system instead of a "category" system Feb 1, 2025
@JelteF JelteF changed the title Make topics a "tag" system instead of a "category" system Make topics a "tag/label" system instead of a "category" system Feb 19, 2025
@JelteF
Copy link
Collaborator Author

JelteF commented Feb 27, 2025

@jchampio do you wanna assign yourself here?

Also for future reference, some of my thoughts on this from a thread on discord:

  1. don't duplicate entries on the page
  2. add a tags column
  3. I'd be fine with doing a hard removal of categories if the tags feature has filtering support (the category feature is really underdesigned). But going for incremental additions seems fine too.
  4. Should we call them tags or labels?
  5. We probably (eventually) want colors for tags. Tag coloring sounds like a great usecase for this oklch (it's a semi-new color type CSS) thing I learned about recently: https://oklch.com/#70,0.1,140,100 People could pick a "hue" and maybe a "chroma" and you have colors that are all the same lightness so.

@jchampio
Copy link
Contributor

@JelteF I think I need collaborator permission first, but yes.

@JelteF
Copy link
Collaborator Author

JelteF commented Feb 27, 2025

Apparently it was enough for you to respond here for me to be allowed to add you as the assignee.

@polobo
Copy link
Contributor

polobo commented Apr 6, 2025

A tag/label feature is a high priority for me but I wouldn't expect or try to replace the existing Topic model; though tweaking the available topics is on the table. I would go with tags but I'd be pressed to explain why.

JelteF added a commit that referenced this issue Jun 16, 2025
A Tag is an arbitrary label for a patch in the Commitfest UI. Other than
helping users identify patches of interest, it has no other semantic
meaning to the CF application. This addresses #11 and #67.

Tags are created using the administrator interface. They consist of a
unique name and a background color. The color should be sent from
compliant browsers in `#rrggbb` format, which is stored without backend
validation; to avoid later CSS injection, any non-conforming values are
replaced with black during rendering.

It also includes some javascript to help admins pick colors that aren't
completely eye-gouging, by putting up an (ignorable) warning if we don't
meet baseline [WCAG
recommendations](https://www.w3.org/WAI/WCAG22/Techniques/general/G18.html)
on text contrast.

## Notes

- To avoid putting a separate name+color copy of every tag into each row
of the `patchlist` query, I instead grab the tag IDs and look them up in
a map at render time. I think this requires `@transaction.atomic` to tie
the map and patches together, which I've added across the entire view
for simplicity.
- Backend validation for the color didn't make a whole lot of sense to
me, since only admins can create tags and we escape at time-of-use
anyway.

## Screenshots
Admin interface:

![image](https://github.com/user-attachments/assets/8061a2d1-1d5b-456b-99bb-4af5d6dc79fc)
User interface:

![image](https://github.com/user-attachments/assets/9c95b307-c6e2-48c8-bd65-881c08429a96)

---------

Co-authored-by: Jelte Fennema-Nio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants