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

Ability to sort groups by some user-defined property calculated from all the tasks in the group, such as most recent due date #1939

Open
2 tasks done
rhhub opened this issue May 8, 2023 · 4 comments
Labels
scope: grouping Changes to the grouping capabilities type: enhancement New feature or request

Comments

@rhhub
Copy link

rhhub commented May 8, 2023

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

🔖 Feature description

This feature request encompasses using "group by" then sorting the groups by the content of each group.

Possible Usecases

  1. sort groups by the highest priority task in each group
  2. sort groups by the soonest due/scheduled/created task in each group
  3. sort groups by some special aggregate calculation of each group (less useful and more complicated)

For Comparison Image

#t/group2 should come first because item 1 has the soonest date ⏳ 2023-05-10
image

Desired Image

notice group2 is above group1
image

✔️ Solution

I'm not sure what the solution would be. I think it would be called on the group by line.

Tasks' Steps

  1. Query tasks
  2. Display groups using group by
  3. Sort the groups by content in each group.

Users Steps

  1. Provide query language to modify group by order

Where user implements sort logic:

```tasks
not done
group by tags SOME CALL HERE
sort by priority
```

❓ Alternatives

I noticed #1421 had some functions added to the group by call. I'm not sure the extent of that addition.

📝 Additional Context

markdown of first screenshot:

- [ ] item 1 #t/group2  ⏳ 2023-05-10
- [ ] item 2 #t/group2  ⏳ 2023-05-14 
- [ ] item 3 #t/group1  ⏳ 2023-05-13
- [ ] item 4 #t/group1  ⏳ 2023-05-14 

```tasks
not done
group by tags
sort by priority
```
@claremacrae
Copy link
Collaborator

Hi @rhhub, Thank you for the write-up.

I regret to say that I have read it multiple times and am not at all confident that I understand what exact change in Tasks functionality it is requesting.

This feature request is made to satisfy the following statement: Grab the next task then get all tasks that share context with it. If I have tasks labeled #grocerystore, it would be helpful to get all tags that share grocerystore.

For example, I am struggling to understand what "If I have tasks labeled #grocerystore, it would be helpful to get all tags that share grocerystore. " means...

Especially as the example tasks you give do not mention #grocerystore - so I cannot see how the tags relate to the request.

I think that what you are saying is:

  • That you use the tag #grocerystore to indicate the tasks that you need to do, or would like to do, when you are at the grocery store.
  • That you know how to search for all tasks containing the tag #grocerystore
  • But there is some limitation in how Tasks presents those matching tasks... the tasks with tag #grocerystore. What limitation?

If you could please provide a more concrete description of the real-world problem you are trying to solve, maybe I can make suggestions. Thanks.

In case you don't know, it's possible to give multiple sort by instructions in tasks blocks. The first sort line takes precedence, but where 2 or more tasks have the same value for the first sort line, they are compared/sorted by the second sort line, and so on...

So you have a lot of control over the sort of tasks within groups.

What is currently not yet possible is to control the order of the groups themselves.

@claremacrae claremacrae added question Further information is requested scope: sorting Changes to the sorting capabilities scope: grouping Changes to the grouping capabilities labels May 9, 2023
@rhhub
Copy link
Author

rhhub commented May 9, 2023

Hi,

I updated the original post. It does require sorting groups. I think it's less ambiguous now.

One example:
I want to sort the groups. When I "group by", each of those groups contain tasks. Steps to sort groups:

  1. In a single group find the task with the highest priority.
  2. Sort the groups by each respective priority found in step 1

@claremacrae claremacrae changed the title sort groups by the contents of group Ability to sort groups by some user-defined property calculated from all the tasks in the group, such as most recent due date May 9, 2023
@claremacrae
Copy link
Collaborator

OK, I get it. Thank you very much indeed.

I've updated the description/summary to try to make it fully reflect the request.

Just to set expectations, the current code design is a long way off being able to sort this.

@claremacrae claremacrae removed the question Further information is requested label May 9, 2023
@rhhub
Copy link
Author

rhhub commented May 9, 2023

That's fair. Your help in #1940 will get me by with use tag contexts more. Thank you.

@claremacrae claremacrae removed the scope: sorting Changes to the sorting capabilities label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: grouping Changes to the grouping capabilities type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants