feat: complete sleep module overhaul - app standard compliance
Backend improvements: - Plausibility check: phases must sum to duration (±5 min tolerance) - Auto-calculate wake_count from awake segments in import - Applied to both create_sleep and update_sleep endpoints Frontend complete rewrite: - ✅ Drag & Drop CSV import (like NutritionPage) - ✅ Inline editing (no scroll to top, edit directly in list) - ✅ Toast notifications (no more alerts, auto-dismiss 4s) - ✅ Source badges (Manual/Apple Health/Garmin with colors) - ✅ Expandable segment timeline view (JSONB sleep_segments) - ✅ Live plausibility check (shows error if phases ≠ duration) - ✅ Color-coded sleep phases (deep/rem/light/awake) - ✅ Show wake_count in list view Design improvements: - Stats card on top (7-day avg) - Import drag zone with visual feedback - Clean inline edit mode with validation - Timeline view with phase colors - Responsive button layout Confirmed: Kernschlaf (Apple Health) = Leichtschlaf (light_minutes) ✓ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
da376a8b18
commit
b52c877367
3 files changed
+551
-398
No files matched your search
@@ -130,6 +130,10 @@ body { font-family: var(--font); background: var(--bg); color: var(--text1); -we
|
||||
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
|
||||
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
@keyframes slideDown {
|
||||
from { transform: translate(-50%, -20px); opacity: 0; }
|
||||
to { transform: translate(-50%, 0); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Additional vars */
|
||||
:root {
|
||||
|
||||
Reference in new issue
Block a user