diff --git a/frontend/src/components/settings/SettingsLocalSection.tsx b/frontend/src/components/settings/SettingsLocalSection.tsx index 29aab85..6774c56 100644 --- a/frontend/src/components/settings/SettingsLocalSection.tsx +++ b/frontend/src/components/settings/SettingsLocalSection.tsx @@ -28,6 +28,13 @@ import { setSavedFontScale, } from '../../utils/fontScale'; import { getAutoFocusInputEnabled, setAutoFocusInputEnabled } from '../../utils/autoFocusInput'; +import { + getShowBatteryPercent, + setShowBatteryPercent as saveBatteryPercent, + getShowBatteryVoltage, + setShowBatteryVoltage as saveBatteryVoltage, +} from '../../utils/batteryDisplay'; +import { BATTERY_DISPLAY_CHANGE_EVENT } from '../StatusBar'; export function SettingsLocalSection({ onLocalLabelChange, @@ -50,6 +57,8 @@ export function SettingsLocalSection({ const [localLabelText, setLocalLabelText] = useState(() => getLocalLabel().text); const [localLabelColor, setLocalLabelColor] = useState(() => getLocalLabel().color); const [autoFocusInput, setAutoFocusInput] = useState(getAutoFocusInputEnabled); + const [batteryPercent, setBatteryPercent] = useState(getShowBatteryPercent); + const [batteryVoltage, setBatteryVoltage] = useState(getShowBatteryVoltage); const [fontScale, setFontScale] = useState(getSavedFontScale); const [fontScaleSlider, setFontScaleSlider] = useState(getSavedFontScale); const [fontScaleInput, setFontScaleInput] = useState(() => String(getSavedFontScale())); @@ -201,6 +210,43 @@ export function SettingsLocalSection({ Auto-focus input on conversation load (desktop only) + + + + + {(batteryPercent || batteryVoltage) && ( +

+ Battery data updates every 60 seconds and may take up to a minute to appear after + connecting. +

+ )} +