From 23b7962388b9dff909a0116df3df0373357ad228 Mon Sep 17 00:00:00 2001 From: sharann-del Date: Thu, 9 Apr 2026 21:00:35 +0530 Subject: [PATCH 1/2] impr(theme): display custom theme names in indicator (@Sharann-del) --- frontend/src/ts/controllers/theme-controller.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/controllers/theme-controller.ts b/frontend/src/ts/controllers/theme-controller.ts index aca22ffa4a43..3cdefa3ce4b3 100644 --- a/frontend/src/ts/controllers/theme-controller.ts +++ b/frontend/src/ts/controllers/theme-controller.ts @@ -81,11 +81,25 @@ async function apply( } } +// Match current custom theme by comparing color arrays since Config does not store custom theme IDs function updateThemeIndicator(nameOverride?: string): void { //text let str: string = Config.theme; if (randomTheme !== null) str = randomTheme; - if (Config.customTheme) str = "custom"; + + if (Config.customTheme && nameOverride === undefined) { + const snapshot = DB.getSnapshot(); + const matchedTheme = snapshot?.customThemes?.find((ct) => + ct.colors.every((c, i) => c === Config.customThemeColors[i]), + ); + + if (matchedTheme) { + str = `${matchedTheme.name} (custom)`; + } else { + str = "custom"; + } + } + if (nameOverride !== undefined && nameOverride !== "") str = nameOverride; str = str.replace(/_/g, " "); From f452102dc0ff1f34a3c619b2b568cf191fd5c42a Mon Sep 17 00:00:00 2001 From: sharann-del Date: Thu, 9 Apr 2026 21:20:35 +0530 Subject: [PATCH 2/2] impr: add safety check for custom theme color matching --- frontend/src/ts/controllers/theme-controller.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/ts/controllers/theme-controller.ts b/frontend/src/ts/controllers/theme-controller.ts index 3cdefa3ce4b3..3ae3780c6c32 100644 --- a/frontend/src/ts/controllers/theme-controller.ts +++ b/frontend/src/ts/controllers/theme-controller.ts @@ -81,16 +81,18 @@ async function apply( } } -// Match current custom theme by comparing color arrays since Config does not store custom theme IDs function updateThemeIndicator(nameOverride?: string): void { //text let str: string = Config.theme; if (randomTheme !== null) str = randomTheme; if (Config.customTheme && nameOverride === undefined) { + // Match current custom theme by colors since Config does not store custom theme IDs const snapshot = DB.getSnapshot(); - const matchedTheme = snapshot?.customThemes?.find((ct) => - ct.colors.every((c, i) => c === Config.customThemeColors[i]), + const matchedTheme = snapshot?.customThemes?.find( + (ct) => + ct.colors.length === Config.customThemeColors.length && + ct.colors.every((c, i) => c === Config.customThemeColors[i]), ); if (matchedTheme) {