Skip to content

Add instruction to sort tasks by line number in the file, in order to preserve the original order #2213

Open
@thoresson

Description

⚠️ 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

I'm coming from OmniFocus which I've used for over a decade. One of OmniFocus' unique feature is task dependencies, where the order of the tasks in a project can be used to determine which tasks are available and which are blocked by others. Do achieve this, OmniFocus has two different kind of projects: Sequential and Parallel. For sequential projects, only the first task is shown in various views where tasks are filtered based on kind of the same principles as Tasks.

While Tasks doesn't allow for this kind of filtering, I still sort my tasks in the order they can be done, using intendention to make dependencies between task visually distinct.

But I think there might be a way to do something similar with Tasks, should a "Sort by home file order" (or whatever would be a good way to describe this sorting mechanism.

Using "Sort by file order", Tasks would just look at the file from where the tasks are stored and make no changes at all to the sort order. If this is combined with Group by heading and Limit groups 1 and instead of subtasks indented under it's parent divide your project with subheadings, I think the result would be what I would love to have in Obsidian: Only the next available task for each part of a project, selected by the sort order I give them in my project document.

(Side note: This would also be very useful for another query I have in my main project document. There I do this

not done
path includes <% tp.file.title %>
group by path
group by filename
group by heading

To include tasks in the main file, and tasks in all other files (like meeting minutes, etc) stored in subfolders. In this case, the Sort by file order would give me a structured overview of my project, the way I intend to do it, and also include all tasks that's spread over all files in a single view. The main file is always getting to the core of the project, while tasks in meeting minutes etc are more of checklist items/reminders.

(The base folder for each project shares the name with my main project document, that's why I can use tp.file.title as a variable for path by the way.)

✔️ Solution

With a project document with this structure:

# Project X
## Part 1
- [ ] Task 1.1
- [ ] Task 1.2
## Part 2
- [ ] Task 2.1
- [ ] Task 2.2

The query would result in a list with Task 1.1 and Task 2.1, without taking priorities, due dates, etc into account.


Edit from maintainer:

After discussion, the above is an example that shows how the feature might be used in conjunction with other things like grouping and limits.

The specific request is to be able to show tasks in the order they appeared in the markdown file. It can be thought if as 'sort by line number'.


❓ Alternatives

A work around is to group by heading, sort by urgency and limit to 1. If you are consitent with how you use priorities, etc, you could probably reach almost the same result. But you couldn't count on it, I think?

📝 Additional Context

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions