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

Option to sort todo lists #23579

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

karwosts
Copy link
Contributor

@karwosts karwosts commented Jan 4, 2025

Proposed change

Add an option to todo card to automatically sort items either by alphabetical order, or sort by due date.

Default/None is the current behavior that allows manual sorting and displays items in the order returned by the integration.

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@home-assistant home-assistant bot added cla-signed WTH Issues & PRs generated from the "Month of What the Heck?" labels Jan 4, 2025
@wendevlin
Copy link
Contributor

This is a card only change right?
But it should be in sync with the todo panel

@karwosts
Copy link
Contributor Author

karwosts commented Jan 7, 2025

Yes it just affects the display of the list, it doesn't modify the todo entity itself.

But it should be in sync with the todo panel

Don't we often have cards that have more options than their respective panel? The map card can behave differently than the map panel, the calendar card can show a different view than the calendar panel. This didn't seem too far from that precedent.

Or if you have an alternative idea I'm open to hear it. I think especially for todo tracking lists there really should be a way to show the soonest due at the top of the list, or else it is harder to use it to see what needs to be done.

@wendevlin
Copy link
Contributor

It just can lead to confusion because the data shows differnet on the same lists.

We have an idea. What about adding sort actions in the overflow which actually manipulate the list everywhere. So you add new items and then sort it by alphabeth afterwards. This actions can be in the panel and in the card.
We do need also an option for ASC and DESC especially for date sort.

@karwosts
Copy link
Contributor Author

karwosts commented Jan 8, 2025

We have an idea. What about adding sort actions in the overflow which actually manipulate the list everywhere. So you add new items and then sort it by alphabeth afterwards. This actions can be in the panel and in the card.
We do need also an option for ASC and DESC especially for date sort.

Hmm, I do still need dynamic sort for my usecase. I am building out a recurring chore tracker, (Currently use Grocy but I'm trying to see if what we have natively is feature-rich enough to replicate it). I have items that are changing due-dates dynamically. I just want to see the soonest due at the top of the list always, I don't want to have to manually trigger re-sort over and over in the UI every time the due dates change.

I could agree to add sort options in the overflow menu on the card (but still dynamic sort), but if I proceed here I would still want to have a default dynamic sort available as an option in the config.

@karwosts
Copy link
Contributor Author

karwosts commented Jan 8, 2025

Also I will point out that not all todo providers allow MOVE_TODO_ITEM (one of the feature flags).

Dynamic sort will allow us to show these lists as sorted, even when the integration itself does not allow remote sorting.

@wendevlin wendevlin added the Needs UX Pull requests requiring a review from the Home Assistant design team label Jan 13, 2025
@wendevlin
Copy link
Contributor

Ok I understand your point. We'll discuss it with the UX team

@wendevlin
Copy link
Contributor

Hello @karwosts,

  • We would like to name it "Display order" instead of "Sort items"
  • None should be "Manuall", if the integration supports it, otherwise "Default"
  • Then we should provide options: A-Z, Z-A, Due date First-Last, Due date Last-First
    • Try it out if a radio select is still ok or maybe you use a select box instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Needs UX Pull requests requiring a review from the Home Assistant design team WTH Issues & PRs generated from the "Month of What the Heck?"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants