Closed verbitsky closed 2 years ago
There is a somewhat fundamental reason why we don't support it the way you describe.
We store tasks in the todo.txt format, then filter them. The only inherent ordering of tasks is the file order, which is the same across all filters. So instead, we sort them differently... but there's no way to rearrange a sort.
In theory, we could add text information to allow arbitrary sorting per filter. In practice, that results in a pretty messy and not human readable todo.txt file; I do not think we should support that naively (although of course @mpcjanssen is the only one with a veto).
That said, there are other ways to accomplish the same goal; I think we can close this as a duplicate of #406, #636, and #646 (there's a bunch of other related issues too).
I understand the problem, if you have a filter say by list, and you swap two tasks, it's actually not clear what should happen: should the tasks swap the lists, or should the lines in todo be swaped. In second cases the user will probably not see any change. The cleanest way to achieve order change seems to be usage of priorities, but it is not practical now, since you have to give every task a priority level, and if you then want to put a task somewhere in between, you have to diminish the priority of all the task after it.
Yep, you've got it. Full per-filter sorting would be even worse. Say you have three tasks:
w @a
x @a +b
y @a +b
z +b
You add two filters:
Avocado
shows tasks with @a
and should be ordered w x y
Broccoli
shows tasks with +b
and should be ordered y x z
In order to make that work, you'd have to use a todo.txt extension (like simpletask uses t:
for threshold dates), and identify the order, per each filter. Let's use s:
, for "sort". It would look something like this:
w @a s:Avocado_1
x @a +b s:Avocado_2 s:Broccoli_2
y @a +b s:Avocado_3 s:Broccoli_1
z +b s:Broccoli_3
Even though it's still plain text, it's much hard to use manually, which defeats some of the purpose of todo.txt.
@smichel17 Would it be possible to change the file-order in the todo.txt by simpletask? In this case no extra todo.txt-extension would be necessary and the complexity we discussed in #636 could be avoided. Prior condition would be, that rearranging only is possible, if the list is sorted "As in the file (unsorted)". For example in tasks it is solved this way.
That requires quite some effort to implement and it will have limited useability (only in unsorted view). Not going to happen any time soon.
This is the thing I miss most in the app, sorting.
(and yeah, only for unsorted and unfiltered view of the file. Or with some reasonable defaults, but I typically only use it unsorted/unfiltered.)
@chipbite imo the best workaround at the moment is to sort by priority -> threshold, where most sorting is threshold and priority is used to pin a few tasks to the top. Option of showing tasks with threshold in the future or not, as you prefer.
@smichel17 I guess I like to arrange my tasks in priority order. I even like to have the view keep the empty lines in between groups of tasks. it works out quickly, without having to tag and so on too much.
I have tried using priority and I feel it is cumbersome and painful.
Oops! I'm afraid I'm not allowed to reply here #989, so I'll do it in this thread.
@smichel17, you wrote:
Specs for how the tasks in the todo.txt file should be changed when a task is dragged. One tenet of ST's design is that there's no extra state that's not stored in the todo.txt file (this is one of the things that makes it great, as you mention!). If it's just in file order, it's pretty clear what should happen, but with other sorts, things get complex quickly.
Maybe I didn't put it enough precisely (sorry, English is not my native language), but that's exactly what I meant. Task sorting based on tasks order in file. I think it's the simplest way to implement it (still keeping todo.txt rules).
How the UI/UX should be changed to support drag and drop. Right now both tap and long press have actions associated with them, so drag-and-drop will need to either be added some other way, or some of the existing functionality needs to be shuffled around to make room for drag-and-drop.
Here is a small problem. But it isn't impossible to solve though. I think the most natural way would be:
The only problem is, it would break a bit current SimpleTask behavior rules. But I think a sorting possibility would be worth of it. Even if it turns out that I'm the only one who thinks so, I think there are many other ways, to solve that, if it come to GUI.
A simpler to implement, proof of concept version. Since this is also a hard thing to implement technically, we'd want to build something with a more reasonable scope, first. For example, maybe drag and drop is only supported when sorting in file order, or maybe it's only possible to drag between groups, not ordering within a group.
That's it! The only thing I wanted to ask, is to possibility to sort task which will work only in sorting in file order mode. I think any other ways (assuming, that we're not breaking the todo.txt standard) are really hard to implement. I think moving from one list to another by d'n'd is not so necessary, because there's already another way to do that.
Probably file order only reordering is the only sane way. I am not convinced drag and drop is the best way. Maybe when you select a task, arrows can be shown (if it's a file order sort). To move the selected task(s) up or down.
Probably file order only reordering is the only sane way.
I thing it should be enough. And if it would be possible to connect it together with priorities, it would be even more than enough. But it's not so important, because if we could sort tasks in easy way, the positioning at the list will be the natural priority marker (higher on the list - higher priority).
I am not convinced drag and drop is the best way.
Why do you think so? Drag and drop is probably the fastest and the most comfortable method to sort tasks manually. And I think the only downside could be a minor change in the Simpletask UI behavior. Moving tasks with arrows won't be so handy, but I think it would be still quite acceptable.
@mpcjanssen drag and drop is super nice. Try any.do if you want to feel it for yourself (see #433).
It's probably because of my fat fingers :) It's not as bad as swiping though.
Awesome @shak-mar @mpcjanssen et al! 🎉
Is there some fundamental reason why simpletask doesn't support rearranging tasks? I can choose sorting "As in the file (unsorted)", but I didn't find a way to swap two tasks. It seems you just have to swap the lines with tasks in the file, and if I do it manually (which is very cumbersome) it works nicely.