1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 10:48:44 +00:00

Revert "Add basic view transitions between tab UIs (#28374)" (#28451)

This commit is contained in:
Aidan Timson
2025-12-09 11:18:51 +00:00
committed by GitHub
parent 4030ce3f88
commit 2ce1eaf8c6
3 changed files with 6 additions and 17 deletions

View File

@@ -13,7 +13,6 @@ import "../components/ha-svg-icon";
import "../components/ha-tab"; import "../components/ha-tab";
import { haStyleScrollbar } from "../resources/styles"; import { haStyleScrollbar } from "../resources/styles";
import type { HomeAssistant, Route } from "../types"; import type { HomeAssistant, Route } from "../types";
import { withViewTransition } from "../common/util/view-transition";
export interface PageNavigation { export interface PageNavigation {
path: string; path: string;
@@ -113,11 +112,9 @@ class HassTabsSubpage extends LitElement {
public willUpdate(changedProperties: PropertyValues) { public willUpdate(changedProperties: PropertyValues) {
if (changedProperties.has("route")) { if (changedProperties.has("route")) {
withViewTransition(() => {
this._activeTab = this.tabs.find((tab) => this._activeTab = this.tabs.find((tab) =>
`${this.route.prefix}${this.route.path}`.includes(tab.path) `${this.route.prefix}${this.route.path}`.includes(tab.path)
); );
});
} }
super.willUpdate(changedProperties); super.willUpdate(changedProperties);
} }

View File

@@ -4,7 +4,6 @@ import type { CSSResultGroup, TemplateResult } from "lit";
import { css, html, LitElement } from "lit"; import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators"; import { customElement, property } from "lit/decorators";
import { navigate } from "../../common/navigate"; import { navigate } from "../../common/navigate";
import { withViewTransition } from "../../common/util/view-transition";
import "../../components/ha-button-menu"; import "../../components/ha-button-menu";
import "../../components/ha-icon-button"; import "../../components/ha-icon-button";
import "../../components/ha-list-item"; import "../../components/ha-list-item";
@@ -117,9 +116,7 @@ class PanelDeveloperTools extends LitElement {
return; return;
} }
if (newPage !== this._page) { if (newPage !== this._page) {
withViewTransition(() => {
navigate(`/developer-tools/${newPage}`); navigate(`/developer-tools/${newPage}`);
});
} else { } else {
scrollTo({ behavior: "smooth", top: 0 }); scrollTo({ behavior: "smooth", top: 0 });
} }
@@ -128,9 +125,7 @@ class PanelDeveloperTools extends LitElement {
private async _handleMenuAction(ev: CustomEvent<ActionDetail>) { private async _handleMenuAction(ev: CustomEvent<ActionDetail>) {
switch (ev.detail.index) { switch (ev.detail.index) {
case 0: case 0:
withViewTransition(() => {
navigate(`/developer-tools/debug`); navigate(`/developer-tools/debug`);
});
break; break;
} }
} }

View File

@@ -99,7 +99,6 @@ import type { HUIView } from "./views/hui-view";
import "./views/hui-view-background"; import "./views/hui-view-background";
import "./views/hui-view-container"; import "./views/hui-view-container";
import { UndoRedoController } from "../../common/controllers/undo-redo-controller"; import { UndoRedoController } from "../../common/controllers/undo-redo-controller";
import { withViewTransition } from "../../common/util/view-transition";
interface ActionItem { interface ActionItem {
icon: string; icon: string;
@@ -1246,9 +1245,7 @@ class HUIRoot extends LitElement {
const viewIndex = Number(ev.detail.name); const viewIndex = Number(ev.detail.name);
if (viewIndex !== this._curView) { if (viewIndex !== this._curView) {
const path = this.config.views[viewIndex].path || viewIndex; const path = this.config.views[viewIndex].path || viewIndex;
withViewTransition(() => {
this._navigateToView(path); this._navigateToView(path);
});
} else if (!this._editMode) { } else if (!this._editMode) {
scrollTo({ behavior: "smooth", top: 0 }); scrollTo({ behavior: "smooth", top: 0 });
} }