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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add todo-list card #735

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

Conversation

lscheibel
Copy link

Description

I've added a new mushroom card as an alternative to the default shopping_list card offered by HA. It uses the common icon + title + state layout and displays its contents below. For the input I adopted the entity-control style even though the shopping-list is not really an entity I thought it looked quite nice. The editor allows to change common attributes like the name and layout but also what icons to use for the checked and unchecked state of items. This allows for some very minimal lists when used together with other themes.

image

image

(the misaligned checkboxes are a bug in webkit & blink and only appear in this preview.)
image

image

image

Related Issue

#734

Motivation and Context

This PR provides a visually pleasing card for the shopping_list integration.

How Has This Been Tested

All features which are implemented have been tested in Chrome, Safari and Firefox on a Mac machine.

Types of changes

  • 馃悰 Bug fix (non-breaking change which fixes an issue)
  • 馃殌 New feature (non-breaking change which adds functionality)
  • 馃寧 Translation (addition or update a translation)
  • 鈿狅笍 Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have tested the change locally.

Copy link
Owner

@piitaya piitaya left a comment

Choose a reason for hiding this comment

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

Nice 馃檪 I just left few comments

src/cards/shopping-list-card/shopping-list-card.ts Outdated Show resolved Hide resolved
src/cards/shopping-list-card/shopping-list-card.ts Outdated Show resolved Hide resolved
src/cards/shopping-list-card/shopping-list-card-input.ts Outdated Show resolved Hide resolved
@lscheibel
Copy link
Author

Thanks for taking the time! FYI I also added a link to the shopping list docs in the README.md

@CallMeAreks
Copy link

@piitaya

@lscheibel
Copy link
Author

Rebased and resolved merge conflicts.

@alessandroias
Copy link
Contributor

@piitaya Can you share you thought on this?

@netsoft-ruidias
Copy link

@lscheibel by any chance, can you create your own card with this look and feel?
Even if it has a dependency on Mushroom?

This proposal of yours is a huge improvement over the standard version and looks like it will never see the light of day.

It would be a shame to lose your work, congratulations on the initiative 馃憣.

cc; @piitaya @alessandroias @CallMeAreks

@lscheibel
Copy link
Author

@netsoft-ruidias Thanks for the kind words! Unfortunately, I won't get around to working on this for at least another month, but I should try it by then :)

# Conflicts:
#	src/mushroom.ts
@DannyFeliz
Copy link

I think this PR is more relevant than ever since in HA 2023.11 they added a lot of stuff related to todo lists.

@lscheibel
Copy link
Author

@DannyFeliz That sounds great! I'll check what needs to be adjusted to make this work the new entity.

@piitaya
Copy link
Owner

piitaya commented Nov 2, 2023

I was busy so I haven't given any recent feedback on this PR.
Also, shopping list was unmaintained in HA codebase so I wasn't too in favor of merging this PR.
With the latest release, I think we can make it part of the Mushroom 馃檪

Only few comments :

  • I'm not sure about adding the possibility to have option check and uncheck icon. Can we use ha-checkbox component to have focus/hover style for accessibility support?
  • Let's rename it to todo-card and use todo entities instead of shopping list.
  • It can be nice to have tap/hold/double tap action for the top part to be consistent with other Mushroom cards.

@lscheibel
Copy link
Author

@piitaya I've updated the card to work with the new todo entity :)

image


Feedback:

Personally, I don't think the ha-checkbox or by extension the material checkbox is a good fit for the visual language of mushroom. Neither the bright blue color nor the ripple effect are visible in any other mushroom component. The same applies to focus and hover styles, which are noticeably absent from other mushroom cards, so I'm a bit surprised to see them as a requirement here.

If you want I can add those, also without using the ha-checkbox though. We could even open another issue where other cards would receive some a11y treatment as well.

Here's an example of what the ha-checkbox would look like:
image

Regarding the customizable icons, especially for the light theme, I personally much prefer the outlined checkboxes and would use those, while the defaults are chosen to fit the overall style the best. Nonetheless, I understand that mushroom tries to offer as few options as possible, so if this would block the merge of this PR, I'll remove them and maybe add a separate PR where this could be discussed.

@lscheibel lscheibel changed the title Add shopping-list card Add todo-list card Nov 5, 2023
@ScreepCode
Copy link

Is there any update on this topic?
Since 2024.01 the todo-list feature is even more improved by adding due dates and descriptons with markdown support
Would love to the the mushroom card in dashboards ^^

@lscheibel
Copy link
Author

I can implement the new changes, namely support for descriptions and due dates and removal of the old shopping_list API, although I would need some form of feedback from @piitaya first. Next to the questions from my feedback above, I would like to ask how we'd go about rendering the markdown? I know that mushroom tries to be somewhat lean in its dependencies, so we could also render the markdown as plain text for now and make markdown support a different feature for the "maybe"-future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants