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

Reorderable card-feature modes #20647

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

karwosts
Copy link
Contributor

@karwosts karwosts commented Apr 28, 2024

Proposed change

  • Allow card feature modes to be reordered.
  • Default the card feature list to empty array, and treat empty array as all possible modes. This allows card to automatically update if modes change in the future (like if additional presets are added).

reorder-features

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:

@matthiasdebaat
Copy link
Collaborator

Suggestion: show the default modes as chips from the start, instead of adding one mode to start with a clean sheet.

@karwosts
Copy link
Contributor Author

I had wanted to avoid baking the list into the config yaml at creation time. If I prepopulate all the chips as selected, than any interaction with the entire form (e.g. changing the dropdown/icons toggle) causes the list of modes to be committed to the yaml. Not sure if I wanted to do that.

@piitaya
Copy link
Member

piitaya commented Apr 29, 2024

Just a proposal : can we have the user opt-in to customize modes the mode?
By default the modes are undefined. If the user activate Customize modes, we populate the modes with all the supported modes. If the user desactivate it, we revert the modes to undefined.
Basically, it's @karwosts proposal but with a boolean in the UI to avoid implicit fallback to supported modes.
WDYT @matthiasdebaat?

CleanShot.2024-04-29.at.09.19.33.mp4

If you agree, we can merge this one and I can do the changes in another PR as I already have the changes locally to the video 😅

@matthiasdebaat
Copy link
Collaborator

I like it!

@bramkragten bramkragten requested a review from piitaya April 29, 2024 15:10
@piitaya piitaya merged commit a78608b into home-assistant:dev Apr 29, 2024
13 checks passed
@karwosts karwosts deleted the reorder-card-features branch April 29, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants