Compare commits

...
4 Commits
Author SHA1 Message Date
Jan Bouwhuis ce97427f46 Announce the state of network graph toggle buttons (#56083)
* Announce the state of network graph toggle buttons

* Remove cost_adjustment_day from the grid net cost test

* Make ariaPressed of ha-icon-button property-only
2026-11-23 19:49:49 +01:00
Petar Petrov c5b2c965bd Hide the history panel zoom bar until the charts are zoomed (#56087)
* Hide the history panel zoom bar until the charts are zoomed

* Keep the hidden history zoom bar in the tab order
2026-11-23 15:52:16 +00:00
Jan Bouwhuis 27fc38b3bf Give chart control buttons a square frame and highlight (#56081)
* Give chart control buttons a square frame and highlight

* Remove cost_adjustment_day from the grid net cost test
2026-11-23 15:37:20 +01:00
renovate[bot] 9ec8d0ec6f Update pnpm to v12.22.0 (#56084)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-23 14:34:32 +00:00
7 changed files with 123 additions and 96 deletions

No files matched your search

+1 -1
View File
@@ -222,7 +222,7 @@
"webpackbar": "7.0.0",
"workbox-build": "7.4.1"
},
"packageManager": "[email protected]1.0",
"packageManager": "[email protected]2.0",
"volta": {
"node": "24.22.3"
}
+65 -65
View File
@@ -7,162 +7,162 @@ importers:
configDependencies: {}
packageManagerDependencies:
pnpm:
specifier: 12.21.0
version: 12.21.0
specifier: 12.22.0
version: 12.22.0
packages:
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-iaWidxR5B9NUBpwMznCQu1yUpKB6BjTY5BYX2lORj76VsfINdj8Z8XWSzSNrGI8qlxa28Jzdp5fiaspzOaJZlA==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-n0kwk3uOtWGaSMJWUuxG8fLefRonw8jR27dhGzMcDz79Um37QKPLEGZAZF37iASbb2yBBQFl4hue6/SfQnmIdA==}
cpu: [arm64]
os: [android]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-35e5v3wlwjIYxDywq+R6/z8CE4gLOEgRxt18yqz1tMRLmx2mnW+CFJI2Q8+srTNjn7gykXUC0x1k195JNikC5A==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-1HERYEdvJEjU5p/lyI8g3YNEVdvVz6+omaqI1pKotZB9w92BlSXr0xTqur8X/8GAiE4B/pwZi8+eAi4v+KQVHg==}
cpu: [x64]
os: [android]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-F5OyMX/6zLSowpTZEQRojbCmPS1Pq+fyRaIinslsIe6Glh3qbyQ52u+Fe0eEzSaRuIbWZkXmAAXSWh6Q5Wrlgg==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-CU0m1tFFVW2QD2PDVTsdejYGoPzhMq04l/MnwhpCuM2iBXkMXqV52kH24U5A2SYULV4Y/TTYsKL5InKZblVNvw==}
cpu: [arm64]
os: [darwin]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-EzpvcsaE6hrrgYeEiAFYd2rSgFybYyxXhkAY7K3y6Hg3loVfcyJ81hHczpFzi8lW5RXtUlFECRPZ8ZAMRFQYYg==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-XjVoliuAZjcyQJVymR+n3xmkw3SBME3Sg7wjKBTNbOaTGe3RLIkXt8D9YXOoSnET8gyhQrY8fwThFT+Ki6IVNw==}
cpu: [x64]
os: [darwin]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-wNjuEnmdLks4aayPu/QZWQ5tQM9Jn+odUp/vwQM8BXRYoulkTZhtZTHoD60N6mUdLWef1hgUeUh8llNGEUsimw==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-BefdhvM+nrLXHCRVFmNv5yp4Zhwz29nEP+UPhsvGRRp4YRzgmyxT9r0lVts3Lg0FzcKOtPbM3o0Hyb2y0JF3yw==}
cpu: [x64]
os: [freebsd]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-Ceit9zn4g5ZqCJtx1fV8eJE7p8aeXMrGZ+Dc01vRqZLIUNgNeI+Ur0ruyqxtsnJx6rGADyXzohumxPLHjaJ5AQ==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-72fwiRonMxFAY4Fb611eTaR+8bYwH91SnWCg3aODjhigCMURFe5Pom+TtYM/GMrme2yirGkHbpzU2u0lMMCwTQ==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-4Oj/iF2TDCe2lcH0n4TupPR5sSdrNLclJB6xBElLMPCUOAvBhdf2rRlSaO5M4erJ6g4Fyy7YTXTpcmfFsKyxEA==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-1MZ3GfFCFckquAJP6WZ985Lrd5MP5YNA7vPZH79W+1QVzwl55fVMdsAOczdGnFeU4jqMwERnk129/1g9zYxhDw==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-s2o7rdSDeUTBFsNqxptpZXlTgT6cojmMVUOvTQvFNSv6Easian02ha4tR32fwwD97Au4YzIIjMCwywCF4D82Sw==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-JOmNBnncDB+9pa8ddtIp9qrLrKwvgzV92xWEFAXSBrDcPIIAdD7imtk3kZnoiApdRzPbQHHj6JJKKVmOUXN0Bw==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-EYv3GzxeBTITCuM3yGHHbpRFpUvyulkXpQ6LsjKAQNL3iaba1E6h9iDmlouLb3Io4AMMsfdk0/uG6poQ41uewA==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-4oJ2VAuzpEnySBxZ9uz9dwIZYqOcgJ7FWIFdPDf9QbkYo8NbskZ2ySgHwlDVnvQYGhTM45kFRDwjfhKYZJJ9PQ==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-8VXGNGVNEfs7pL9GTZOzFxjFEnMt4WL3rLOADR5/kPQ7ROTV9GfpVI2DPO/zArXFSkvfc9Zad/WypHLbvzoaTQ==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-wLbmg1e+9qAUbqZ29/BUvAQwiZtvgzKg3kjDIN4tkxrCATnneM2G0agFpD9yLHD3FT5J8bUB8RWSur5vqm4Vnw==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-MnC5vpIXYubhDZCgCwlfJMg7Cg6HupN2IuouT9gD/tUmOfVdQYqeyYccWbthyo/Jeto8de1oQlxeRN1+1Hl2DQ==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-ODMJgTVHvs/WOqQKE9Am5u7RztsNjXZpkn73z9z4SsU7Dtrr/3IQkjvsF1MGM9hbhMdGwl2BHAW91eCCipIsHQ==}
cpu: [x64]
os: [linux]
libc: [musl]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-8eufCjHXspKbNS/kh8q4Q0gqJoOuvC4Q5pgos6XS8By/nAMtP+jf8F1Cw9er840kfAX+PJ/ts+A9qnLE91rvXQ==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-iBAZAYCYoow6g0aObKmprKkIBGO72mK4KFfqIrY7jIdHRkAbN67tcN0zgaPE39UAEdMcrkLhLwEml+VMxf8h8Q==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-eyh1M8hQZCkLWxuva7S/fc1SbFbgqg0/5di0dgWmyiuc2Io3dbWVihDun8X+XM8zsR5uhIDvvZpbS9aZQbCovg==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-5y9seaGcEL2OH5p9PG1cZRnSQKENvzK8hTsTjkFxUxXM84OCDvSlaSLr4ABrjrxWKlo4k8bjnmW7NEwznlowGA==}
cpu: [x64]
os: [netbsd]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-7xTxxUXo/grRLivSeIl6B21gnsz7ooe5EMPcJmQqwxc8WLJVReN8MzrlHru8bqXfVr4X3+6ZGZscntKenlCBqQ==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-eMJWsyECSWxhGDQwPokhES8dJX0dsu7E0tUfhxAaUnFxX7oBKKNS7kBY9yY75sNq4CmMNLjhOtBwrVjd3bQ1Hg==}
cpu: [arm64]
os: [win32]
'@pnpm/[email protected]1.0':
resolution: {integrity: sha512-9TpkJemVApxJ1Z1w0ZFGN+AuSx4nJOqXSJUqMqDvaXTYwGOzvBiiWdFP9GN0ketiWCQS1Q0/pza2E7I3pP0OBQ==}
'@pnpm/[email protected]2.0':
resolution: {integrity: sha512-d0D0GIiDkdiUiENlz3sMOR3arSsApaXtBZl2+rDwbwtQJ5IIBopf4KVTSZDPr09yl2NUVglCS5roveGKpYCWOg==}
cpu: [x64]
os: [win32]
[email protected]1.0:
resolution: {integrity: sha512-Zv2CeO4ok1zpUXktNDZ/869cQyonVkRYIwKVM4NbjaUpu+C+UTCv1W7QcT+4eJ5Hutgtk71a4v5UsVVi1idu8A==}
[email protected]2.0:
resolution: {integrity: sha512-iUlAo9mlffpv03OZD7TkHgnC8tdtmC7R11J105Jn+Yj7Ti1AkAy+mSHGjZfGeqGhCW0nZjPbJI97NJJ6yd23pA==}
engines: {node: '>=18'}
hasBin: true
snapshots:
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
'@pnpm/[email protected]1.0':
'@pnpm/[email protected]2.0':
optional: true
[email protected]1.0:
[email protected]2.0:
optionalDependencies:
'@pnpm/exe.android-arm64': 12.21.0
'@pnpm/exe.android-x64': 12.21.0
'@pnpm/exe.darwin-arm64': 12.21.0
'@pnpm/exe.darwin-x64': 12.21.0
'@pnpm/exe.freebsd-x64': 12.21.0
'@pnpm/exe.linux-arm64': 12.21.0
'@pnpm/exe.linux-arm64-musl': 12.21.0
'@pnpm/exe.linux-ppc64': 12.21.0
'@pnpm/exe.linux-riscv64': 12.21.0
'@pnpm/exe.linux-s390x': 12.21.0
'@pnpm/exe.linux-x64': 12.21.0
'@pnpm/exe.linux-x64-musl': 12.21.0
'@pnpm/exe.netbsd-x64': 12.21.0
'@pnpm/exe.win32-arm64': 12.21.0
'@pnpm/exe.win32-x64': 12.21.0
'@pnpm/exe.android-arm64': 12.22.0
'@pnpm/exe.android-x64': 12.22.0
'@pnpm/exe.darwin-arm64': 12.22.0
'@pnpm/exe.darwin-x64': 12.22.0
'@pnpm/exe.freebsd-x64': 12.22.0
'@pnpm/exe.linux-arm64': 12.22.0
'@pnpm/exe.linux-arm64-musl': 12.22.0
'@pnpm/exe.linux-ppc64': 12.22.0
'@pnpm/exe.linux-riscv64': 12.22.0
'@pnpm/exe.linux-s390x': 12.22.0
'@pnpm/exe.linux-x64': 12.22.0
'@pnpm/exe.linux-x64-musl': 12.22.0
'@pnpm/exe.netbsd-x64': 12.22.0
'@pnpm/exe.win32-arm64': 12.22.0
'@pnpm/exe.win32-x64': 12.22.0
---
lockfileVersion: '9.0'
+6 -15
View File
@@ -2372,30 +2372,21 @@ export class HaChartBase extends MobileAwareMixin(LitElement) {
margin-inline-start: auto;
flex-shrink: 0;
pointer-events: auto;
/* Inherited, so buttons nested in slots or dropdowns get the frame too */
--ha-icon-button-background: var(--card-background-color);
--ha-icon-button-border: 1px solid var(--divider-color);
--ha-icon-button-border-radius: var(--ha-border-radius-sm);
--ha-icon-button-size: 32px;
color: var(--primary-color);
}
.top-controls.small {
top: 0;
}
.chart-controls.small {
flex-direction: row;
}
.chart-controls ha-icon-button,
.chart-controls ::slotted(ha-icon-button) {
background: var(--card-background-color);
border-radius: var(--ha-border-radius-sm);
--ha-icon-button-size: 32px;
color: var(--primary-color);
border: 1px solid var(--divider-color);
}
.chart-controls.small ha-icon-button,
.chart-controls.small ::slotted(ha-icon-button) {
--ha-icon-button-size: 22px;
--mdc-icon-size: 16px;
}
.chart-controls ha-icon-button.inactive,
.chart-controls ::slotted(ha-icon-button.inactive) {
color: var(--state-inactive-color);
}
.chart-legend {
max-height: 60%;
overflow-y: auto;
+6
View File
@@ -217,6 +217,7 @@ export class HaNetworkGraph extends LitElement {
<ha-icon-button
slot="button"
class=${this._physicsEnabled ? "active" : "inactive"}
.ariaPressed=${this._physicsEnabled ? "true" : "false"}
.path=${mdiGoogleCirclesGroup}
@click=${this._togglePhysics}
label=${this._localize("ui.panel.config.common.graph.toggle_physics")}
@@ -224,6 +225,7 @@ export class HaNetworkGraph extends LitElement {
<ha-icon-button
slot="button"
class=${this._showLabels ? "active" : "inactive"}
.ariaPressed=${this._showLabels ? "true" : "false"}
.path=${mdiFormatTextVariant}
@click=${this._toggleLabels}
label=${this._localize("ui.panel.config.common.graph.toggle_labels")}
@@ -846,6 +848,10 @@ export class HaNetworkGraph extends LitElement {
::slotted(ha-icon-button) {
margin-inline-end: var(--ha-space-3);
}
ha-icon-button.inactive,
::slotted(ha-icon-button.inactive) {
color: var(--state-inactive-color);
}
`;
}
+9 -1
View File
@@ -22,6 +22,9 @@ export class HaIconButton extends LitElement {
@property({ type: String, attribute: "aria-haspopup" })
ariaHasPopup!: "false" | "true" | "menu" | "listbox" | "tree" | "grid";
@property({ attribute: false })
ariaPressed!: "false" | "true" | "mixed";
@property({ attribute: "hide-title", type: Boolean }) hideTitle = false;
@property({ type: Boolean, reflect: true }) selected = false;
@@ -47,6 +50,7 @@ export class HaIconButton extends LitElement {
.accessibleLabel=${this.label ?? ""}
.title=${this.hideTitle ? "" : (this.label ?? "")}
aria-haspopup=${ifDefined(this.ariaHasPopup)}
.ariaPressed=${this.ariaPressed ?? null}
.disabled=${this.disabled}
.iconTag=${this.path ? "ha-svg-icon" : "span"}
.href=${this.href}
@@ -71,6 +75,9 @@ export class HaIconButton extends LitElement {
display: inline-block;
outline: none;
--ha-button-height: var(--ha-icon-button-size, 48px);
background: var(--ha-icon-button-background);
border: var(--ha-icon-button-border);
border-radius: var(--ha-icon-button-border-radius);
}
ha-button {
position: relative;
@@ -82,13 +89,14 @@ export class HaIconButton extends LitElement {
--wa-color-on-normal: currentColor;
--wa-color-fill-quiet: transparent;
--ha-button-label-overflow: visible;
--ha-button-border-radius: var(--ha-icon-button-border-radius, 50%);
}
ha-button::after {
content: "";
position: absolute;
inset: 0;
z-index: -1;
border-radius: 50%;
border-radius: var(--ha-icon-button-border-radius, 50%);
background-color: currentColor;
opacity: 0;
pointer-events: none;
@@ -169,6 +169,7 @@ export class ZWaveJSNetworkVisualization extends SubscribeMixin(LitElement) {
<ha-icon-button
slot="button"
class=${this._showNeighbors ? "active" : "inactive"}
.ariaPressed=${this._showNeighbors ? "true" : "false"}
.path=${mdiSpiderWeb}
.label=${this.hass.localize(
"ui.panel.config.zwave_js.visualization.toggle_neighbors"
@@ -562,17 +563,6 @@ export class ZWaveJSNetworkVisualization extends SubscribeMixin(LitElement) {
ha-input-search {
flex: 1;
}
/* ha-chart-base can't style re-slotted buttons, so mirror its look */
ha-icon-button[slot="button"] {
background: var(--card-background-color);
border-radius: var(--ha-border-radius-sm);
--ha-icon-button-size: 32px;
color: var(--primary-color);
border: 1px solid var(--divider-color);
}
ha-icon-button[slot="button"].inactive {
color: var(--state-inactive-color);
}
`,
];
}
+35 -3
View File
@@ -19,6 +19,7 @@ import memoizeOne from "memoize-one";
import { ensureArray } from "../../common/array/ensure-array";
import { storage } from "../../common/decorators/storage";
import type {
HASSDomCurrentTargetEvent,
HASSDomEvent,
HASSDomTargetEvent,
} from "../../common/dom/fire_event";
@@ -122,6 +123,8 @@ class HaPanelHistory extends LitElement {
// The zoom window shared by all charts, in percent of their x-axis
@state() private _zoomRange: [number, number] = [0, 100];
@state() private _zoomBarHeld = false;
@state() private _filters: SourceFilters = {};
// Only one filter is expanded at a time, so that it can use the height
@@ -202,7 +205,8 @@ class HaPanelHistory extends LitElement {
!!this._mungedStateHistory &&
(this._mungedStateHistory.line.length > 0 ||
this._mungedStateHistory.timeline.length > 0);
const showZoomBar = !loading && hasTargets && hasResults;
const hasCharts = !loading && hasTargets && hasResults;
const showZoomBar = hasCharts && (this._isZoomed() || this._zoomBarHeld);
const sourcesLabel = sourceCount
? this.hass.localize("ui.panel.history.sources_count", {
count: entityIds.length,
@@ -335,8 +339,13 @@ class HaPanelHistory extends LitElement {
}
</div>
${
showZoomBar
? html`<ha-card class="zoom-bar">
hasCharts
? html`<ha-card
class=${classMap({
"zoom-bar": true,
"keyboard-only": !showZoomBar,
})}
>
<ha-icon-button
.disabled=${!this._isZoomed()}
.label=${this.hass.localize(
@@ -350,6 +359,11 @@ class HaPanelHistory extends LitElement {
.end=${this._zoomRange[1]}
@zoom-slider-changed=${this._zoomSliderChanged}
@zoom-slider-reset=${this._resetZoom}
@pointerdown=${this._holdZoomBar}
@focusin=${this._holdZoomBar}
@pointerup=${this._releaseZoomBar}
@pointercancel=${this._releaseZoomBar}
@focusout=${this._releaseZoomBar}
></ha-chart-zoom-slider>
</ha-card>`
: nothing
@@ -370,6 +384,7 @@ class HaPanelHistory extends LitElement {
ev: HASSDomEvent<HASSDomEvents["history-charts-zoom"]>
) {
this._zoomRange = [ev.detail.start, ev.detail.end];
this._zoomBarHeld = false;
}
private _zoomSliderChanged(
@@ -380,7 +395,18 @@ class HaPanelHistory extends LitElement {
this._stateHistoryCharts?.zoom(start, end);
}
private _holdZoomBar() {
this._zoomBarHeld = true;
}
private _releaseZoomBar(ev: Event & HASSDomCurrentTargetEvent<HTMLElement>) {
// A mouse press focuses the slider, so it is kept until it loses focus
this._zoomBarHeld =
ev.type !== "focusout" && ev.currentTarget.matches(":focus-within");
}
private _resetZoom() {
this._zoomBarHeld = false;
this._zoomRange = [0, 100];
this._stateHistoryCharts?.zoom(0, 100);
}
@@ -630,6 +656,7 @@ class HaPanelHistory extends LitElement {
this._isLoading = true;
// The charts are rebuilt once loaded, so they start unzoomed.
this._zoomRange = [0, 100];
this._zoomBarHeld = false;
if (this._subscribed) {
this._unsubscribeHistory();
@@ -1043,6 +1070,11 @@ class HaPanelHistory extends LitElement {
);
}
/* Kept in the tab order, as zooming from the keyboard starts here */
.zoom-bar.keyboard-only {
clip-path: inset(50%);
}
/* Floats like the energy dashboard's date bar */
.zoom-bar {
position: absolute;