mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
fix v1.42.2: no hover tooltips on touch devices
- taps on tablets synthesized mousemove and popped the tooltip over the finger (user feedback item 5); _showTip gated by (hover: none) - smoke_touch_tips.mjs (matchMedia shim); TESTING/CHANGELOG same-commit
This commit is contained in:
@@ -11,7 +11,7 @@ PLANS_DIR = "houseplan/plans" # relative to the HA configuration directory
|
|||||||
FILES_URL = "/houseplan_files/files"
|
FILES_URL = "/houseplan_files/files"
|
||||||
FILES_DIR = "houseplan/files"
|
FILES_DIR = "houseplan/files"
|
||||||
CONF_ADMIN_ONLY = "admin_only"
|
CONF_ADMIN_ONLY = "admin_only"
|
||||||
VERSION = "1.42.1"
|
VERSION = "1.42.2"
|
||||||
|
|
||||||
DEFAULT_CONFIG: dict = {
|
DEFAULT_CONFIG: dict = {
|
||||||
"spaces": [],
|
"spaces": [],
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -16,5 +16,5 @@
|
|||||||
"issue_tracker": "https://github.com/Matysh/houseplan-card/issues",
|
"issue_tracker": "https://github.com/Matysh/houseplan-card/issues",
|
||||||
"requirements": [],
|
"requirements": [],
|
||||||
"single_config_entry": true,
|
"single_config_entry": true,
|
||||||
"version": "1.42.1"
|
"version": "1.42.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { launch } from './serve.mjs';
|
||||||
|
const { page, browser } = await launch();
|
||||||
|
// эмуляция тач-устройства: переопределяем matchMedia ДО загрузки бандла
|
||||||
|
await page.addInitScript(() => {
|
||||||
|
const orig = window.matchMedia.bind(window);
|
||||||
|
window.matchMedia = (q) => q.includes('hover: none')
|
||||||
|
? { matches: true, media: q, addEventListener() {}, removeEventListener() {}, addListener() {}, removeListener() {}, onchange: null, dispatchEvent: () => false }
|
||||||
|
: orig(q);
|
||||||
|
});
|
||||||
|
await page.reload();
|
||||||
|
await page.waitForFunction(() => window.__card && window.__card._devices?.length, null, { timeout: 15000 });
|
||||||
|
const res = await page.evaluate(async () => {
|
||||||
|
const out = {};
|
||||||
|
const c = window.__card;
|
||||||
|
c._setMode('view'); await c.updateComplete;
|
||||||
|
// "тап" по комнате → mousemove-эмуляция → тултип НЕ должен появиться
|
||||||
|
c._showTip(new MouseEvent('mousemove', { clientX: 100, clientY: 100 }), 'Room', 'meta');
|
||||||
|
await c.updateComplete;
|
||||||
|
out.noTipOnTouch = c._tip === null || c._tip === undefined || !c._tip;
|
||||||
|
return out;
|
||||||
|
});
|
||||||
|
console.log(JSON.stringify(res));
|
||||||
|
await browser.close();
|
||||||
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.42.2 — 2026-07-26
|
||||||
|
- Touch devices no longer pop hover tooltips on every tap (field feedback:
|
||||||
|
"extra labels appear and get in the way on a tablet"). Hover tooltips are
|
||||||
|
desktop-only now; on touch the same data lives in room cards and the
|
||||||
|
long-press device card.
|
||||||
|
|
||||||
## v1.42.1 — 2026-07-26 (room-card font sizes)
|
## v1.42.1 — 2026-07-26 (room-card font sizes)
|
||||||
- Closing the "can't change the font size" feedback: **three sliders**.
|
- Closing the "can't change the font size" feedback: **three sliders**.
|
||||||
Space settings gained a base room-card font size for the whole space;
|
Space settings gained a base room-card font size for the whole space;
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ Run the *core flows* (marked ★ below) in each environment at least once per mi
|
|||||||
(explicit ripple color still wins); off/white lights unchanged [auto]
|
(explicit ripple color still wins); off/white lights unchanged [auto]
|
||||||
- [ ] Alarm pulse (v1.27.0): leak/smoke/gas/CO/siren in 'on' pulse a red ring over any
|
- [ ] Alarm pulse (v1.27.0): leak/smoke/gas/CO/siren in 'on' pulse a red ring over any
|
||||||
display mode; clears on 'off'; unavailable never alarms [auto]; reduced-motion static
|
display mode; clears on 'off'; unavailable never alarms [auto]; reduced-motion static
|
||||||
|
- [ ] No hover tooltips on touch (v1.42.2): on hover-less devices (tablets,
|
||||||
|
phones) taps never pop the room/device tooltip — the data lives in room
|
||||||
|
cards and long-press; desktop hover tooltips unchanged [auto]
|
||||||
- [ ] Card font scales (v1.42.1): three sliders — space-level base (space
|
- [ ] Card font scales (v1.42.1): three sliders — space-level base (space
|
||||||
dialog) plus per-room name and metrics sizes (room settings), 50–300%,
|
dialog) plus per-room name and metrics sizes (room settings), 50–300%,
|
||||||
multiplied together and on top of resize-k and kiosk multipliers; the
|
multiplied together and on top of resize-k and kiosk multipliers; the
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "houseplan-card",
|
"name": "houseplan-card",
|
||||||
"version": "1.42.1",
|
"version": "1.42.2",
|
||||||
"description": "Interactive house plan Lovelace card for Home Assistant",
|
"description": "Interactive house plan Lovelace card for Home Assistant",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
+11
-1
@@ -32,7 +32,7 @@ import './space-card';
|
|||||||
import { cardStyles } from './styles';
|
import { cardStyles } from './styles';
|
||||||
import { langOf, t, type I18nKey } from './i18n';
|
import { langOf, t, type I18nKey } from './i18n';
|
||||||
|
|
||||||
const CARD_VERSION = '1.42.1';
|
const CARD_VERSION = '1.42.2';
|
||||||
const LS_KEY = 'houseplan_card_layout_v1';
|
const LS_KEY = 'houseplan_card_layout_v1';
|
||||||
const LS_CFG = 'houseplan_card_cfg_v1'; // cache of the server config+layout for instant rendering
|
const LS_CFG = 'houseplan_card_cfg_v1'; // cache of the server config+layout for instant rendering
|
||||||
const LS_ZOOM = 'houseplan_card_zoom_v1';
|
const LS_ZOOM = 'houseplan_card_zoom_v1';
|
||||||
@@ -1267,7 +1267,17 @@ class HouseplanCard extends LitElement {
|
|||||||
}, 3500);
|
}, 3500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** True on touch-first devices (tablets/phones): no real hover there. */
|
||||||
|
private static readonly _noHover =
|
||||||
|
typeof window !== 'undefined' &&
|
||||||
|
typeof window.matchMedia === 'function' &&
|
||||||
|
window.matchMedia('(hover: none)').matches;
|
||||||
|
|
||||||
private _showTip(ev: MouseEvent, title: string, meta: string, lqi?: number | null, temp?: number | null): void {
|
private _showTip(ev: MouseEvent, title: string, meta: string, lqi?: number | null, temp?: number | null): void {
|
||||||
|
// Field feedback: on tablets every tap synthesized a mousemove and popped
|
||||||
|
// the hover tooltip over the finger. Touch devices get NO hover tooltips —
|
||||||
|
// the same data lives in room cards and the long-press device card.
|
||||||
|
if (HouseplanCard._noHover) return;
|
||||||
if (this._drag) return;
|
if (this._drag) return;
|
||||||
this._tip = { x: ev.clientX, y: ev.clientY, title, meta, lqi, temp };
|
this._tip = { x: ev.clientX, y: ev.clientY, title, meta, lqi, temp };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user