From 13abce7a6d35c759e86e7c49ce45ecb715db36e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Jan 2026 17:27:13 +0000 Subject: [PATCH] fix: Persist settings panel preferences to localStorage Connect SettingsPanel UI controls to useSettingsStore hook so that Weekly Hours Target and Timesheet Reminders preferences are saved to localStorage and persist across browser sessions. Fixes #10 --- src/components/settings/SettingsPanel.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/settings/SettingsPanel.tsx b/src/components/settings/SettingsPanel.tsx index 99b241f..2f2a0a6 100644 --- a/src/components/settings/SettingsPanel.tsx +++ b/src/components/settings/SettingsPanel.tsx @@ -4,6 +4,7 @@ import { useState, useEffect } from 'react'; import { Card } from '@/components/ui'; import { bcClient } from '@/services/bc/bcClient'; import { useAuth } from '@/services/auth'; +import { useSettingsStore } from '@/hooks/useSettingsStore'; import { BuildingOffice2Icon, EnvelopeIcon, @@ -26,6 +27,7 @@ interface CompanyInfo { export function SettingsPanel() { const { account } = useAuth(); + const { weeklyHoursTarget, notificationsEnabled, updateSettings } = useSettingsStore(); const [companyInfo, setCompanyInfo] = useState(null); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); @@ -136,7 +138,13 @@ export function SettingsPanel() { + updateSettings({ + weeklyHoursTarget: Math.max(0, parseInt(e.target.value) || 0), + }) + } + min={0} className="w-20 rounded-lg border border-dark-600 bg-dark-800 px-3 py-2 text-dark-100 focus:outline-none focus:ring-2 focus:ring-thyme-500" /> @@ -146,7 +154,12 @@ export function SettingsPanel() {

Get reminded to fill in your timesheet