diff --git a/src/dashboards/hacs-dashboard.ts b/src/dashboards/hacs-dashboard.ts
index a42c4bb4..55f8c507 100644
--- a/src/dashboards/hacs-dashboard.ts
+++ b/src/dashboards/hacs-dashboard.ts
@@ -25,20 +25,18 @@ import type {
} from "../../homeassistant-frontend/src/components/data-table/ha-data-table";
import "../../homeassistant-frontend/src/layouts/hass-tabs-subpage-data-table";
-import "../../homeassistant-frontend/src/components/ha-button-menu";
import "../../homeassistant-frontend/src/components/ha-fab";
-import "../../homeassistant-frontend/src/components/ha-form/ha-form";
+import "../../homeassistant-frontend/src/components/ha-filter-states";
import "../../homeassistant-frontend/src/components/ha-markdown";
import "../../homeassistant-frontend/src/components/ha-menu";
import "../../homeassistant-frontend/src/components/ha-md-menu-item";
import { LocalizeFunc } from "../../homeassistant-frontend/src/common/translations/localize";
-import { HaFormSchema } from "../../homeassistant-frontend/src/components/ha-form/types";
import { HaMenu } from "../../homeassistant-frontend/src/components/ha-menu";
import "../../homeassistant-frontend/src/components/ha-svg-icon";
import { PageNavigation } from "../../homeassistant-frontend/src/layouts/hass-tabs-subpage";
import { haStyle } from "../../homeassistant-frontend/src/resources/styles";
-import type { HomeAssistant, Route } from "../../homeassistant-frontend/src/types";
+import type { HomeAssistant, Route, ValueChangedEvent } from "../../homeassistant-frontend/src/types";
import { brandsUrl } from "../../homeassistant-frontend/src/util/brands-url";
import {
showHacsCustomRepositoriesDialog,
@@ -62,7 +60,13 @@ const defaultKeyData = {
hidden: true,
};
-const STATUS_ORDER = ["pending-restart", "pending-upgrade", "installed", "new", "default"];
+type RepositoryStatus = RepositoryBase["status"];
+type RepositoryStatusKey = `repository_status.${RepositoryStatus}`;
+
+const STATUS_ORDER = ["pending-restart", "pending-upgrade", "installed", "new", "default"] as const satisfies readonly RepositoryStatus[];
+
+const repositoryStatusKey = (status: RepositoryStatus): RepositoryStatusKey =>
+ `repository_status.${status}`;
const TABS: PageNavigation[] = [
{
@@ -105,6 +109,8 @@ export class HacsDashboard extends LitElement {
@storage({ key: "hacs-dashboard-table-columns-ordering", state: true, subscribe: false })
private _orderTableColumns?: string[];
+ @state() private _expandedFilter?: string;
+
@query("#overflow-menu")
private _overflowMenu!: HaMenu;
@@ -159,18 +165,34 @@ export class HacsDashboard extends LitElement {
@click=${this._showOverflowMenu}
>
- filter.startsWith("status_")) || "",
- type: this._activeFilters?.find((filter) => filter.startsWith("type_")) || "",
- }}
- .schema=${this._filterSchema(this.hacs.localize, this.hacs.info.categories)}
- .computeLabel=${this._computeFilterFormLabel}
- @value-changed=${this._handleFilterChanged}
- >
+ id="status-filter"
+ .label=${this.hacs.localize("dialog_overview.status")}
+ .value=${this._activeFilters?.filter((filter) => filter.startsWith("status_"))}
+ .states=${STATUS_ORDER.map((filter) => ({
+ value: `status_${filter}`,
+ label: this.hacs.localize(repositoryStatusKey(filter)) || filter,
+ }))}
+ @data-table-filter-changed=${this._handlePaneFilterChanged}
+ .expanded=${this._expandedFilter === "status-filter"}
+ @expanded-changed=${this._handleFilterExpanded}
+ >
+ filter.startsWith("type_"))}
+ .states=${this.hacs.info.categories.map((type: string) => ({
+ value: `type_${type}`,
+ label: this.hacs.localize(`common.type.${type as RepositoryType}`),
+ }))}
+ @data-table-filter-changed=${this._handlePaneFilterChanged}
+ .expanded=${this._expandedFilter === "type-filter"}
+ @expanded-changed=${this._handleFilterExpanded}
+ >