Use breakpoints to define number of columns in section view #21808
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking change
The logic to define columns count can be moved from min and max width to breakpoints logic. As a result, behavior for some theme variables has changed :
ha-view-sections-column-min-width
theme variable will not be used anymore.ha-view-sections-column-max-width
theme variable is still used when the bigger breakpoint is reached to avoid too large sections.Proposed change
Caution
Highly experimental
This feature is introduced for testing and should not be used in production dashboard. It can be removed at any time.
Breakpoints can be enabled by setting
experimental_breakpoints
option totrue
in the YAML view settings.Breakpoints are introduced for multiple reason :
Here's the default breakpoints :
Breakpoints can be customized with the YAML syntax in the view options :
Demo
Using min and max width of the columns
CleanShot.2024-09-05.at.15.58.05.mp4
Using breakpoints
CleanShot.2024-09-05.at.16.00.00.mp4
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: