-
Notifications
You must be signed in to change notification settings - Fork 3k
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
base: dev
Are you sure you want to change the base?
Conversation
@@ -25,7 +25,7 @@ export enum TodoSortMode { | |||
export interface TodoItem { | |||
uid: string; | |||
summary: string; | |||
status: TodoItemStatus; | |||
status?: TodoItemStatus; |
There was a problem hiding this comment.
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
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" |
There was a problem hiding this comment.
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?
${itemsWithoutStatus.length | ||
? html` | ||
<div class="divider" role="seperator"></div> | ||
${this._renderItems(itemsWithoutStatus, unavailable)} | ||
` | ||
: nothing} |
There was a problem hiding this comment.
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.
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
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: