alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
101 stars 9 forks source link

tod project sort #392

Closed alanvardy closed 1 year ago

alanvardy commented 1 year ago

I have a costco list that has a section for each area of the store so I can complete the list in order, when I add something to the costco list it goes into the "no section" area at the top and I need to manually sort them into sections later.

tod project sort -p costco

Will iterate through the tasks in order and prompt for which section to put them into

alanvardy commented 1 year ago

Can anyone think of a better name? I don't think that sort will end up being used for anything else.

stacksjb commented 1 year ago

Is there an easy way to determine which tasks are not in a section and iterate through them? And to return the list of sections? It looks like based on the API for tasks we should be able to just filter/return on "null" section_id?

I use sections for breaking up multi-level projects as well as courses (that have various modules), so I could see this being useful. I like the idea of adding some sort of section sort, but agree usage does seem a bit limited.

My only concern is that "Sort" is rather generic and could apply to multiple things.

stacksjb commented 1 year ago

Side note, I work with multiple filters and sections and one way I sometimes work around this without sections in other cases would be with labels and then create a filter with multiple sections (using the filter1,filter2,filter3 format).

stacksjb commented 1 year ago

I think what would make sense to me is to label it as "Section" instead of "Sort", and then even have a subcommand of "sort", is that too much?

so something like: tod project section sort -p costco

Future expanded possible section use cases would include: -Listing sections (Breaking out) when doing things such as "task list" (So still display the same task list, just break into sections) -Allowing specifying of a specific section for sort (otherwise by default you could do null/no section) -Specifying a specific section for "tod task create" (probably a parameter, not as part of default/interactive)

alanvardy commented 1 year ago

OOooo good point. How about tod section sort ? Do you think that would work?

stacksjb commented 1 year ago

That would work. The sections will be specific to a project, so I think it makes more sense to tie to a project, so it depends on if we want to make section sorting a sub-category of projects, or its own CLI section.

Which makes more sense for your workflow?

alanvardy commented 1 year ago

I've feel the awkwardness of trying to figure out when to put things into the project category. For example, all items are a member of a project, so items could be a subcommand of project.

I guess that in my mind I was thinking that projects should be reserved for actions that modify the project itself (add, remove, import) or iterate over and modify all the items in that project (like process)

Though now I am wondering if we should also split out our other items in there so that the only things in project are those which modify the project itself.

Should we have a bulk or a process category? Then this command would go in there as it is kind of a "apply to everything in project that does not have it" style command.

This is the current project command, and it's starting to look like a bit of a junk drawer

 ~  tod project
Usage: tod project <COMMAND>

Commands:
  list        List all projects in config
  add         Add a project to config (not Todoist)
  remove      Remove a project from config (not Todoist)
  empty       Empty a project by putting tasks in other projects
  schedule    Assign dates to all tasks individually
  prioritize  Give every task a priority
  import      Get projects from Todoist and prompt to add to config
  process     Complete all tasks that are due today or undated in a project individually in priority order
  help        Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version
stacksjb commented 1 year ago

I thought through this for a bit and went back and forth, but I think in the end I like your "tod section sort" option.

It definitely makes sense for your use case of existing sections (need to sort). I think it also gives us good options for future use cases (such as create sections)

stacksjb commented 1 year ago

Here's my recommended section CLI options:

tod section sort - list items NOT under a section, and allow moving to a new section tod section list - list sections (and task counts) tod section create - create a section(s) tod section rename - rename sections (could also be tod section edit, but I'm not sure what else there is to edit)

Q: Do we need a "tod section edit" or "tod section resort" for moving items already under a section? Or are we planning to select which section as part of "tod section sort" I think for most usecases the "not under a section" makes sense.

stacksjb commented 1 year ago

For all of these, selecting a specific project would be required (or specifying with -p)

alanvardy commented 1 year ago

Split out tickets!

Q: Do we need a "tod section edit" or "tod section resort" for moving items already under a section? Or are we planning to select which section as part of "tod section sort" I think for most usecases the "not under a section" makes sense.

I think that for now "not under a section" would be the main usecase and we can return if we want more later :+1: