activist-org / activist

An open-source activism platform
https://activist.org
GNU Affero General Public License v3.0
229 stars 187 forks source link

Add selection state to tags in GridFilterTags #556

Closed andrewtavis closed 6 months ago

andrewtavis commented 10 months ago

Terms

Description

We have the component GridFilterTags that provides tags for filtering search and page results. We as of now don't have styling added for when one of the options is selected. Potentially look into refactoring this component with a Headless UI component like radio group would be good to achieve this, but we'd also need to make sure that we allow for selecting more than one option and also deselecting an option.

Contribution

Happy to support with this or get to it myself eventually! This is a great good first issue for someone wanting to contribute to activist for the first time, and is of course open for those already in the contributor base.

Let's first discuss the implementation and then we can go from there! 🚀

keythroy commented 10 months ago

I can try to help on this one

andrewtavis commented 10 months ago

Thanks @keythroy! Just assigned you :) Let's be sure to check whether radio group can allow for selecting more than one option and deselecting all of them before we get too deep into this.

Looking forward to this!

andrewtavis commented 8 months ago

Hey @keythroy 👋 Hope all's well! Let us know if there's anything we can do to support with this! 😊

UnknownSean8 commented 7 months ago

Hi @andrewtavis, I can work on this, thanks! :P

andrewtavis commented 7 months ago

Thanks @UnknownSean8! Let me know if there's anything I can do to support :)

UnknownSean8 commented 7 months ago

Hi @andrewtavis, sorry for the delay! I will push the changes by this Sunday at the latest. :P

andrewtavis commented 6 months ago

No stress, @UnknownSean8! Looking forward to them :)

UnknownSean8 commented 6 months ago

Hi @andrewtavis, I was wondering if it's better to use the previous #276 CardTopicSelection component to implement this so we have a more consistent component. I saw the design in Figma it's rather similar, I can modify the current component to be more customisable.

Also, I can use the Switch component in HeadlessUI to implement the GridFilterTags, it follows the check box accessibility except the arrow keys navigation. But ofc, I can also implement the arrow keys navigation here.

Sorry for the confusing comment hahaha, I think what I want to say is:

  1. Change the CardTopicSelection component to use the Switch component instead of the current implementation.
  2. Make the CardTopicSelection component (or create a new component) to be more customisable to fit the GridFilterTags.

Current implementation using HeadlessUI switch component.

Screenshot 2024-03-19 at 1 36 18 AM

What do you think? Thanks!

andrewtavis commented 6 months ago

Hey @UnknownSean8! This is a great point :) Really happy you ended up working on this as the overall UI wasn't 100% thought through and you're the perfect person to help with this 😊 I think that this component resembling the topics one makes total sense, but I'm unsure on one point. Are users allowed to select multiple tags? Here's how I see it:

My initial idea here was that a person would not be able to filter by more than one tag as we're getting into a territory where the quality of results would be a bit restricted. Think of this like tags on GitHub repos where I don't think we can search for more than one at a given time.

Let's check with @therealhoppi on this :) What were you thinking on tags being selected to filter search results?

andrewtavis commented 6 months ago

Talked with @therealhoppi about this, @UnknownSean8 :) He said that to him a multi select would be good and we can test from there. Basically what we're looking for then is a component that has the selection and accessibility of CardTopicSelection, but without the input filter or the rest of the card. Do you think it's possible to make a component that has just that and then put it inside CardTopicSelection? We could call it TopicTagSelector.vue or something like that?

andrewtavis commented 6 months ago

Closed via #785 🥳 Thanks @UnknownSean8!