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

Render todo items with no state, change look of read only items #24529

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

Conversation

bramkragten
Copy link
Member

Proposed change

Todo items without state would never be shown.

Read only items would be shown as disabled, now only the checkbox is disabled, and the item is made noninteractive.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

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:

@github-actions github-actions bot added Demo Related to frontend demo content Design Related to Home Assistant design gallery labels Mar 6, 2025
@@ -25,7 +25,7 @@ export enum TodoSortMode {
export interface TodoItem {
uid: string;
summary: string;
status: TodoItemStatus;
status?: TodoItemStatus;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is closer to the typing in core

Suggested change
status?: TodoItemStatus;
status: TodoItemStatus | null;

@@ -319,10 +334,16 @@ export class HuiTodoListCard extends LitElement implements LovelaceCard {
"ui.panel.lovelace.cards.todo-list.no_unchecked_items"
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a bit weird to show this if there are todo-items without status. Maybe only show this if both uncheckedItems and itemsWithoutStatus are empty?

Comment on lines +337 to +342
${itemsWithoutStatus.length
? html`
<div class="divider" role="seperator"></div>
${this._renderItems(itemsWithoutStatus, unavailable)}
`
: nothing}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this have a title? Also, if the list supports reordering and there are no active items the menu for reordering is currently not shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Demo Related to frontend demo content Design Related to Home Assistant design gallery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants