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

Add ability to filter for tags defined anywhere in the body of the file containing the task (including other task lines) - and maybe include frontmatter tags too #2894

Open
4 tasks done
kuyper opened this issue Jun 18, 2024 · 6 comments
Labels
scope: filters Additions and modifications to the search filters scope: tags Anything to do with tags, both as `#` and in YAML frontmatter type: enhancement New feature or request

Comments

@kuyper
Copy link

kuyper commented Jun 18, 2024

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

  • I searched previous Ideas in Discussions didn't find any similar feature requests.
  • I searched previous Issues didn't find any similar feature requests.
  • I am only requesting a single feature. Multiple changes should be split into individual requests, with links between them.
  • I believe my requested feature will be generally applicable to other users, not just me: it is not uniquely tied to my personal workflow.

🔖 Feature description

My use case is that I define tasks on a page that contains a tag and filter that in dataview in order to collect all the tasks matching that instead of adding the tag to each task individually.

It would be great if I could do that in tasks directly without having to use dataview.

✔️ Solution

It would probably be something like

filetags include ...

like the other filters that use file properties, like root and so on. It seems that it would at least be an extension to TaskFile.

The desired behaviour would be: Given a page that looks like this:

#mytasks

- [ ] This is my task

and a query like

filetags include #mytasks

would list that task defined on the page

❓ Alternatives

No response

📝 Additional Context

No response

@kuyper kuyper added the type: enhancement New feature or request label Jun 18, 2024
@claremacrae
Copy link
Collaborator

My use case is that I define tasks on a page that contains a tag and filter that in dataview in order to collect all the tasks matching that instead of adding the tag to each task individually.

How/where exactly do you define the tag? Please give an example as text, not screenshot.

@claremacrae claremacrae added question Further information is requested scope: filters Additions and modifications to the search filters labels Jun 18, 2024
@kuyper
Copy link
Author

kuyper commented Jun 18, 2024

So I would have a page like this:

Some text explaining stuff that is important for my tasks and containing the tag #mytasks together with other tags that I use in order to structure my notes. Below this text there is a task list.

- [ ] a task that is relevant for the stuff that I described above
- [ ] another one

Does that make my request clearer?

@claremacrae
Copy link
Collaborator

Thank you, yes that helps. It tells us that the feature isn’t a duplicate of the requests to detect tags in frontmatter/properties.

There is still quite a bit of possible ambiguity though.

I read this as “find any tag anywhere in the body of the file. Even if it is on a task or checklist item.”

That would be the most general implementation.

@claremacrae claremacrae removed the question Further information is requested label Jun 18, 2024
@kuyper
Copy link
Author

kuyper commented Jun 18, 2024

I read this as “find any tag anywhere in the body of the file. Even if it is on a task or checklist item.”

Yes, that interpretation is correct.

@claremacrae claremacrae changed the title Add ability to filter for tags defined in a file containing tasks Add ability to filter for tags defined anywhere in the body of the file containing the task (including other task lines) Jun 18, 2024
@claremacrae claremacrae added the scope: tags Anything to do with tags, both as `#` and in YAML frontmatter label Jun 18, 2024
@claremacrae
Copy link
Collaborator

Things to agree in advance, and research, before any implementation of this:

  1. Whether this should also include tags that are defined in the frontmatter
    • if using dataview-like nomenclature, use dataview-like behaviour, so research what that is
  2. Consider how this interacts with any Global Filter, if its value is a tag.
    • the tag includes search behaviour with the global filter - stripping it from task tag lists - confuses users
    • suggest that this facility treats a Global Filter tag value as nothing special, just like any other tag - allowing it to be searched without confusion

Implementation comments:

  • Get the tag lists from Obsidian's CachedMetaData and front matter...

@claremacrae claremacrae changed the title Add ability to filter for tags defined anywhere in the body of the file containing the task (including other task lines) Add ability to filter for tags defined anywhere in the body of the file containing the task (including other task lines) - and maybe include frontmatter tags too Jun 18, 2024
@claremacrae
Copy link
Collaborator

I've renamed the ticket to convey the conclusions from comments above...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: filters Additions and modifications to the search filters scope: tags Anything to do with tags, both as `#` and in YAML frontmatter type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants