Repository navigation
feat(hbs-gestures): hold, swipe and tap actions for the horizontal buttons stack - #22
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
New module
hbs_gestures(HBS Gestures) for the horizontal buttons stack card. Each button can get a hold, swipe up, swipe down and tap action, configured as any Home Assistant action (navigate to a pop-up hash, toggle, more info, perform action, URL, Assist, DOM event). An entry without a button number applies to every button; an entry with a number wins over it gesture by gesture. A fired gesture suppresses the native tap of the button, and without a tap action the native tap stays unchanged.Listeners are attached once per card on the card element (delegated, so rebuilt buttons keep working) and released through
onTeardown. Actions are dispatched as standardhass-actionevents, the same way Bubble Card does it.Verification
noneoverride, tap override, hold, click suppression and teardown.tests/ha_e2e/test_hbs_gestures_lovelace.pyagainst Bubble Card v3.4.2 in isolated HA: native tap, mouse hold, mouse swipe up opens a pop-up, touch swipe down via fallback entry, touch hold, touch swipe up, tap override,noneblocking the fallback, and a short hold staying a native tap.Deliberately different
touch-action: pan-x, so a vertical drag starting on the fixed bar no longer scrolls the page.