Skip to content

Todo List Card: Add customization options for empty text, visibility, and interaction #24788

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

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

Conversation

halwehrenberg
Copy link

Overview

This PR adds three new customization options to the Todo List card:

  1. Configurable empty list text: Users can customize the message shown when there are no tasks by setting the empty_list_text property.

  2. Option to hide empty list message: Added a hide_empty_list property that, when set to true, completely hides the empty list message (including vertical space).

  3. Disable editor with click actions: Added a disable_edit_on_click property that prevents the editor from opening when clicking on an item. When this option is enabled, clicking on an item toggles its completion status instead. (Particularly good for re-usable lists like weekly chores)

Why

These enhancements improve customization options for users who:

  • Want to personalize the empty list message
  • Prefer to hide the empty message entirely to save space
  • Want a simpler interaction model where clicking items toggles them instead of opening the editor

Testing

I've tested all three features in my local environment:

  • Custom empty list text displays correctly
  • Empty list area is completely hidden when specified
  • Item toggling works properly when editor is disabled

No performance issues or regressions were found.

Breaking Changes

None. These changes only add optional features that are disabled by default, maintaining backward compatibility.

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @halwehrenberg

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft March 26, 2025 19:54
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@halwehrenberg halwehrenberg marked this pull request as ready for review March 26, 2025 20:22
@halwehrenberg
Copy link
Author

To Do List Enhancements Test
To Do List Enhancements Editor
Screenshots of the visual editor and the different states visible when testing.

@MindFreeze
Copy link
Contributor

Some comments from a UX perspective:

  • hide_empty_list shouldn't be an option. It is not clear what it does. Sounds like it hides the whole list which should be done with visibility options instead. For removing margins, we should just always do that if there is not empty message. How to set the message to empty is not clear though
  • disable_edit_on_click is again not clear. I get that it disables edit but I wouldn't expect it to toggle the item. Our established pattern is to set actions, like tap_action in this case

@halwehrenberg
Copy link
Author

halwehrenberg commented Mar 28, 2025

@MindFreeze, Thanks for the feedback! I like it. I plan to update to:

  • empty_list_text - customizes the text shown when list is empty (this is current behavior)
  • show_empty_text (default: true) - Controls whether to show the empty message text (and its margin)
  • disable_item_editing (default: false) - Prevents the edit dialog from opening when clicking item labels. Remove toggle behavior
  • toggle_on_item_label_click (default: false) - Split to separate option. Controls whether clicking the item label toggles its checkbox

Watching my own family interact with the cards, these are things that I had to implement via card mod & a lot of effort. I also seen enough traffic on forums to know that these features are useful from a Ux point of view within common use cases like Chores Lists for kids. Great comment, to my eyes this will help a lot!

@MindFreeze MindFreeze added the Needs UX Pull requests requiring a review from the Home Assistant design team label Mar 28, 2025
@halwehrenberg
Copy link
Author

halwehrenberg commented Mar 28, 2025

@MindFreeze, I've updated the PR based on the feedback:

  1. Renamed properties to better reflect their purpose:

    • Renamed hide_empty_list to show_empty_text (default: true)
    • Renamed disable_edit_on_click to disable_item_editing (default: false)
  2. Split the item click behavior into two separate options:

    • disable_item_editing - Prevents the edit dialog from opening when clicking item labels
    • toggle_on_item_label_click (default: false) - Controls whether clicking the item label toggles its checkbox
  3. Added proper default values in the editor component

These changes maintain the same functionality but with clearer option names and better separation of concerns.
To Do List Enhancements Test
To Do List Enhancements Editor

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants