mpcjanssen / simpletask-android

GNU General Public License v3.0
545 stars 124 forks source link

Persistent tags, exclude certain tags from archiving (checklists with a fixed list of items, e.g., for shopping, packing) #696

Open aurisnoctis opened 7 years ago

aurisnoctis commented 7 years ago

I would like to use SimpleTask, among other uses, as a shopping list and as a travel packing list. These types of lists contain more or less the same items (bread, sunscreen). I'd check the open items done after shopping or packing. Then the next archiving action would push them from todo.txt to done.txt.

Is there a way to preserve these completed items in the todo.txt so they can be activated for the next travel or shopping? Say, they could be marked with +buy and +pack, could those tags be exempted from archiving?

I am a basic user and haven't got any experience with LUA. Assuming it could be done with LUA, would that be fairly easy to do?

As I can see in issue #458 , other people use SimpleTask for shopping already. If you are one of them: do you create items newly every time, or do you never archive, or do you use LUA for these items already?

smichel17 commented 7 years ago

I use ST for shopping (and also productivity). I add items to the shopping list individually each time.

Lua is currently not hooked up to archiving functionality, so there's no way to do exactly what you describe. However, I think you could achieve the same effect like this:

Now, when you check items off your shopping list, they will be completed, and then you can archive them. When they are completed, another identical item will automatically be created for you, with a threshold date of tomorrow, so it won't actually appear until tomorrow. You can change the number after rec: if you'd like them to take longer before reappearing.

And you also get a record of what you went shopping for :)

aurisnoctis commented 7 years ago

@smichel17 Thank you for your suggestion how to work with existing features!

I think the basic setup with rec:1d you suggest entails that I constantly have basically all items unchecked on my shopping list, except for the ones I bought the same day. So for instance I see today that I need milk, add it to the list as you describe above, then shop for it today --> milk will automatically pop up as todo again tomorrow (or x days later as specified by rec:xd), so I don't really have control when an item appears on my shopping list. This means for the list that I constantly have either almost everything on there as todo, no matter if I need it right now or not. For a shopping list the point is to only see what I need right now.

So I tried what you wrote later about changing the rec:value:

  1. To not have items appear automatically, set rec: to a really high value that will never be reached automatically so that the task is hidden from view once it's been checked (because of the long threshold time that comes with the long rec:).
  2. Create a filter in the right drawer where you can quickly access all not-currently-open shopping list items to choose from (that means including the ones with threshold dates in the future)
  3. To activate an item again (make it appear on the list), you have to change the threshold date back to today (because it is open, just hidden because of the threshold date in the future); this seems tedious, but it can be done as bulk action, marking all relevant items one wants on the list, and then using the threshold date button that appears at the bottom of the list
  4. Now, when you go shopping and mark those items as complete by checking them, you will have them all reappear automatically the next day (because the threshold date had to be set to today to make them visible on the list, see Point 3.). So instead of checking them complete you should change the threshold date back to a very long time in the future.

In summary: The whole concept is about using threshold dates instead of checking to mark things "done" without archiving them with the rest. This is a bit artificial and sounds tedious, but can probably be done thanks to the bulk actions option. I hope to get rid of my other app I use for shopping lists (Gtasks), but it is more intuitive to check and uncheck items instead of constantly play around with threshold dates ... ;)

aurisnoctis commented 7 years ago

One more detail: It is easy to bulk-change the threshold date to today, but it isn't easy to bulk-change it back to something very long like rec:10y, because the default options are none, today, tomorrow, 1 week, 2 weeks, 1 month, and pick date. In pick date you can only advance month by month so to set something like 10 years takes very long. Typing it in is only possible task by task.

So for a shopping list "marking done" (but in reality changing the threshold date to a very long time) means to edit every single item and type out the long-in-the-future threshold date.

It would generally help to have the last or the most often picked threshold dates as options in the threshold date list to pick from, but until then SimpleTask will not really work as shopping list or travel list in my opinion. :/

ddisanti commented 7 years ago

@aurisnoctis maybe you can try a different approach. You can build a shopping list with each item hidden with the h:1 extension. Then create a filter that shows only your shopping list and also shows hidden tasks. You don't even need to set due/threshold dates for each item. It is not needed. Now, when buying your stuff, you go checking every item. Finally, when you finished shopping, you will end up will all your items checked. All you need to do is select all items, uncheck them and your list is "clear" again. Then get back to your main filter.

smichel17 commented 7 years ago

@aurisnoctis I guess I'm not completely clear on what your use case is, so it's a little difficult for me to propose the best solution. For example, here's me:

I add items to my list as I decide that I need them. When I am getting low on a common thing like milk, I'll add milk to my list then. When I know I'm going to go shopping soon, I'll look to see what ingredients I need and add those to the list. I don't worry about adding duplicates because it's easy to delete those when sorting alphabetically. Then I go shopping and check things off. I don't feel the need to do any sort of recurrence, as I don't find it a pain to re-enter things on my list. The fact that simpletask allows you to add multiple tasks from the add-task screen (I'm not sure how many people know this) is really helpful.

I can only see two reasons why you would want recurrence:

  1. I want items that I buy regularly to automatically appear in my list, without having to remember them.
    • This isn't personally a problem for me because I use "eating the last package of mac and cheese" as a reminder to add mac and cheese to my list.
  2. Adding things to the list is a pain, so you want to be able to just choose items from a pre-generated list to buy today.
    • I don't personally mind re-typing things since my process for adding new tasks is fairly painless (I can do it from the lock screen).

I see two overal use patterns that could work:

  1. Set all things to rec:1d. Then, each day that you want to go shopping, just set the items you don't want to buy to a threshold of tomorrow.
  2. Set all things to rec:5y. Then, when you want to add something, go to your saved filter that shows shopping list items with threshold in the future and set the threshold to today
  3. Essentially do the same thing, but use priorities instead. This is how I mark todo items that I plan on doing today (assign them a priority, then have a filter that shows only things with a priority set). Disadvantage: can't automatically set. Advantage: no expiration.

Or maybe there's some combination of those? Honestly I've found simpler is better, though.


@ddisanti I don't see why you would want h:1. If you want to exclude shopping items from your main list, make a saved filter with a script that excludes things with @shopping. If you want them to disappear, threshold dates seem easier as they do not require you to edit the task text.

ddisanti commented 7 years ago

@smichel17 I would use h:1 for not to have main filter to exclude @shopping. I would just use the default "don't show hidden tasks" instead and show my shopping list only when I need it.

aurisnoctis commented 7 years ago

@ddisanti Thank you for your idea, but h:1 doesn't add functionality for me, because if I check hidden items, for instance while shopping, they get archived anyway if I don't restore them to unchecked before archiving, and thus are lost from my predefined list of common shopping items. I can achieve the same visibility functionality by filtering for +buy or @shopping or whatever I choose to use as a marker for shopping items -- if I understood your approach correctly.

@smichel17 My case is as you guessed: I want a predefined list for shopping (packing for travels, ...) where I can check and uncheck items as needed without loosing them when archiving tasks. I guess I mind typing out things every time, especially in winter :) I have a list of about 40 typical items, and seeing them in a list also helps me to remember what I need.

Activating (unchecking) all shopping items before archiving would be the simplest way to avoid deleting items that are not open at that moment, but an unnecessary hassle for a simple shopping list. If I'd forget to do that, my list would be gone from the todo.txt. Also, if at the point of archiving I had some items open and some checked, I'd have to uncheck them all anyway to save them from archiving, remember which ones were actually unchecked (or checked, but usually more are checked than unchecked on the shopping or travel list), and restore that state after archiving. Hm.

Yes, I guess, typing shopping list items every time is the only way SimpleTask can be currently used as a shopping list. However, especially for the travel list, having a predefined list of items is a must for convenience.

aurisnoctis commented 7 years ago

It would be great to have

to keep shopping list or travel list items independent of their state (checked/unchecked). There are a few types of lists or procedures (think check lists) where a predefined set of items makes a lot of sense and where the items generally don't change.

smichel17 commented 7 years ago

@aurisnoctis I see your point now. I will think on whether this should be native or lua functionality.

In the meantime, here's maybe the best workaround: save a filter that shows all completed items except your shopping and packing lists. When you want to archive, load this filter, select one item, then select all and archive.

To create this filter, under the lists tab, select your shopping and packing lists and click invert, make sure that Show completed tasks is checked, and then use the following script:

onFilter(t, f, e)
  return f.completed
end

It's not the most elegant way but it's pretty good.

smichel17 commented 7 years ago

Either that or set a threshold date with rec:1d for everything, then when you're ready to go shopping, hide the items you don't want to buy this time around.

aurisnoctis commented 7 years ago

@smichel17 Since tapping on 39 items checked to have 1 item on the shopping list seems out of proportion, I'll try the first solution using the filter - thank you!

What did I do wrong?

I actually didn't know that archiving can be done on a filtered list of items - so far no matter what my viewing filter was, it always archived all completed items anyway.

What will this script actually do? I hope it won't automatically complete all my tasks that are not in the shopping and travel lists :[]

Thanks a lot!

aurisnoctis commented 7 years ago

@smichel17 OK, I found the Lua documentation in SimpleTask understand what the script is supposed to do! Yay.

I also tried out archiving just marked items, and this works as well. I didn't know this!

Now I just need help to get the script going, see error above, and I know what to do.

smichel17 commented 7 years ago

oop, the first line should be function onFilter(t, f, e)

smichel17 commented 7 years ago

tapping on 39 items checked to have 1 item on the shopping list

You shouldn't have to tap on 39 items. In that case, you could open your shopping list, select one item, then use select all and then unselect the one item you want to keep.

I actually didn't know that archiving can be done on a filtered list of items - so far no matter what my viewing filter was, it always archived all completed items anyway.

You can either:

aurisnoctis commented 7 years ago

@smichel17 Yes, it works! Thanks - that is the best workaround so far, and since I don't archive very often, maybe once a week, a custom filter and the above steps are OK for me. So I think with this setup it's worth trying to use SimpleTask as a shopping list.

Summary how to use SimpleTask for shopping lists or other types of checklists:

  1. Make sure no filter is applied in the task view; hit X on the top left in the item overview to kill any filter applied at the moment

  2. Tapping filter button at the top (striped triangle), select the lists and tags that mark your shopping list or travel list or any other check list items, and invert selection.

  3. Under tab OTHER, still in the filter view, make sure that "Show completed tasks" is checked

  4. Under tab SCRIPT, check Use script, and below the horizontal line below Script insert the following lines, which filter tasks to only show completed tasks:

    function onFilter(t, f, e)
    return f.completed
    end

    (The button TEST and the field Test task are optional: you can enter a task manually into the field, and then hit the button to see what the script would do with it)

  5. Click the checkmark on the top right to apply the filter.

  6. To save the filter for future uses, access the filter drawer in the main view by swiping from the right edge to the middle, then hit the plus at the top right, and enter a name for the filter, for instance myarchiving.

Now each time you want to archive completed tasks except for the items you excluded under point 2.

  1. Swipe in the main view from the right edge to the middle.
  2. Select the archiving filter with the name you chose in step 6. above, e.g., myarchiving.
  3. Tap on any item in the filtered view to select it. Now, the bulk options appear at the top of the screen.
  4. Tap the box-in-box button at the top middle to select all tasks in the current filtered view.
  5. Tap the archive button (box with arrow down) to archive only the selected items.

Because the filter created under points 2.-4. filters for completed tasks except for the excluded items under point 2., archiving those items will leave the items excluded in point 2 intact, even if they have been marked done. In this way, anything excluded from view under point 2. will be saved from archiving.

Nice workaround for shopping lists and other types of check lists with a mostly static number of unchanged items until a more straightforward method becomes available - thanks again @smichel17 !

smichel17 commented 7 years ago

@mpcjanssen ^is there a place where we can keep how-to's like this for others who might want to use this?

mpcjanssen commented 7 years ago

@smichel17 not really. Could be useful to add recipes to the app documention.

Vijayanth-Reddy-K commented 7 years ago

If your shopping list is constant, you could use Listing It (https://play.google.com/store/apps/details?id=com.listing_it&hl=en), which lets you have a checklist of items that you can check, uncheck and reorder. In that case, you just have a recurring reminder you need to shop in Simpletask, and then, use the list in Listing it to check the items off your list, and refresh it when you are done. (Just an alternate suggestion to what was given above.) 😃

y2kbugger commented 7 years ago

I just use move the threshold date to tomorrow instead of "checking" the item. That what it won't make duplicates and I know the checklist will always be there when I need it but they can be hidden on the day I am actually using the checklist.