-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Conditional tile feature #20612
Conditional tile feature #20612
Conversation
Hi 👋 Thank you for the contribution. We didn't introduced the conditional feature because of UX concerns. The tile card has been designed to fit in a grid (e.g. section). The number of features determine the height of the card on the grid.
Also, in the future, we will allow resizing of card so we need fixed card size for that. CleanShot.2024-06-07.at.16.16.42.mp4 |
Hey, I have done a little experiment with the sections layout and the conditional card. It also produces layout shift when toggling. It may be worth adding a context aware warning to the editors for conditional cards, rows, and features (once implemented). It should detect when a conditional thing is inside a sections layout and display a warning stating that it may cause layout shift. This way the option is available for people like me who prefer the older layouts and who like spending a lot of time on their dashboards, without affecting those who don't. I was planning on implementing the editors for conditional rows and features on a separate pull-request and sharing logic between them, I am happy to add the warning to the editors when I do that. Thanks for the feedback, I wouldn't have thought to look at the sections layout. Edit: |
@piitaya, I have been experimenting with the new |
The calculation of height of the card on the grid is based on the config of the card. The base size is 1. Vertical option adds 1 and each feature adds 1. By adding this feature, we will need to recalculate the height when the visibility change and it will produce layout shifting. With However, custom features are supported so your PR can be moved to a custom feature for now (see documentation) |
Proposed change
Added a conditional tile feature that uses the generic, pre-defined conditions code from the card and row.
This does not include a visual editor for the feature, as that is not yet implemented for the entity row either, and I am planning to implement it as a separate pr.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: