dwyl / mvp

📲 simplest version of the @dwyl app
https://mvp.fly.dev
GNU General Public License v2.0
84 stars 2 forks source link

Discuss: Interface for Moving an `item` from one `list` to another `list`? #420

Open nelsonic opened 1 year ago

nelsonic commented 1 year ago

Other list-based project management tools allow people to easily transfer items from one list to another, How much do we want to "reinvent the wheel" on this functionality vs. just "copying" what people are already familiar with?

LuchoTurtle commented 1 year ago

I don't think we should "reinvent the wheel"/try to create a new UX to change lists. "Copying" what people are already familiar with will provide an easier onboarding experience and reduce initial frustration when first tinkering with the app.

I see our lists in a similar fashion to what happens with Overleaf when tagging documents.

image

We're just using it for categorization purposes, but with the added benefit of having specific UX for most used lists (shopping lists, exercise logs, for example).

However, thinking of how to implement this, relates to how we are saving our items in our database.

image

As mentioned in https://github.com/dwyl/mvp/issues/418#issuecomment-1712701585, we don't have any relation between the table items and lists. So changing an item from one list to another means having to change the seq field from a list and add it to another. Is there an efficient way of doing this? 💭

nelsonic commented 1 year ago

@LuchoTurtle by definition we always want the items to be in a sequence in the list. So this is already the most efficient way of doing it. We don't need a relation. list.seq works. If anything is unclear about this approach, please read the code:

https://github.com/dwyl/mvp/blob/b8aee0e3c29d0cb45025595131248c08fbbf6a31/lib/app/list.ex#L149-L154

It couldn't be easier to add an item to a list. I tried several iterations of having a list_items table to join the data relationally and they all were more complex than this for maintaining the ordering (sequence) of the items in the list.

nelsonic commented 1 year ago

I should have made it clearer in the OP that this issue is specific to the interface that the person interacts with for adding/moving items to a list.

LuchoTurtle commented 1 year ago

Yes, but I was curious about how we were going to do the moving of an item from one list to another (database-wise, not interface). Is there a more efficient way instead other than:

  1. open list.seq
  2. iterate over each cid
  3. find the cid we want to move from
  4. splice the list.seq array
  5. and then add the cid to the other list?

Regarding the interface itself, as I've said before, no need to reinvent the wheel. For example, look how Trello is doing things (I know it's not a 1-1 comparable application but the flow looks good to me).

Screenshot 2023-09-13 at 09 22 51 Screenshot 2023-09-13 at 09 22 58 Screenshot 2023-09-13 at 09 22 43

They have a modal option (no-go) that does the same thing.

Screenshot 2023-09-13 at 09 23 12
iteles commented 1 year ago

I would agree with you both that this is both a solved problem and such a core piece of most app functionality that 'reinventing the wheel' here might come back to haunt us as feeling 'incorrect' to some people.

The most common way to do this that I know of is essentially through tags (though I would argue I would prefer list and tags to be separate things, but not necessary in early stages). You just add/remove tags and those are the lists the item is part of (from an interface pov).