Skip to content
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

Enable context based filtering for modify commands #3736

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rubieking
Copy link

Enable context based filtering for modify commands by setting the parameter to true.

This was tested by running the following commands

task add main1
task add main2 +tag1
task context define work "project:Work"
task add project:Work work1
task add project:Work work2 +tag1
task context work

task modify +testtag
task +tag1 modify +testtag2

task context none
task list

## Validate that testtag is set only in work1 and work2
## Validate that testtag2 is set only in work2

@djmitche
Copy link
Collaborator

It looks like there's a test failure here -- maybe just needs an update to that test?

@tbabej, this is precisely a revert of 97dbb0c -- what was the context for that change?

@tbabej
Copy link
Member

tbabej commented Dec 30, 2024

Context being truly an overloaded word here :) the context for the change is that - at the time - only read-only context was implemented, so it should not apply to CmdModify.

Since then I also implemented the writeable context, but chose not to apply it to the CmdModify either, simply because I don't think that is a good user experience. It would be potentially injecting the context to any tasks that were bring modified.

Note that when you have the context active, only tasks you see are the ones that already match the context. With writeable context, any newly added task also falls under the context too.

Hence any situation where you're modifying a non-context task must involve you remembering a task ID/UUID of a task that falls outside of the currently active context and referring to it that way. I would argue that bringing that task under the context by injecting the context mods would be unexpected behaviour.

@tbabej
Copy link
Member

tbabej commented Dec 30, 2024

Okay, I see this concerns itself less with mods and more with the filtering. I have to think about it a bit more.

@djmitche djmitche requested review from tbabej and removed request for djmitche December 30, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants