AmoebeLabs / swiss-army-knife-card

The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
223 stars 19 forks source link

Link user actions between tools #225

Closed stinobook closed 1 year ago

stinobook commented 1 year ago

The Problem To Be Solved

This feature is mainly going to be interesting for browser mod popups.

Sak card with multiple tools: rectex for background icon name ...

Now when you want a tap action browser mod popup you can add it for example to the rectex. However when you tap the icon you will still get the more-info dialog for the entity or you have to disable the tap action completely. When doing this however sometimes it may seem like your card isn't responding since you tapped the icon instead of the rectex.

You can of course always add a browser mod popup for every tool, but when you want to change something about the popup you have to change it for every tool that you want to launch the popup.

So i think it might be interesting to be able to link tap-actions from one tool to the other.

(Optional): Suggested Solution

I see 2 solutions: Either make the actual link where you can link tap actions between tools. but this seems pretty complicated. Or in my mind an easy solution: make it so you tap 'through' the top tool to the one below. say an option to disable tap action

                          user_actions:
                            tap_action:
                              tap_through: true
AmoebeLabs commented 1 year ago

You should get the tap-through by setting the pointer-events: none style on the icon and name.

Can you try that?

stinobook commented 1 year ago

Well that works indeed! nice! not sure if anybody will be able to use the linking then but for me the tap-through is enough! tyvm!

AmoebeLabs commented 1 year ago

Great!

This is the way HTML/SVG works with these CSS pointer-events to allow for click-through events.

I close this issue for now.