colorstackorg / oyster

Monorepo that houses ColorStack's core product software.
MIT License
105 stars 67 forks source link

Tag isn't excluded from search if already selected 🏷️ #273

Open ramiAbdou opened 1 month ago

ramiAbdou commented 1 month ago

Description

When choosing tags for a resource, we show a dropdown with search functionality for all of the available tags. Once a tag is selected, it still appears in that dropdown, though it doesn't really make sense to since we already show selected tags using pills. We should exclude any tags that are already selected.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to /resources/add to add a resource.
  2. Select a tag in the "Tags" field.
  3. The selected tag will still show up in the dropdown.

Expected Behavior

After selecting a tag in the "Tags" field, it should not show up.

Screenshots

In this screenshot, the tag AI is selected but still shows up in the dropdown.

Screenshot 2024-06-04 at 2 56 45 PM

Additional Context

In the listTags function, we'll need to modify it so that way we can exclude certain tag IDs.

jessherlitz commented 1 month ago

Hello! I'd like to work on this if possible. This would be my first contribution as well. Thank you!

ramiAbdou commented 1 month ago

You got it @jessherlitz!

ramiAbdou commented 1 month ago

@jessherlitz Just updated the description, let me know if you need any other context here!

jessherlitz commented 3 weeks ago

Hi @ramiAbdou! I fixed the bug but I noticed there were other bugs happening within the tag form field. I didn't try to fix the other bugs because I saw you assigned one of the bugs to somebody else (bug 272) and I didn't want to cause merge conflicts. I also saw that clicking on the x to remove a tag doesn't repopulate the tag back in the dropdown. I didn't fix that one because it wasn't a part of this ticket and didn't want to cause merge conflicts. Should I just finish this one and file another ticket for the other bugs? Or what should I do? Thank you.

tomas-salgado commented 3 weeks ago

@jessherlitz Regarding repopulating the dropdown, it might be worth trying to fix that bug here since it seems very related to the logic of having the right tags appearing in the dropdown. However in the meantime feel free to put a draft PR with what you have so far!

jessherlitz commented 3 weeks ago

Thank you! I am working on it.