From 0afb38c0649ac5cdf1001c6023e2b75b5d7a97ea Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 19 Aug 2025 17:31:42 +0200 Subject: [PATCH] UX: hide buttons for 'background' and 'filter' from the menu if those are disabled by the feature switches --- src/UI/BigComponents/MenuDrawer.svelte | 12 ++++++++---- src/UI/BigComponents/MenuDrawerIndex.svelte | 7 ++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/UI/BigComponents/MenuDrawer.svelte b/src/UI/BigComponents/MenuDrawer.svelte index 07b266081..3e6134ecb 100644 --- a/src/UI/BigComponents/MenuDrawer.svelte +++ b/src/UI/BigComponents/MenuDrawer.svelte @@ -51,6 +51,8 @@ } }) let hotkeys = Hotkeys._docs + let showBackground = state.featureSwitches.featureSwitchBackgroundSelection + let showFilters = state.featureSwitches.featureSwitchFilter
@@ -75,10 +77,12 @@ - - - - + {#if $showFilters} + + {/if} + {#if $showBackground} + + {/if} diff --git a/src/UI/BigComponents/MenuDrawerIndex.svelte b/src/UI/BigComponents/MenuDrawerIndex.svelte index d33cc131a..08f78e420 100644 --- a/src/UI/BigComponents/MenuDrawerIndex.svelte +++ b/src/UI/BigComponents/MenuDrawerIndex.svelte @@ -38,7 +38,7 @@ import SidebarUnit from "../Base/SidebarUnit.svelte" import Squares2x2 from "@babeard/svelte-heroicons/mini/Squares2x2" import EnvelopeOpen from "@babeard/svelte-heroicons/mini/EnvelopeOpen" - import { UIEventSource } from "../../Logic/UIEventSource" + import { ImmutableStore, UIEventSource } from "../../Logic/UIEventSource" import MagnifyingGlassCircle from "@babeard/svelte-heroicons/mini/MagnifyingGlassCircle" import { AndroidPolyfill } from "../../Logic/Web/AndroidPolyfill" import Forgejo from "../../assets/svg/Forgejo.svelte" @@ -74,7 +74,7 @@ let usersettingslayer = new LayerConfig(usersettings, "usersettings", true) let featureSwitches = state.featureSwitches - let showHome = featureSwitches?.featureSwitchBackToThemeOverview + let showHome = featureSwitches?.featureSwitchBackToThemeOverview ?? new ImmutableStore(true) let pg = state.guistate.pageStates export let onlyLink: boolean const t = Translations.t.general.menu @@ -218,11 +218,12 @@ + {#if $showHome} - + {/if}