TypeScript
fix(web): explain when a theme hides environment artwork (#27936)
shivam4e6b7d8447d3
diff --git a/apps/web/src/components/settings/AppearanceSettingsPanel.tsx b/apps/web/src/components/settings/AppearanceSettingsPanel.tsxindex 1c5812a2bda..00783b085d6 100644--- a/apps/web/src/components/settings/AppearanceSettingsPanel.tsx+++ b/apps/web/src/components/settings/AppearanceSettingsPanel.tsx@@ -19,6 +19,7 @@ import {useEnvironmentStageLabel,} from "../SidebarStageBackdrop";import { useCustomThemes } from "../../hooks/useCustomThemes";+import { useEnvironmentIdentificationMode } from "../../hooks/useSettings";import { useTheme } from "../../hooks/useTheme";import { useScopedSettings, useUpdateScopedSettings } from "./useScopedSettings";import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select";@@ -106,6 +107,20 @@ export function AppearanceSettingsPanel() {environmentIdentificationOptionList.find(([value]) => value === settings.environmentIdentificationMode,)?.[1] ?? ENVIRONMENT_IDENTIFICATION_LABELS[settings.environmentIdentificationMode];+ const effectiveEnvironmentIdentificationMode = useEnvironmentIdentificationMode();+ const themeHidesEnvironmentArtwork =+ effectiveEnvironmentIdentificationMode === "pill" &&+ resolveSidebarStageBackdropVariant(+ environmentStageLabel,+ settings.environmentIdentificationMode,+ ) !== null;+ const environmentIdentificationDescription = themeHidesEnvironmentArtwork+ ? environmentStageVariant+ ? "Only built-in themes show artwork, so this theme shows the version pill."+ : "Only built-in themes show artwork."+ : environmentStageVariant+ ? "Choose how Dev and Nightly environments are identified."+ : "Show Dev or Nightly artwork in the sidebar header.";const glassOpacityRatio =(settings.glassOpacity - MIN_GLASS_OPACITY) / (MAX_GLASS_OPACITY - MIN_GLASS_OPACITY);const glassOpacitySliderStyle = {@@ -395,11 +410,7 @@ export function AppearanceSettingsPanel() {/><SettingsRow{...searchableSetting("environment-identification")}- description={- environmentStageVariant- ? "Choose how Dev and Nightly environments are identified."- : "Show Dev or Nightly artwork in the sidebar header."- }+ description={environmentIdentificationDescription}resetAction={settings.environmentIdentificationMode !== DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE ? (<SettingResetButton