civictechindex / CTI-website-frontend

Join a worldwide movement to catalog 
every open source 
civic tech project.
https://civictechindex.org
MIT License
30 stars 30 forks source link

BACKEND: Tag Generator #1050

Open shinjonathan opened 3 years ago

shinjonathan commented 3 years ago

As a user, I would like to have already created tags to be suggested to me so I don't create unnecessary duplicates.

If I were to type food, any matching tags should be suggested to me.

(Will likely look like a chip/autocomplete feature -- with room to add an additional tag)

Test Cases:

A) Food Food Bank Food Oaisis => food-bank Food Desert

B) COVID-19 Coronavirus => covid-19 Pandemic

The user should be able to add their own tag if necessary.

Front End Considerations: We should investigate using chips for autocomplete + multiple tags.

https://www.npmjs.com/package/material-ui-chip-input

shinjonathan commented 3 years ago

@chalimar ^ Have a quick recommendation on the tag generator

chalimar commented 3 years ago

Hi team @shinjonathan @ExperimentsInHonesty @jsachsman @ayusheeaithal

image

shinjonathan commented 3 years ago

Looks great.

One consideration would also be how these topics/causes/issues should resolve into tags (should we autocomplete the topic keyword and assign a tag to that)?

^^ Someone please let me know if that sounds like gibberish... so I can rephrase that.

giosce commented 3 years ago

I think we need to keep the distinction between frontend and backend. We discussed a bit I think on frontend too. My suggestion and understanding on what we agreed is that the user either select on of the suggested tag or enter a new one.

The universe of tags needs to be stored (our database or any storage place). 2 services: a) given a 3 letters or more, returns a list of matching tags (id, text) b) save the tags: existing tags will come with id and text, new tags will have no id (or id 0 or -1). Existing tags will be sent to github (assuming, if I understood correctly that project’s tags are persisted only in github) only, new tags will also be added to the persisting universe of tags (in proper format, with a new id).

A challenge? If a user wants to add a tag like “police brutality” how do we know whether it is one tag or 2? I think it is a UI challenge.

jsachsman commented 3 years ago

Hi @giosce I want to note for the record that GitHub doesn't allow multiple-word tags and when you use a space in the manual tag entry it forces you to a new tag (closing your old one). So we will probably have our UX behave like theirs