frontend
frontend copied to clipboard
Reorderable card-feature modes
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).
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] 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 #19686, fixes #19576
- This PR is related to issue or discussion:
- Link to documentation pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] 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:
- [ ] Documentation added/updated for www.home-assistant.io
Suggestion: show the default modes as chips from the start, instead of adding one mode to start with a clean sheet.
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.
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?
https://github.com/home-assistant/frontend/assets/5878303/d4f1ce54-2718-4e27-acd8-dbbe8225f10c
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 😅
I like it!