Skip to content

feat(hbs-gestures): hold, swipe and tap actions for the horizontal buttons stack - #22

Merged
HyperCriSiS merged 1 commit into
mainfrom
feat/hbs-gestures
Nov 14, 2026
Merged

HyperCriSiS merged 1 commit into
mainfrom
feat/hbs-gestures

Conversation

@HyperCriSiS

Copy link
Copy Markdown
Owner

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 standard hass-action events, the same way Bubble Card does it.

Verification

  • Module logic exercised in Node with the Bubble Card v3.4.2 template signature: swipe up, fallback swipe down, none override, tap override, hold, click suppression and teardown.
  • New real HA E2E test tests/ha_e2e/test_hbs_gestures_lovelace.py against 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, none blocking the fallback, and a short hold staying a native tap.
  • Offline fixture test extended for the new view.

Deliberately different

  • Swipe left and right are not offered because they scroll the stack.
  • While a swipe gesture is configured, buttons get touch-action: pan-x, so a vertical drag starting on the fixed bar no longer scrolls the page.

@HyperCriSiS
HyperCriSiS merged commit 2004243 into main Nov 14, 2026
1 check failed
@HyperCriSiS
HyperCriSiS deleted the feat/hbs-gestures branch November 14, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant