From 96ea892748c6938171b2cbae99159a0e289c05a9 Mon Sep 17 00:00:00 2001
From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Date: Mon, 15 Jun 2026 13:25:31 +0200
Subject: [PATCH] fix(sidebar): remove theme switcher from sidebar navbar
---
resources/views/components/navbar.blade.php | 49 -------------------
.../SidebarNavigationPreferencesTest.php | 12 ++---
2 files changed, 5 insertions(+), 56 deletions(-)
diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php
index c2ca28a2d..924147e4b 100644
--- a/resources/views/components/navbar.blade.php
+++ b/resources/views/components/navbar.blade.php
@@ -44,16 +44,6 @@
this.queryTheme();
this.checkZoom();
},
- setTheme(type) {
- this.theme = type;
- localStorage.setItem('theme', type);
- this.queryTheme();
- },
- cycleTheme() {
- const themes = ['light', 'system', 'dark'];
- const currentIndex = themes.indexOf(this.theme || localStorage.getItem('theme') || 'dark');
- this.setTheme(themes[(currentIndex + 1) % themes.length]);
- },
queryTheme() {
const darkModePreference = window.matchMedia('(prefers-color-scheme: dark)').matches;
const userSettings = localStorage.getItem('theme') || 'dark';
@@ -375,45 +365,6 @@
-
-
-
-
@if (isInstanceAdmin() && !isCloud())
@persist('upgrade')
diff --git a/tests/Feature/SidebarNavigationPreferencesTest.php b/tests/Feature/SidebarNavigationPreferencesTest.php
index f27eccd99..c341d9529 100644
--- a/tests/Feature/SidebarNavigationPreferencesTest.php
+++ b/tests/Feature/SidebarNavigationPreferencesTest.php
@@ -2,18 +2,16 @@
use App\Livewire\SettingsDropdown;
-it('keeps changelog and the theme switcher in the sidebar without the old preferences trigger', function () {
+it('keeps changelog in the sidebar without a dedicated theme switcher', function () {
$navbarView = file_get_contents(resource_path('views/components/navbar.blade.php'));
expect($navbarView)
->toContain('')
->not->toContain('')
- ->toContain('aria-label="Theme switcher"')
- ->toContain('aria-label="Use light theme"')
- ->toContain('aria-label="Use system theme"')
- ->toContain('aria-label="Use dark theme"')
- ->toContain('cycleTheme()')
- ->toContain("const themes = ['light', 'system', 'dark'];")
+ ->not->toContain('')
+ ->not->toContain('Click to change theme.')
+ ->not->toContain('cycleTheme()')
+ ->toContain('this.queryTheme();')
->toContain('pl-2 pr-3 items-start gap-3')
->toContain('class="flex min-w-0 flex-1 flex-col"')
->toContain('class="min-w-0 flex-1"')