feat: introduce recovery dashboard visualization and refactor recovery charts
- Added a new endpoint for the recovery dashboard visualization in `charts.py`, integrating multiple recovery metrics and insights. - Implemented the `get_recovery_dashboard_viz` function to streamline data retrieval for recovery-related charts. - Refactored the `RecoveryCharts` component to utilize the new `RecoveryDashboardOverview`, simplifying the component structure and enhancing maintainability. - Updated the `RecoveryChartsPanelWidget` and `History` page to reflect the new recovery dashboard, improving user navigation and experience. - Deprecated the old recovery charts component, encouraging the use of the new overview for better data presentation.
This commit is contained in:
1 parent
bf84e3c2a5
commit
f42d3a9c92
9 files changed
+1219
-857
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import RecoveryCharts from '../RecoveryCharts'
|
||||
import RecoveryDashboardOverview from '../RecoveryDashboardOverview'
|
||||
import { normalizeBodyChartDays } from '../../widgetSystem/bodyChartDays'
|
||||
|
||||
/**
|
||||
* Erholung R1–R5 (wie Verlauf Erholung).
|
||||
* Erholung Layer 2b (ein Bundle-Request). Link zum Verlauf unter Fitness.
|
||||
* @param {{ refreshTick?: number, chartDays?: number }} props
|
||||
*/
|
||||
export default function RecoveryChartsPanelWidget({ refreshTick = 0, chartDays }) {
|
||||
@@ -11,22 +11,22 @@ export default function RecoveryChartsPanelWidget({ refreshTick = 0, chartDays }
|
||||
const days = chartDays != null ? normalizeBodyChartDays(chartDays) : 28
|
||||
|
||||
return (
|
||||
<div className="card section-gap" style={{ marginBottom: 16 }}>
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 10 }}>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: 'var(--text1)' }}>Erholung — Charts</div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: 'var(--text1)' }}>Erholung — Übersicht</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--text3)' }}>Schlaf, Recovery, Vitalwerte · {days} Tage</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ fontSize: 12, padding: '6px 12px' }}
|
||||
onClick={() => nav('/history', { state: { tab: 'recovery' } })}
|
||||
onClick={() => nav('/history', { state: { tab: 'activity' } })}
|
||||
>
|
||||
Verlauf →
|
||||
</button>
|
||||
</div>
|
||||
<RecoveryCharts key={`${refreshTick}-${days}`} days={days} />
|
||||
<RecoveryDashboardOverview key={`${refreshTick}-${days}`} period={days} hidePeriodSelector />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user