Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
226675e
ci: add UI build workflow for PR validation
BSS-Baumgart Mar 30, 2026
ee3d8fa
ci: always run UI build on PR to develop and master
BSS-Baumgart Mar 30, 2026
7011389
docs: improve README for HA users and add addon intro (#1)
BSS-Baumgart Mar 30, 2026
4dcba96
docs: add 1.3.4 changelog and UI screenshots (#4)
BSS-Baumgart Mar 30, 2026
297a730
chore: remove obsolete repo artifacts (#7)
BSS-Baumgart Mar 30, 2026
439e034
chore: sync master into develop (#9)
BSS-Baumgart Mar 30, 2026
5df9cd6
fix(settings): persist main valve + recover watering state after rest…
BSS-Baumgart Mar 31, 2026
97017fb
fix(runtime): recover active watering only when HA is ready (#19)
BSS-Baumgart Mar 31, 2026
3827835
feat: v1.4.0 — multi-zone schedules, sensor skip fix, local time hist…
BSS-Baumgart Apr 17, 2026
745a498
chore(frontend): remove deprecated baseUrl from tsconfig (#25)
BSS-Baumgart Apr 17, 2026
6826a8a
fix(db): add migration for extra_zone_ids column on existing database…
BSS-Baumgart Apr 17, 2026
b29f8bd
chore(release): bump version to 1.4.1 (#27)
BSS-Baumgart Apr 17, 2026
f9dbc08
docs: add Polish README and update capabilities for v1.4.0 (#29)
BSS-Baumgart Apr 18, 2026
e09487a
fix: HA WebSocket reconnect after HA restart (v1.4.2) (#33)
BSS-Baumgart Apr 19, 2026
54c4eac
feat: pump control, color theme, force start, flow sensor fix (v1.4.3…
BSS-Baumgart May 5, 2026
4ea4a4d
fix: theme colors apply correctly, presets, remove dark/light toggle …
BSS-Baumgart May 5, 2026
ff36efa
chore: merge master into release/v1.4.4, keep release branch for all …
BSS-Baumgart May 5, 2026
d5d3ea1
fix: remove duplicate declarations in irrigationStore (auto-merge art…
BSS-Baumgart May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _pr_body_theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Changes

- Fixed: Color theme now correctly applies to the entire UI (main background, header, sidebar, cards, buttons, badges) — previously only partially worked due to missing `bg-gray-950` CSS override and incorrect cascade specificity.
- Fixed: `applyThemeColors` now always sets all 6 CSS variables unconditionally (previously skipped falsy values).
- New: 4 built-in color presets — Default (Green), Ocean (Blue), Sunset (Orange), Violet — apply with one click and save automatically.
- Removed: Dark/Light mode toggle — the app is always dark-themed (colors fully controlled via Settings).
6 changes: 6 additions & 0 deletions addon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.4.4

- Fixed: Color theme settings now correctly update the UI in real-time — all background, surface, border, button, badge, and accent elements respond to custom colour changes.
- Changed: Removed the dark/light mode toggle from the sidebar — the app always uses dark mode; colours are customised via Settings.
- New: 4 preset colour palettes in Settings: Default (Green), Ocean (Blue), Sunset (Orange), Violet — one click applies and saves all 6 colours instantly.

## 1.4.3

- Fixed: Flow meter sensor now correctly reports "Unexpected flow" (instead of "Wet soil") in irrigation history.
Expand Down
2 changes: 1 addition & 1 deletion addon/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "Irrigation BSS"
version: "1.4.3"
version: "1.4.4"
slug: "irrigation_bss"
description: "Advanced irrigation management — zones, valves, sensors, scheduler"
url: "https://github.com/BSS-Baumgart/bss_ha_irrigation"
Expand Down
7 changes: 6 additions & 1 deletion addon/frontend/public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@
"colorSurface": "Oberfläche (Karten)",
"colorBorder": "Rahmen",
"colorTextSecondary": "Sekundärer Text",
"resetColors": "Auf Standard zurücksetzen"
"resetColors": "Auf Standard zurücksetzen",
"colorPresets": "Farbpaletten",
"presetDefault": "Standard (Grün)",
"presetOcean": "Ozean (Blau)",
"presetSunset": "Sonnenuntergang (Orange)",
"presetViolet": "Violett"
}
}
7 changes: 6 additions & 1 deletion addon/frontend/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@
"colorSurface": "Surface (cards)",
"colorBorder": "Border",
"colorTextSecondary": "Secondary text",
"resetColors": "Reset to defaults"
"resetColors": "Reset to defaults",
"colorPresets": "Presets",
"presetDefault": "Default (Green)",
"presetOcean": "Ocean (Blue)",
"presetSunset": "Sunset (Orange)",
"presetViolet": "Violet"
}
}
7 changes: 6 additions & 1 deletion addon/frontend/public/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@
"colorSurface": "Powierzchnia (karty)",
"colorBorder": "Obramowanie",
"colorTextSecondary": "Tekst drugorzędny",
"resetColors": "Przywróć domyślne"
"resetColors": "Przywróć domyślne",
"colorPresets": "Gotowe palety",
"presetDefault": "Domyślna (Zielona)",
"presetOcean": "Ocean (Niebieska)",
"presetSunset": "Zachód słońca (Pomarańczowa)",
"presetViolet": "Fioletowa"
}
}
6 changes: 3 additions & 3 deletions addon/frontend/src/components/Layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const COLOR_KEYS: (keyof ThemeColors)[] = ['primary', 'primaryDark', 'bg', 'surf
const SETTING_KEYS = ['theme_color_primary', 'theme_color_primary_dark', 'theme_color_bg', 'theme_color_surface', 'theme_color_border', 'theme_color_text_secondary']

export default function AppLayout({ children }: { children: ReactNode }) {
const theme = useIrrigationStore(s => s.theme)
const sidebarOpen = useIrrigationStore(s => s.sidebarOpen)
const closeSidebar = useIrrigationStore(s => s.closeSidebar)
const setThemeColors = useIrrigationStore(s => s.setThemeColors)
const { i18n } = useTranslation()

// Always dark mode — no light/dark toggle
useEffect(() => {
document.documentElement.classList.toggle('dark', theme === 'dark')
}, [theme])
document.documentElement.classList.add('dark')
}, [])

useEffect(() => {
fetch(`${INGRESS_BASE}/api/config`)
Expand Down
14 changes: 2 additions & 12 deletions addon/frontend/src/components/Layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NavLink } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import {
LayoutDashboard, Layers, Zap, Radio, CalendarDays,
Cloud, History, Sun, Moon, X, Settings,
Cloud, History, X, Settings,
} from 'lucide-react'
import clsx from 'clsx'
import { useIrrigationStore } from '../../store/irrigationStore'
Expand All @@ -20,7 +20,7 @@ const navItems = [

export default function Sidebar() {
const { t } = useTranslation()
const { theme, toggleTheme, closeSidebar } = useIrrigationStore()
const { closeSidebar } = useIrrigationStore()

return (
<aside className="w-56 h-full flex flex-col bg-white dark:bg-gray-900 border-r border-gray-200 dark:border-gray-800">
Expand Down Expand Up @@ -58,16 +58,6 @@ export default function Sidebar() {
</NavLink>
))}
</nav>

<div className="px-4 py-3 border-t border-gray-200 dark:border-gray-800">
<button
onClick={toggleTheme}
className="w-full flex items-center justify-center gap-2 text-xs py-1.5 rounded font-medium text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
>
{theme === 'dark' ? <Sun size={13} /> : <Moon size={13} />}
{theme === 'dark' ? 'Light mode' : 'Dark mode'}
</button>
</div>
</aside>
)
}
65 changes: 40 additions & 25 deletions addon/frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,52 @@
}
}

/* Theme color overrides — applied when CSS vars are set via Settings */
.dark .btn-primary {
background-color: var(--theme-primary-dark);
/* ------------------------------------------------------------------
Theme colour overrides — always dark UI, CSS vars set by JS.
Rules outside @layer outrank Tailwind's @layer utilities in the
CSS cascade, so !important is a belt-and-suspenders safeguard.
------------------------------------------------------------------ */

/* Main backgrounds */
.dark [class*="bg-gray-950"] {
background-color: var(--theme-bg) !important;
}
.dark .btn-primary:hover {
background-color: var(--theme-primary);
.dark [class*="bg-gray-900"],
.dark .card {
background-color: var(--theme-surface) !important;
}
.dark body {
background-color: var(--theme-bg);
.dark [class*="bg-gray-800"] {
background-color: var(--theme-surface) !important;
}
/* Borders */
.dark .card,
.dark [class*="bg-gray-900"] {
background-color: var(--theme-surface);
border-color: var(--theme-border);
}
.dark [class*="border-gray-800"],
.dark [class*="border-gray-700"] {
border-color: var(--theme-border);
border-color: var(--theme-border) !important;
}
/* Buttons */
.dark .btn-primary {
background-color: var(--theme-primary-dark) !important;
}
.dark .btn-primary:hover {
background-color: var(--theme-primary) !important;
}
/* Accent colours */
.dark [class*="text-primary-4"],
.dark [class*="text-primary-3"],
.dark [class*="text-primary-5"] {
color: var(--theme-primary) !important;
}
.dark [class*="bg-primary-9"] {
background-color: var(--theme-primary-a15) !important;
}
.dark .badge-green {
background-color: var(--theme-primary-a20) !important;
color: var(--theme-primary) !important;
}
/* Active nav item bg */
.dark a[class*="bg-primary-9"] {
background-color: var(--theme-primary-a15) !important;
}

@layer components {
Expand Down Expand Up @@ -84,16 +112,3 @@
@apply bg-yellow-100 dark:bg-yellow-900 text-yellow-700 dark:text-yellow-400 text-xs font-medium px-2 py-0.5 rounded-full;
}
}

/* Light mode overrides for page-level dark gray utilities */
html:not(.dark) .bg-gray-950 { background-color: #f3f4f6; }
html:not(.dark) .bg-gray-900 { background-color: #ffffff; }
html:not(.dark) .bg-gray-800 { background-color: #f3f4f6; }
html:not(.dark) .bg-gray-700 { background-color: #e5e7eb; }
html:not(.dark) .bg-gray-600 { background-color: #d1d5db; }
html:not(.dark) .border-gray-800 { border-color: #e5e7eb; }
html:not(.dark) .border-gray-700 { border-color: #d1d5db; }
html:not(.dark) .text-gray-300 { color: #374151; }
html:not(.dark) .text-gray-400 { color: #4b5563; }
html:not(.dark) .text-gray-500 { color: #6b7280; }
html:not(.dark) .text-gray-600 { color: #374151; }
88 changes: 73 additions & 15 deletions addon/frontend/src/pages/SettingsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react'
import { useState, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Settings, Palette, Globe, RotateCcw } from 'lucide-react'
import { settingsApi } from '../api/settings'
Expand All @@ -19,12 +19,39 @@ interface ColorField {
}

const COLOR_FIELDS: ColorField[] = [
{ key: 'primary', settingKey: 'theme_color_primary', labelKey: 'settings.colorPrimary' },
{ key: 'primaryDark', settingKey: 'theme_color_primary_dark', labelKey: 'settings.colorPrimaryDark' },
{ key: 'bg', settingKey: 'theme_color_bg', labelKey: 'settings.colorBg' },
{ key: 'surface', settingKey: 'theme_color_surface', labelKey: 'settings.colorSurface' },
{ key: 'border', settingKey: 'theme_color_border', labelKey: 'settings.colorBorder' },
{ key: 'textSecondary', settingKey: 'theme_color_text_secondary', labelKey: 'settings.colorTextSecondary' },
{ key: 'primary', settingKey: 'theme_color_primary', labelKey: 'settings.colorPrimary' },
{ key: 'primaryDark', settingKey: 'theme_color_primary_dark', labelKey: 'settings.colorPrimaryDark' },
{ key: 'bg', settingKey: 'theme_color_bg', labelKey: 'settings.colorBg' },
{ key: 'surface', settingKey: 'theme_color_surface', labelKey: 'settings.colorSurface' },
{ key: 'border', settingKey: 'theme_color_border', labelKey: 'settings.colorBorder' },
{ key: 'textSecondary', settingKey: 'theme_color_text_secondary', labelKey: 'settings.colorTextSecondary' },
]

const PRESETS: { key: string; nameKey: string; swatches: string[]; colors: ThemeColors }[] = [
{
key: 'default',
nameKey: 'settings.presetDefault',
swatches: ['#22c55e', '#030712', '#111827'],
colors: DEFAULT_COLORS,
},
{
key: 'ocean',
nameKey: 'settings.presetOcean',
swatches: ['#3b82f6', '#020817', '#0f172a'],
colors: { primary: '#3b82f6', primaryDark: '#2563eb', bg: '#020817', surface: '#0f172a', border: '#1e3a5f', textSecondary: '#94a3b8' },
},
{
key: 'sunset',
nameKey: 'settings.presetSunset',
swatches: ['#f97316', '#09090b', '#18181b'],
colors: { primary: '#f97316', primaryDark: '#ea580c', bg: '#09090b', surface: '#18181b', border: '#27272a', textSecondary: '#a1a1aa' },
},
{
key: 'violet',
nameKey: 'settings.presetViolet',
swatches: ['#a855f7', '#0b0014', '#170b24'],
colors: { primary: '#a855f7', primaryDark: '#9333ea', bg: '#0b0014', surface: '#170b24', border: '#3b1d6e', textSecondary: '#c084fc' },
},
]

function isValidHex(v: string): boolean {
Expand Down Expand Up @@ -80,21 +107,33 @@ export default function SettingsPage() {
}

const saveColors = async () => {
const snap = { ...colors }
setThemeColors(snap)
await Promise.all(
COLOR_FIELDS.map(f => settingsApi.set(f.settingKey, colors[f.key]))
COLOR_FIELDS.map(f => settingsApi.set(f.settingKey, snap[f.key]))
)
showSaved()
}

const applyPreset = async (preset: typeof PRESETS[0]) => {
const c = { ...preset.colors }
setColors(c)
const inputs: Record<string, string> = {}
COLOR_FIELDS.forEach(f => { inputs[f.key] = c[f.key as keyof ThemeColors] })
setHexInputs(inputs)
setThemeColors(c)
await Promise.all(COLOR_FIELDS.map(f => settingsApi.set(f.settingKey, c[f.key as keyof ThemeColors])))
showSaved()
}

const resetColors = async () => {
setColors({ ...DEFAULT_COLORS })
const c = { ...DEFAULT_COLORS }
setColors(c)
const inputs: Record<string, string> = {}
COLOR_FIELDS.forEach(f => { inputs[f.key] = DEFAULT_COLORS[f.key] })
setHexInputs(inputs)
setThemeColors({ ...DEFAULT_COLORS })
await Promise.all(
COLOR_FIELDS.map(f => settingsApi.set(f.settingKey, DEFAULT_COLORS[f.key]))
)
setThemeColors(c)
await Promise.all(COLOR_FIELDS.map(f => settingsApi.set(f.settingKey, DEFAULT_COLORS[f.key])))
showSaved()
}

Expand Down Expand Up @@ -157,6 +196,25 @@ export default function SettingsPage() {

<p className="text-xs text-gray-500">{t('settings.colorThemeDesc')}</p>

{/* Presets */}
<div className="space-y-1.5">
<label className="label">{t('settings.colorPresets')}</label>
<div className="flex flex-wrap gap-2">
{PRESETS.map(p => (
<button
key={p.key}
onClick={() => applyPreset(p)}
className="flex items-center gap-2 px-3 py-1.5 rounded-lg border border-gray-700 hover:border-gray-400 bg-gray-800/50 hover:bg-gray-700/50 text-sm text-gray-300 transition-colors"
>
{p.swatches.map((s, i) => (
<span key={i} className="w-3 h-3 rounded-full shrink-0 border border-white/10" style={{ backgroundColor: s }} />
))}
<span>{t(p.nameKey)}</span>
</button>
))}
</div>
</div>

<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
{COLOR_FIELDS.map(field => (
<div key={field.key} className="space-y-1">
Expand All @@ -175,7 +233,7 @@ export default function SettingsPage() {
placeholder="#rrggbb"
maxLength={7}
className={`input text-sm font-mono ${
isValidHex(hexInputs[field.key] ?? '') ? '' : 'border-red-600'
!hexInputs[field.key] || isValidHex(hexInputs[field.key]) ? '' : 'border-red-600'
}`}
/>
<div
Expand All @@ -195,4 +253,4 @@ export default function SettingsPage() {
</div>
</div>
)
}
}
Loading
Loading