fix: 4 bugs — MSK today events, settings scroll, note dates, persistent notes volume
All checks were successful
Deploy / deploy (push) Successful in 4m35s
All checks were successful
Deploy / deploy (push) Successful in 4m35s
- calendar API: today/week ranges use Moscow time (UTC+3) instead of UTC — previously today events did not appear until 03:00 MSK - settings tab: add -webkit-overflow-scrolling: touch + touchAction pan-y for tablet scroll - NotesTab: add date picker (pinDate) in editor header + date badge in list - home: pinnedNotes now filters by pinDate (today or future), falls back to latest - notes/auth: storage moved from /tmp to /data (falls back to /tmp if /data missing) - deploy workflow: mount /opt/digital-home/smart-home-tablet-data:/data so notes survive redeploys
This commit is contained in:
15
app/page.tsx
15
app/page.tsx
@@ -394,10 +394,19 @@ function HomeTab({ weather, sensors }: { weather: WeatherData | null; sensors: S
|
||||
})
|
||||
.catch(() => {})
|
||||
|
||||
// Notes
|
||||
// Notes — pinned (pinDate today or future), fallback to latest
|
||||
fetch('/api/notes')
|
||||
.then(r => r.json())
|
||||
.then(d => setPinnedNotes((d.notes || []).slice(0, 3)))
|
||||
.then(d => {
|
||||
const all = d.notes || []
|
||||
const today = new Date(); today.setHours(0, 0, 0, 0)
|
||||
const pinned = all.filter((n: any) => {
|
||||
if (!n.pinDate) return false
|
||||
const pd = new Date(n.pinDate); pd.setHours(0, 0, 0, 0)
|
||||
return pd.getTime() >= today.getTime()
|
||||
})
|
||||
setPinnedNotes((pinned.length ? pinned : all).slice(0, 3))
|
||||
})
|
||||
.catch(() => {})
|
||||
}, [])
|
||||
|
||||
@@ -650,7 +659,7 @@ function SettingsTab({ city, onCityChange, onLogout, theme, onThemeChange }: { c
|
||||
const currentCity = CITIES.find(c => c.id === city) || CITIES[0]
|
||||
|
||||
return (
|
||||
<div style={{ flex: 1, overflowY: 'auto', padding: '24px', display: 'flex', flexDirection: 'column', gap: 16, maxWidth: 560, margin: '0 auto', width: '100%' }}>
|
||||
<div style={{ flex: 1, overflowY: 'auto', WebkitOverflowScrolling: 'touch' as any, touchAction: 'pan-y', padding: '24px', display: 'flex', flexDirection: 'column', gap: 16, maxWidth: 560, margin: '0 auto', width: '100%' }}>
|
||||
<h2 style={{ fontSize: 24, fontWeight: 800, color: 'var(--text-primary)', margin: '0 0 8px', letterSpacing: '-0.5px' }}>Настройки</h2>
|
||||
|
||||
{/* City selector */}
|
||||
|
||||
Reference in New Issue
Block a user