-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Methods for modifying multiple tasks #240
Comments
I suppose another option would be a |
Multi-task operations have been on my wish list for awhile. It's not something I have time to implement now, but I'd be happy to look at a PR for it. I do suspect the implementation will be a lot trickier than you may imagine. Adjusting the interface to display multiple selections and operate on multiple tasks will likely involve some fairly major refactors, and a poor implementation would likely be pretty buggy. |
I can imagine! That's why I mentioned several methods that could potentially work. As you said, there's the interface part with also changes in the highlighting. You have to think about multiple types of changes and running task commands that you don't know what could affect... |
The dot would probably be a good start. I still think that might have some dragons in it, but conceptually, "store last action, repeat when told" seems fairly straightforward. Also, I think even if we start here, adding the multiple highlighting later wouldn't conflict, it would just be another usable method. |
#267 is taking a first stab at this, still a long ways to go... |
Since bulk-editing is also a feature I'd really like to be able to use from within vit I've had a little look at the code. Here's some ideas, would love to hear some feedback before I go forward and actually implement anything:
With these two things in mind I think there could be a nice 3-step roadmap, each of which provides new functionality that builds/relies on the previous ones:
I'd be keen to get some work done on this (especially step 1) soon, so let me know what you think! |
@kevinstadler on first read, this sounds like a solid plan. I'm a little concerned about ripping out the tasklib stuff and replacing it with direct calls to the task binary -- it's been so long since I coded that, I can't remember what the specific advantages were when using tasklib. I'm sure there were some ;) At the same time, it's always felt clunky to me to have that hybrid model of tasklib/task binary. If we went the route you're proposing, perhaps we should expunge tasklib (at least for all the write operations). If you want to take a crack at the PR, I'll commit the time to review and offer suggestions/improvements. I agree that having this feature would be a big plus, and I don't have the time to code it. As long as the code is clean and maintainable, we can get it in. |
Thanks for working on this! I did not read the details, but would it make sense to add the under-the-hood work to tasklib? Is the library still maintained? It seems these features might be useful to other Taskwarrior tools that rely on tasklib. I don't know anything about it though so perhaps it is inherently out of the scope of tasklib. Regarding the interface, two tools that I've used as inspiration for working on vit are mutt and ranger. Multiline (non-consecutive) selections are more natural in those two tools than in Vim so their interfaces might provide some good inspiration. Again, thanks for your time on this! It is a feature that has been requested by a lot of users over the years and no one has dared to jump down the rabbit hole :) |
The problem with that is that the task binary is so darn flexible. I think it's going to be a challenge to account for all that we want to support only using tasklib. The project is still maintained, so it might be worth filing a ticket to see what the dev says. |
Ah that is good to know. Thanks. Sounds like it might be one of those "sure that's the nice thing to do in theory but in practice it makes things a lot more complicated" things. |
Hey guys, just randomly chiming in here, but I'm wondering if you want to jump on a call to discuss this? I wrote like ~70% of |
I didn't even realise that Unless you want to make a push towards passing modify through Line 361 in 62273a2
can already support bulk-editing via any of the following minimal changes:
|
@tbabej @kevinstadler I'm game to jump on a call to discuss the best implementation. Again, it's been so long since I built those pieces, I cannot recall the precise reasoning. I do remember that I tried to use I'm a little concerned about scope creep if we elect to run everything through |
Just to point out that any decision to change operation execution from I've had a go at streamlining access to all current filter information within vit and providing access to them via keybinding replacements. I wasn't 100% sure about naming conventions in the codebase, so please have a look and let me know if it looks alright to you so far! |
This action is a first use case (but really just one special case) of bulk editing, which makes use of the new 'modify_multiple' operation by passing the filter expression that matches all tasks visible in the current view.
After #290 is merged, it will actually be possible to achieve @jmriego's use case by means of a workaround that uses a tag (say [keybinding]
# select/de-select tasks by applying a `selected` tag (assumes default m = {ACTION_TASK_MODIFY} to work)
n = m+selected<Enter>
N = m-selected<Enter>
# could use a nice chunky `tag.selected.label = ✓` to visually mark selected tasks
# bind bulk modification to some key, just so it can be used by the actual command below
@ = {ACTION_TASK_MODIFY_ALL}
# prompt modification of all +selected tasks (assumes default f = {ACTION_REPORT_FILTER} to work)
M = f+selected<Enter>@-selected<Space> Note that the above will also apply to any M = f({REPORT_FILTER_EXTRA}) +selected<Enter>@-selected<Space> |
This hadn't occurred to me, and is a brilliant use of the existing tools. Have a look at my proposal in #291 -- I think this could be fairly easy to implement, solve this issue more elegantly, and offer other benefits in the future. |
At first, Thank you for doing good job, and I've used vit everyday. https://github.com/yukiohmiya/vit/tree/feature/multiple_select I implemented this multi-select operation by following flow.
This implementation works well in my environment. Tanks. Peek.2021-07-22.22-58.mp4 |
thanks a lot @yukiohmiya ! This looks really promising Some feedback I can think of: Also, do you think instead of creating |
@jmriego I use I agree with your idea using uuid and {TASK_UUID}. I'm going to update my code. |
This action is a first use case (but really just one special case) of bulk editing, which makes use of the new 'modify_multiple' operation by passing the filter expression that matches all tasks visible in the current view.
Hi, I was about to ask about the possibilities of adding this feature to vit, and I see people have already done some work on this. I was wondering if this feature plan was still alive... Thanks again for this great tool, and all the work from the maintainer and contributors to make it even better ! |
@lyndhurst #290 was the main thrust of this feature request, and if you read that issue, you'll see it got hung up on some key naming/convention decisions. Someone will need to pick up that PR and continue it pushing it forward if we want to see this in. |
Thank you for the pointer, I am going to read it carefully so I will hopefully understand the issue better. |
Hi! First of all, thank you for your hard work. I found out very recently about vit and I find it amazing. I can't believe it's not a lot more popular between the Taskwarrior tools!
I was trying to make changes in multiple tasks at the same time and was wondering if there's some way of doing this.
The two ways I would think of are similar as what you would do in vim:
mt
and then you run a command that would affect all of them. This should also work for when you have mappings that use the task UUID and would run them multiple times with a different UUID each.
mapping that will repeat the previous action. In my opinion itt would also have to work for things like:!rw task ....
so it would be a bit different of the same mapping in vim that don't include:commands
.Does this sounds like something that could be added? Thanks!
The text was updated successfully, but these errors were encountered: