fix: date input overflow, 7-day forecast on Home, screensaver button in settings
All checks were successful
Deploy / deploy (push) Successful in 2m45s

This commit is contained in:
Cosmo
2026-04-22 20:19:04 +00:00
parent 08739ba2f5
commit a7611b46c4
2 changed files with 30 additions and 10 deletions

View File

@@ -334,7 +334,7 @@ function HomeTab({ weather, sensors }: { weather: WeatherData | null; sensors: S
</div>
{weather.forecast && weather.forecast.length > 0 && (
<div style={{ display: 'flex', gap: 8 }}>
{weather.forecast.slice(0, 3).map(day => {
{weather.forecast.map(day => {
const d = new Date(day.date)
return (
<div key={day.date} style={{ flex: 1, background: 'rgba(255,255,255,0.04)', borderRadius: 14, padding: '10px 8px', textAlign: 'center', border: '1px solid rgba(255,255,255,0.04)' }}>
@@ -549,6 +549,19 @@ function SettingsTab({ city, onCityChange, onLogout, theme, onThemeChange }: { c
)}
</div>
{/* Lock screen */}
<button onClick={() => { const e = new CustomEvent('activate-screensaver'); window.dispatchEvent(e) }} style={{
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
padding: '16px', borderRadius: 18,
background: 'rgba(99,102,241,0.08)',
border: '1px solid rgba(129,140,248,0.15)',
color: '#a5b4fc', fontSize: 15, fontWeight: 600,
transition: 'all 0.25s ease',
}}>
<Lock size={18} />
Режим часов
</button>
{/* Logout */}
<button onClick={onLogout} style={{
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
@@ -650,6 +663,13 @@ function HomePageInner() {
return () => clearInterval(t)
}, [loadHA, unlocked])
// Listen for manual screensaver activation
useEffect(() => {
const handler = () => setScreensaverActive(true)
window.addEventListener('activate-screensaver', handler)
return () => window.removeEventListener('activate-screensaver', handler)
}, [])
// Screensaver idle detection
const resetIdle = useCallback(() => {
if (screensaverActive) { setScreensaverActive(false); return }