HoldUpFjord / Link-Manager

Goal: Create a link manager that can store tabs on a server to be accessed later. 100Devs
2 stars 6 forks source link

Working on option to add tags to tabs #16

Open Gonksy opened 2 years ago

Gonksy commented 2 years ago

Current implementation:

User inputs tags as a string in an input image

Controller separates input string by each comma, trims the white spaces around each tag, then saves it to an array defined in the tab schema image

Gets saved in the database as an array image

Gonksy commented 2 years ago

Future implementations to consider:

Client side: When users input a comma or leave the tag input box, wrap the written tag like so: image Provides instant feedback and makes users know they're tagging properly.

This could require rethinking how the tags get sent from user to the controller and subsequently how they're handled. (ie. as separate contents of spans rather than 1 single string)

TheWoodenMan commented 2 years ago

comma separated is the best way to do this, 100% agree.

We also need to consider the edge case when a document already has tags in the array and the user adds a few more (check if empty and repeat the function but push to the array rather than create a new one) we could save a bit of code by starting with an empty array during document creation and just pushing to it in either use case.

TheWoodenMan commented 2 years ago

love the visual documentation 👍

Gonksy commented 2 years ago

comma separated is the best way to do this, 100% agree.

We also need to consider the edge case when a document already has tags in the array and the user adds a few more (check if empty and repeat the function but push to the array rather than create a new one) we could save a bit of code by starting with an empty array during document creation and just pushing to it in either use case.

Ooh I hadn't considered the ability to add tags after creating the link. I think we can achieve that through a separate put request with its own route and controller. Could have it not push duplicate tags to the tags array. Could also probably give the user a way to remove tags, but I think that might be a stretch goal.