obsidian-tasks-group / obsidian-tasks

Task management for the Obsidian knowledge base.
https://publish.obsidian.md/tasks/
MIT License
2.35k stars 224 forks source link

More 'Global task filters' #1576

Closed menagerie198 closed 1 year ago

menagerie198 commented 1 year ago

⚠️ Please check that this feature request hasn't been suggested before.

🔖 Feature description

Currently we can only have one #hashtag in the 'Global task filter' setting. Could we have the ability to have more than one? Not more than one per task, but the ability to have a number of #tags to select one or other per task.

✔️ Solution

This would afford us the ability to categorize a 'task' as: #work, #personal, or #holiday, etc

❓ Alternatives

No response

📝 Additional Context

No response

aubreyz commented 1 year ago

Great idea - I know we are asked to up vote but on my phone I cannot see where to do that

claremacrae commented 1 year ago

Great idea - I know we are asked to up vote but on my phone I cannot see where to do that

@aubreyz For Issues, click the 👍

image

If you can't see it on a phone, rotate your screen 90 degrees to make it wider.

claremacrae commented 1 year ago

I think I am missing something about this suggestion. So it's interesting that @aubreyz is up-voting.

What is stopping using more than one category right now, using tag searches? It's how I do all my searches (and I specifically don't have a global filter, as I want every task to be able to be found by Tasks).

How would multiple global filters differ?

menagerie198 commented 1 year ago

Yeah, I think I was being mislead by looking at my Tasks on 'CardBoard'. There the #task tag is visually prominent. I wanted a visual cue as to what broad category my tasks came under. Using an icon in the task description seems to be solving that issue for the time-being. I have a #task filter because I use the fancy checkboxes for other purposes -- maybe the next version of 'Tasks', with support for fancy checkboxes will help me (or complicate things interestingly) for me ;-)

claremacrae commented 1 year ago

I wanted a visual cue as to what broad category my tasks came under

Sure, but I don't think the Tasks global filter is going to help you with that. It could be styling, or theming.

Nothing personal, but I'm going to mark this as Not planned, as adding multiple global filters is a complication - and not supported by the proposed scenario.

menagerie198 commented 1 year ago

No worries. I realised it was somewhat half-baked very quickly after I hit 'send'. Curious how hitting send clarifies the mind!

FabianoLothor commented 1 year ago

Nothing personal, but I'm going to mark this as Not planned, as adding multiple global filters is a complication - and not supported by the proposed scenario.

Don't need to add multiple global filters, it can be only one, but it should accept a regex instead of only a simple text, what do you think?

claremacrae commented 1 year ago

Don't need to add multiple global filters, it can be only one, but it should accept a regex instead of only a simple text, what do you think?

Why "should", please? That's a lot of extra complexity to write, test and document - so it would need to have a really strong justification.

What is an actual, concrete real-world example of where this would be useful?

And why is it better than the flexibility provided by filters in tasks query blocks?

FabianoLothor commented 1 year ago

What is an actual, concrete real-world example of where this would be useful?

Well, certainly other people will have other use-case scenarios where this would be useful, but talking about me specifically:

image

My tasks have priorities and complexities based on icons.

In my case, a checklist should be considered as a task only if the checklist has a priority and a complexity defined.

Currently the global-filter doesn't work for me.

With a regex, I could make the plugin recognize only checklists with a priority and a complexity defined without need to care about add #tagX.


Is it possible to filter those tasks using the regular filters?

Yes it's, and I'm doing that right now, but the issue is that the plugin is executing the queries and filters in tons of unnecessary checklist lines that could be eliminated by the global-filter.


And why is it better than the flexibility provided by filters in tasks query blocks?

Well, I wouldn't say that it's worse or better, but everything that the global filter is doing right now, could be done with the current filters of the plugin, so, why keep it then?

If the answer to don't implement that is because "the filters already do this", I would agree and ask what's the reason to have a global-filter then, since its functionality is already available using the regular filters?

aubreyz commented 1 year ago

For me it would be a matter of simplification. Lets say someone a) Doesn't want every markdown task to be a task (stops checkbox lists being used for other purposes etc) b) Only wants a light classification of tasks into different groups (say 5 groups, home - work - garden -webdevelopment) which are completely exclusive - sort of an alternative to having completely different task lists for different purposes.

At the moment every task has to have two #tags, one to say it is a task and another to say which group it is in. This is a bit messy, and also doesn't enforce that every task will be in a group or that it will be exclusive. I think a lot of people run radically different task lists that really don't want to be merged. For example a lot of my tasks are not really tasks at all but memory ticklers (remember that I set a shortcut to do xyz to ^P in VS Code) - it is an exclusive TYPE of task rather than a task tagged with something (albeit I appreciate the distinction may be subtle).

Just throwing out an idea - one way to achieve this might be to allow the global tag to be a tag root instead of a tag. If this was #task then it could also accept #task_tickler

As @FabianoLothor says it gets back to why we have a global filter at all. It's purpose is to say that something is a task (which can be achieved without having the global concept). So if we do have it, it could be more subtle (not "this is a task" but "what task list does this belong to").

aubreyz commented 1 year ago

As another example of a particular type of task LIST - I use tasks to tag whole pages in obsidian which need attention (perhaps by a particular date). Again these are sort-of tasks, but not really. Every one might say:

Being able to say

would be neat

claremacrae commented 1 year ago

Thanks for the input @aubreyz ... I don't have the capacity to fully take it in right now (am still recovering from the work on custom statuses 😆 ) but I am persuaded that it is worth considering further, so will reopen this ticket!

mgrubb commented 1 year ago

One option that I would like is the ability to put in a negative value in the global filter, normally I leave the global filter blank because the vast majority of check box items in my vault are indeed tasks, but I do have a few things that I use checklists for that aren't tasks. It would be helpful to be able to put in global filter something like !#notask so that anything tagged with #notask will be excluded. That being said allowing regex as an option for the global filter would get this kind of behavior for free with some of the other use cases.

Thanks for a great plugin

claremacrae commented 1 year ago

We recently released a much more general mechanism than the global filter.

https://publish.obsidian.md/tasks/Queries/Global+Query

Anything that you can put in a tasks query code block, you can put in to the global query.

All requests for improvements or changes to the global filter are now being directed to the much better, newer mechanism.

It would be helpful to be able to put in global filter something like !#notask so that anything tagged with #notask will be excluded.

Yep, you can do that with the current filters, which already support regular expressions and negation.

Thanks for a great plugin

Thank you - you're welcome!

claremacrae commented 1 year ago

Closing.

Please use the new Global Query setting instead.

https://publish.obsidian.md/tasks/Queries/Global+Query