From c04227a7631553100f71d69fa6253bb0bb88e0d6 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 26 Nov 2026 13:53:25 -0500 Subject: [PATCH] UI: light/dark switch in the header (operator request) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The design system already renders light when the browser prefers it; this adds the same ☀ button Gandalf has (lt.theme.toggle). The choice is remembered per browser (localStorage) and synced across tabs; until it is used, the browser's preference still decides. Co-Authored-By: Claude Opus 5.5 --- tests/test_web_ui_api.py | 1 + thor/web/templates/base.html | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_web_ui_api.py b/tests/test_web_ui_api.py index 4f85c28..b46ca6e 100644 --- a/tests/test_web_ui_api.py +++ b/tests/test_web_ui_api.py @@ -145,6 +145,7 @@ def test_needs_attention_page(store): assert 'Loki: blind' in html and 'HTTP 500' in html assert 'On the timeline only' in html and 'monitor-01 slow' in html # unexplained symptom assert 'Last 7 days' in html and 'storage-01 oom' in html + assert 'id="lt-theme-btn"' in html and 'lt.theme.toggle()' in html # light/dark switch def test_incident_and_known_pages(store): diff --git a/thor/web/templates/base.html b/thor/web/templates/base.html index b23eea8..4b02998 100644 --- a/thor/web/templates/base.html +++ b/thor/web/templates/base.html @@ -48,6 +48,8 @@
+ {% if user.name %}{{ user.name }}{% endif %} {% if 'admin' in user.groups %}admin{% endif %}
@@ -64,7 +66,12 @@ {% block scripts %}{% endblock %}