Skip to content

Support calling actions and editing #166

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

Merged
merged 2 commits into from
May 19, 2025

Conversation

EdLeckert
Copy link
Contributor

This PR supports the ability to call any Home Assistant actions by tapping, double-tapping, and tapping and holding configured cells. This feature is configured and behaves in the same way as other Home Assistant cards that support actions.

Also included because it is tightly connected with actions is the ability to edit the text in cells.

Finally, the ability to select and copy text has been added, since it is a simple one-line change.

The documentation has been updated extensively to explain these operations.

These changes, while significant, are not expected to cause any breaking changes. The user must opt-in for any of the new code to be active, with the exception of two small CSS changes. The change to "tr td" is necessary for tap-and-hold feedback and "ripple" feedback. The addition of ".type-custom-flex-table-card" was to fix a long-standing formatting issue with wide cards that was evident in some of the example screenshots I was using for the docs.

A couple of minor cosmetic changes to existing documentation were added due to their small size.

And, this satisfies #58, which you weren't too keen on at the time, but hopefully will see the value. I have been wanting the ability to do this for a long time, and am already happily using the new features in production.

It may also resolve #11. The card, when configured with many columns, already expands past the view's column width...it just didn't expand the background element to match. This is now handled by ".type-custom-flex-table-card", and it should be purely cosmetic.

As always, let me know if you have any questions or concerns.

@daringer daringer merged commit e47cb3f into custom-cards:master May 19, 2025
1 check passed
@daringer
Copy link
Collaborator

I'll try to do a testing round the next days, then I guess it will be time for a release - great work!

@EdLeckert
Copy link
Contributor Author

I'll try to do a testing round the next days, then I guess it will be time for a release - great work!

@daringer: Thanks, Markus. It definitely needs a release, or the docs will be confusing.

I modeled the action behaviors after the Tile Card. I tested on a Windows 10 laptop with mouse and touchscreen running Chrome, on an Amazon Fire Tablet running Fully Kiosk, and on a Samsung Galaxy phone running the Companion App.

I tested each function with one, the three combinations of two, and all three types of tap actions defined on a column. The three types of tap actions are tightly integrated, so this was necessary.

I'm not aware of any issues other than the minor ones listed in the docs, but thorough testing is certainly advisable.

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

Successfully merging this pull request may close these issues.

Card size/width
2 participants