idpaterson / alfred-wunderlist-workflow

Unbelievably fast task entry in Wunderlist with due dates, reminders, and recurrence
297 stars 8 forks source link

Add ability to push onto top of list #143

Open tylerjames opened 7 years ago

tylerjames commented 7 years ago

I know Wunderlist has a setting specifying whether new items should be added to the top or the bottom of the list, but it doesn't work on a per-list basis.

Sometimes I want to add something to the top of a list, but generally prefer things be added at the bottom.

I thought it might be interesting if you could add a "push" type feature that inserts an item at location 0 instead of appending to the bottom of the list.

I have no idea if this is possible or not, I just thought it might be useful in some cases.

Great workflow btw, finding it very handy.

idpaterson commented 7 years ago

That is an interesting idea but it would entail a large amount of work. Ordering of items (and especially the workflow's sync of that ordering) is somewhat tenuous. The position of everything (lists, tasks, subtasks) is tracked in a separate Positions model in the API. This would theoretically be nice for cases when tasks are reordered but not otherwise updated but ultimately it seems over-complicated.

To move forward I would need to experiment to see what the Wunderlist app does when tasks are reordered and when a new task is added to the top. Questions to investigate include:

  1. If the first item is at position 0 when I add a new task does it get added at position -1 or [shudder] does everything else in the list get shifted?
  2. Are holes in task order filled when items are deleted or moved?
  3. How would I implement "add to the bottom" for a user whose account preference adds to the top? Add to bottom would require knowledge of the current maximum positions within the list, though add to top might require the current minimum position if they didn't make add to top as simple as setting the position to zero.

This would require properly syncing the Positions to a separate model and updating joins to use that rather than collapsing the order down to the Task model. Once that was complete, in addition to the new syntax to add at the top or bottom a second API request would need to be made after adding the task to get its Position, then a third API request to update that position.

tylerjames commented 7 years ago

Whew, that does sound overly complicated.

I do wish they would just let you specify "add to top" or "add to bottom" in a per-list manner. I figured they might have an exposed "insert item" type of API where you specify the index. I'm sure it would exist, but I really don't know how much of their API they expose for this sort of activity.

This is kind of a special use case for me really, something I've just been messing around with. I've kind of been using one of my lists in WL as a thought dump in order to quickly get something down so that I can continue working instead of compulsively googling whatever pops into my head.

I thought I might like to treat it as more of a stack than a queue and review things at a later time starting with the most recent first. Again, this isn't really a task for which WL is ideally suited, but I thought I'd experiment with it and your workflow has made it much smoother.

Thanks

idpaterson commented 7 years ago

The Wunderlist app does have a Sort By Creation Date on the list but I believe that permanently reorders the tasks. It would probably be easier in the workflow to have a sort option when you're using the workflow to view a specific list. I'm not sure if you're actually looking to review this list from the workflow rather than the app but it wouldn't be a bad idea to add some sort syntax to the wl-search command and anything else that lists tasks:

wls Thoughts: -created wls Projects: +due

I probably wouldn't go so far as to store it to a per-list preference unless other people find that useful. However this is certainly a simpler option than mucking with Wunderlist Positions... if you're willing to view the list from the workflow rather than the app.