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

Sort by dependency #2727

Open
4 tasks done
ferife opened this issue Mar 22, 2024 · 9 comments
Open
4 tasks done

Sort by dependency #2727

ferife opened this issue Mar 22, 2024 · 9 comments
Labels
scope: sorting Changes to the sorting capabilities scope: task dependencies Anything to do with making tasks aware of other tasks type: enhancement New feature or request

Comments

@ferife
Copy link

ferife commented Mar 22, 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

A sorting option that puts task dependencies at the top and their task dependents below them. Hopefully it puts tasks that are directly dependent on each other together.

✔️ Solution

a

❓ Alternatives

No response

📝 Additional Context

No response

@ferife ferife added the type: enhancement New feature or request label Mar 22, 2024
@claremacrae claremacrae added question Further information is requested scope: sorting Changes to the sorting capabilities scope: task dependencies Anything to do with making tasks aware of other tasks labels Mar 22, 2024
@claremacrae
Copy link
Collaborator

Hi @ferife, thanks for the suggestion.

For clarity, please supply:

  1. some example tasks, as markdown text, with dependencies in
  2. and then show the sorted output you want to see, once they are sorted in the order you wish.

You seem to be thinking about direct and indirect dependencies - so be sure to include examples of those, and how you wish them to be sorted.

By supplying examples to be used in testing the implementation, you will be helping somebody do the work, and ensuring that what is programmed matches the behaviour you are requesting.

Thank you in advance.

@claremacrae
Copy link
Collaborator

Closed as no reply.

@claremacrae claremacrae closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
@claremacrae claremacrae added the status: wontfix This will not be worked on label Mar 25, 2024
@ferife
Copy link
Author

ferife commented Mar 26, 2024

Hi @claremacrae I apologize for taking so long to reply.

Here are some examples pulled straight from my vault

  • Prog2 Programming Assignment 7 ⛔ i7fjn5 🔼 📅 2024-04-05
  • Prog2 Programming Assignment 8 ⛔ 4yqy8d 🔼 📅 2024-04-05
  • Prog2 Programming Assignment 9 ⛔ 6yyjks 🔼 📅 2024-04-15
  • Prog2 Programming Assignment 10 ⛔ ibkw2j 🔼 📅 2024-04-22
  • Prog2 Quiz 7 ⛔ i7fjn5 🔼 📅 2024-03-29
  • Prog2 Quiz 8 ⛔ 4yqy8d 🔼 📅 2024-04-08
  • Prog2 Quiz 9 ⛔ 6yyjks 🔼 📅 2024-04-15
  • Prog2 Quiz 10 ⛔ ibkw2j 🔼 📅 2024-04-22
  • Prog2 Textbook Reading 7 🆔 i7fjn5 📅 2024-04-05
  • Prog2 Textbook Reading 8 🆔 4yqy8d 📅 2024-04-05
  • Prog2 Textbook Reading 9 🆔 6yyjks 📅 2024-04-12
  • Prog2 Textbook Reading 10 🆔 ibkw2j 📅 2024-04-19
  • ExampleTask13 📅 2024-03-30

presuming that they are being sorted by dependency, then by date, the result I'm hoping for is

  • Prog2 Textbook Reading 7 🆔 i7fjn5 📅 2024-04-05
  • Prog2 Quiz 7 ⛔ i7fjn5 🔼 📅 2024-03-29
  • ExampleTask13 📅 2024-03-30
  • Prog2 Programming Assignment 7 ⛔ i7fjn5 🔼 📅 2024-04-05
  • Prog2 Textbook Reading 8 🆔 4yqy8d 📅 2024-04-05
  • Prog2 Programming Assignment 8 ⛔ 4yqy8d 🔼 📅 2024-04-05
  • Prog2 Quiz 8 ⛔ 4yqy8d 🔼 📅 2024-04-08
  • Prog2 Textbook Reading 9 🆔 6yyjks 📅 2024-04-12
  • Prog2 Programming Assignment 9 ⛔ 6yyjks 🔼 📅 2024-04-15
  • Prog2 Quiz 9 ⛔ 6yyjks 🔼 📅 2024-04-15
  • Prog2 Textbook Reading 10 🆔 ibkw2j 📅 2024-04-19
  • Prog2 Programming Assignment 10 ⛔ ibkw2j 🔼 📅 2024-04-22
  • Prog2 Quiz 10 ⛔ ibkw2j 🔼 📅 2024-04-22

@ferife
Copy link
Author

ferife commented Mar 26, 2024

As you can see, especially with the first two tasks in the result, the dependency takes precedence over the date, so textbook reading 7 is displayed before quiz 7 and before ExampleTask13 even though it is due later because quiz 7 cannot be done until textbook reading 7 is done

@claremacrae claremacrae removed question Further information is requested status: wontfix This will not be worked on labels Mar 26, 2024
@claremacrae claremacrae reopened this Mar 26, 2024
@claremacrae
Copy link
Collaborator

Brilliant - that really helps clarify things a lot.

It will get tricky when a task depends on multiple other tasks, or if there are cyclic dependencies, but I can see the basic principle.

@ferife
Copy link
Author

ferife commented Mar 26, 2024

Great. I edited my example to clarify that if a dependency is due after tasks unrelated to the dependent which is due before those tasks, the dependency should appear before all of those too. That's what ExampleTask13 is about

@claremacrae
Copy link
Collaborator

claremacrae commented Mar 26, 2024

That isn't how the Tasks sorting works sadly.

  • It first sorts all the tasks by criterion 1 - dependency.
  • Then it sorts all the tasks that had equal priority according to criterion 1, using the criterion 2 sort order - due date.

So as far as I can see, sorting by dependency would have to do something like put all the tasks without a dependency after all the tasks with a dependency.

It might require some kind of grouping to get the behaviour you want.

(And whilst you would like the second criterion to be due date, someone else may choose start date, or priority... so it's not obvious how to write special-case code to combine together sort criteria in the way you show in your example)

@ferife
Copy link
Author

ferife commented Mar 26, 2024

That isn't how the Tasks sorting works sadly.

* It first sorts all the tasks by criterion 1 - dependency.

* Then it sorts all the tasks that had equal priority according to criterion 1, using the criterion 2 sort order - due date.

So as far as I can see, sorting by dependency would have to do something like put all the tasks without a dependency after all the tasks with a dependency.

It might require some kind of grouping to get the behaviour you want.

(And whilst you would like the second criterion to be due date, someone else may choose start date, or priority... so it's not obvious how to write special-case code to combine together sort criteria in the way you show in your example)

Fair enough. In that case, maybe the query example I gave could be the result of sorting by dependency and grouping by due date.

It seems to me that if the primary sorting criterion is dependency, the user should specify the other secondary criteria using group by instead of sort by.

Though if that's how that's going to work users would probably want a way to hide the group headings, but that seems like a separate discussion from this.

@ferife
Copy link
Author

ferife commented Mar 26, 2024

Brilliant - that really helps clarify things a lot.

It will get tricky when a task depends on multiple other tasks, or if there are cyclic dependencies, but I can see the basic principle.

Regarding cyclic dependencies, the best I can come up with would be to throw up an error message if one is detected to avoid infinite recursion problems. Perhaps there is a better solution, but I wouldn't really know since I've yet to need cyclic dependencies in my vault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: sorting Changes to the sorting capabilities scope: task dependencies Anything to do with making tasks aware of other tasks type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants