From f9e1023a2ee6fe5f0fc0904c0bc4ea03e628a586 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 23 Mar 2026 14:58:19 +0100 Subject: [PATCH] Rename windows-98 feature to retro to avoid trademark issues Renames all component files, class names, element tags, translation keys, theme names, and storage keys from windows-98/Windows 98 to retro/Retro. Co-Authored-By: Claude Opus 4.6 (1M context) --- ...-windows-98-theme.ts => ha-retro-theme.ts} | 2 +- .../{ha-windows-98.ts => ha-retro.ts} | 46 +++++++++---------- src/layouts/home-assistant-main.ts | 4 +- src/panels/config/labs/ha-config-labs.ts | 2 +- src/translations/en.json | 2 +- 5 files changed, 27 insertions(+), 29 deletions(-) rename src/components/{ha-windows-98-theme.ts => ha-retro-theme.ts} (99%) rename src/components/{ha-windows-98.ts => ha-retro.ts} (93%) diff --git a/src/components/ha-windows-98-theme.ts b/src/components/ha-retro-theme.ts similarity index 99% rename from src/components/ha-windows-98-theme.ts rename to src/components/ha-retro-theme.ts index ce5474a4a4..41dce4c0c9 100644 --- a/src/components/ha-windows-98-theme.ts +++ b/src/components/ha-retro-theme.ts @@ -1,6 +1,6 @@ import type { Theme } from "../data/ws-themes"; -export const WINDOWS_98_THEME: Theme = { +export const RETRO_THEME: Theme = { // Sharp corners "ha-border-radius-sm": "0", "ha-border-radius-md": "0", diff --git a/src/components/ha-windows-98.ts b/src/components/ha-retro.ts similarity index 93% rename from src/components/ha-windows-98.ts rename to src/components/ha-retro.ts index 00551585e0..ed8f0b4fd4 100644 --- a/src/components/ha-windows-98.ts +++ b/src/components/ha-retro.ts @@ -8,7 +8,7 @@ import type { LocalizeKeys } from "../common/translations/localize"; import { subscribeLabFeature } from "../data/labs"; import { SubscribeMixin } from "../mixins/subscribe-mixin"; import type { HomeAssistant } from "../types"; -import { WINDOWS_98_THEME } from "./ha-windows-98-theme"; +import { RETRO_THEME } from "./ha-retro-theme"; const TIP_COUNT = 25; @@ -20,7 +20,7 @@ type CasitaExpression = | "great-job" | "error"; -const STORAGE_KEY = "windows-98-position"; +const STORAGE_KEY = "retro-position"; const DRAG_THRESHOLD = 5; const BUBBLE_TIMEOUT = 8000; const SLEEP_TIMEOUT = 30000; @@ -28,8 +28,8 @@ const BSOD_CLICK_COUNT = 5; const BSOD_CLICK_TIMEOUT = 3000; const BSOD_DISMISS_DELAY = 500; -@customElement("ha-windows-98") -export class HaWindows98 extends SubscribeMixin(LitElement) { +@customElement("ha-retro") +export class HaRetro extends SubscribeMixin(LitElement) { @property({ attribute: false }) public hass?: HomeAssistant; @property({ type: Boolean }) public narrow = false; @@ -41,7 +41,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { subscribeLabFeature( this.hass!.connection, "frontend", - "windows_98", + "retro", (feature) => { this._enabled = feature.enabled; } @@ -95,7 +95,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { super.connectedCallback(); this._loadPosition(); this._resetSleepTimer(); - this._applyWin98Theme(); + this._applyRetroTheme(); this._startThemeObserver(); } @@ -112,8 +112,8 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { protected willUpdate(changedProps: Map): void { if (changedProps.has("_enabled")) { if (this._enabled) { - this.hass!.loadFragmentTranslation("windows_98"); - this._applyWin98Theme(); + this.hass!.loadFragmentTranslation("retro"); + this._applyRetroTheme(); this._startThemeObserver(); } else { this._stopThemeObserver(); @@ -125,7 +125,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { // Re-apply if darkMode changed if (oldHass && oldHass.themes.darkMode !== this.hass!.themes.darkMode) { this._themeApplied = false; - this._applyWin98Theme(); + this._applyRetroTheme(); } } } @@ -138,9 +138,9 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { const el = document.documentElement as HTMLElement & { __themes?: { cacheKey?: string }; }; - if (!el.__themes?.cacheKey?.startsWith("Windows 98")) { + if (!el.__themes?.cacheKey?.startsWith("Retro")) { this._themeApplied = false; - this._applyWin98Theme(); + this._applyRetroTheme(); } }); this._themeObserver.observe(document.documentElement, { @@ -154,7 +154,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { this._themeObserver = undefined; } - private _applyWin98Theme(): void { + private _applyRetroTheme(): void { if (!this.hass || this._themeApplied) return; this._isApplyingTheme = true; @@ -163,7 +163,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { ...this.hass.themes, themes: { ...this.hass.themes.themes, - "Windows 98": WINDOWS_98_THEME, + Retro: RETRO_THEME, }, }; @@ -171,7 +171,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { applyThemesOnElement( document.documentElement, themes, - "Windows 98", + "Retro", { dark: this.hass.themes.darkMode }, true ); @@ -346,7 +346,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { private _showTip(): void { const tipIndex = Math.floor(Math.random() * TIP_COUNT) + 1; this._bubbleText = this.hass!.localize( - `ui.panel.windows_98.tip_${tipIndex}` as LocalizeKeys + `ui.panel.retro.tip_${tipIndex}` as LocalizeKeys ); this._showBubble = true; this._expression = "ok-nabu"; @@ -418,17 +418,15 @@ export class HaWindows98 extends SubscribeMixin(LitElement) {

- ${this.hass!.localize("ui.panel.windows_98.bsod_title")} + ${this.hass!.localize("ui.panel.retro.bsod_title")}

+

${this.hass!.localize("ui.panel.retro.bsod_error")}

- ${this.hass!.localize("ui.panel.windows_98.bsod_error")} -

-

- * ${this.hass!.localize("ui.panel.windows_98.bsod_line_1")}
- * ${this.hass!.localize("ui.panel.windows_98.bsod_line_2")} + * ${this.hass!.localize("ui.panel.retro.bsod_line_1")}
+ * ${this.hass!.localize("ui.panel.retro.bsod_line_2")}

- ${this.hass!.localize("ui.panel.windows_98.bsod_continue")} + ${this.hass!.localize("ui.panel.retro.bsod_continue")} _

@@ -457,7 +455,7 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { @pointerdown=${this._stopPropagation} @click=${this._dismiss} > - ${this.hass!.localize("ui.panel.windows_98.dismiss")} + ${this.hass!.localize("ui.panel.retro.dismiss")}
@@ -680,6 +678,6 @@ export class HaWindows98 extends SubscribeMixin(LitElement) { declare global { interface HTMLElementTagNameMap { - "ha-windows-98": HaWindows98; + "ha-retro": HaRetro; } } diff --git a/src/layouts/home-assistant-main.ts b/src/layouts/home-assistant-main.ts index 41022abae3..b8657fd9f3 100644 --- a/src/layouts/home-assistant-main.ts +++ b/src/layouts/home-assistant-main.ts @@ -52,7 +52,7 @@ export class HomeAssistantMain extends LitElement { return html` - + { // Place frontend fun features at the bottom - const funFeatures = ["winter_mode", "windows_98"]; + const funFeatures = ["winter_mode", "retro"]; const aIsFun = a.domain === "frontend" && funFeatures.includes(a.preview_feature); const bIsFun = diff --git a/src/translations/en.json b/src/translations/en.json index 7a23c40e9b..451afc4b9b 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -10706,7 +10706,7 @@ "add_card_error": "Unable to add card", "error_no_data": "You need to select some data sources first." }, - "windows_98": { + "retro": { "tip_1": "Try turning your house off and on again.", "tip_2": "If your automation doesn't work, just add more YAML.", "tip_3": "Talk to your devices. They won't answer, but it helps.",