From fdeca9521522b5009874e8de241cc8129166beab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 11:55:15 +0000 Subject: [PATCH] Migrate ha-button-menu to ha-dropdown in devices dashboard Co-authored-by: wendevlin <12148533+wendevlin@users.noreply.github.com> --- .../devices/ha-config-devices-dashboard.ts | 118 ++++++++---------- 1 file changed, 54 insertions(+), 64 deletions(-) diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index cf913876ac..249e8f3e3b 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -47,12 +47,14 @@ import "../../../components/ha-check-list-item"; import "../../../components/ha-fab"; import "../../../components/ha-filter-devices"; import "../../../components/ha-filter-floor-areas"; +import "@home-assistant/webawesome/dist/components/divider/divider"; +import "../../../components/ha-dropdown"; +import "../../../components/ha-dropdown-item"; import "../../../components/ha-filter-integrations"; import "../../../components/ha-filter-labels"; import "../../../components/ha-filter-states"; import "../../../components/ha-icon-button"; -import "../../../components/ha-md-divider"; -import "../../../components/ha-md-menu-item"; +import "../../../components/ha-md-menu"; import "../../../components/ha-sub-menu"; import { createAreaRegistryEntry } from "../../../data/area_registry"; import type { ConfigEntry, SubEntry } from "../../../data/config_entries"; @@ -720,34 +722,30 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { const areaItems = html`${Object.values(this.hass.areas).map( (area) => - html` ${area.icon - ? html`` + ? html`` : html``} -
${area.name}
-
` + ${area.name} + ` )} - -
- ${this.hass.localize( - "ui.panel.config.devices.picker.bulk_actions.no_area" - )} -
-
- - -
- ${this.hass.localize( - "ui.panel.config.devices.picker.bulk_actions.add_area" - )} -
-
`; + + ${this.hass.localize( + "ui.panel.config.devices.picker.bulk_actions.no_area" + )} + + + + ${this.hass.localize( + "ui.panel.config.devices.picker.bulk_actions.add_area" + )} + `; const labelItems = html`${this._labels?.map((label) => { const color = label.color ? computeCssColor(label.color) : undefined; @@ -759,14 +757,14 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { this._selected.some((deviceId) => this.hass.devices[deviceId]?.labels.includes(label.label_id) ); - return html` - `; + `; })} - - -
- ${this.hass.localize("ui.panel.config.labels.add_label")} -
`; + + + ${this.hass.localize("ui.panel.config.labels.add_label")} + `; return html` ${!this.narrow - ? html` + ? html` ${labelItems} - + ${areasInOverflow ? nothing - : html` + : html` ${areaItems} - `}` + `}` : nothing} - + ${this.narrow ? html``} ${this.narrow ? html` - -
- ${this.hass.localize( - "ui.panel.config.automation.picker.bulk_actions.add_label" - )} -
+ + ${this.hass.localize( + "ui.panel.config.automation.picker.bulk_actions.add_label" + )} -
+ ${labelItems}
` : nothing} ${areasInOverflow ? html` - -
- ${this.hass.localize( - "ui.panel.config.devices.picker.bulk_actions.move_area" - )} -
+ + ${this.hass.localize( + "ui.panel.config.devices.picker.bulk_actions.move_area" + )} -
+ ${areaItems}
- ` + ` : nothing} - - -
- ${this.hass.localize( - "ui.panel.config.devices.picker.bulk_actions.delete_selected.button" - )} -
-
-
+ + ${this.hass.localize( + "ui.panel.config.devices.picker.bulk_actions.delete_selected.button" + )} + +
`; } @@ -1277,7 +1267,7 @@ ${rejected ha-assist-chip { --ha-assist-chip-container-shape: 10px; } - ha-md-button-menu ha-assist-chip { + ha-dropdown ha-assist-chip { --md-assist-chip-trailing-space: 8px; } ha-label {