steroid-team / app

Helping you organise your day with ease and privacy.
1 stars 2 forks source link

add Tags feature #248

Closed lgraziano closed 3 years ago

lgraziano commented 3 years ago

Adds the tags feature. For now we can display and add tags by entering a todo-list and then pressing the button in the upper right corner.

theo-damiani commented 3 years ago

Hey @lgraziano! Super cool work.

I have been able to test the feature and it works perfectly. The only issue I found is that the background of the layout is "transparent" to clicks, meaning that you can click the tasks underneath without noticing (see #237). However, it is not a big problem.

The code looks great, but I have some doubts about the object model. I see that labels contain lists within them, but I wonder if it shouldn't be all the way around: each list contains a "tags" attribute with a list of references to the corresponding label.

I feel like this would make much easier implementing the database backend later on, but I am not 100% sure, so I prefer that we discuss this before aproving/requesting changes.

Thanks!

Hey @YagoGG, we discussed with Leandro, and I was telling him that maybe it was better to have a label model. So each label has a list of associated lists or notes. And when you add a tag to a list you just, call the database and add a UUID within the label. So you recover only the tag model which is really small: a list of UUID, maybe a text body, and one color. If you do the other way around, each time you add a label to a list you will call the database to recover the entire todo list, and all this stuff just to add a UUID to the list. So I thought it was less consuming to do like Leandro decided.

And so you can have a folder /tags/ in the database as we did for voice memos or images. Also if you remove or add a new tag you just put or remove a file in the folder tags and you do not need to go all todolist to check: oh this one has the tag we need to remove it.

But for sure it is more difficult to print all the labels that are associated with one todolist. What do you think?