feat: remove deprecated demo route and enhance dashboard widget registration
- Removed outdated visualization demo route and fixed demo layout in the frontend. - Updated widget registration logic in `frontend/src/widgetSystem/registerDashboardWidgets.js` to ensure proper integration of core widgets. - Adjusted documentation in `.claude/docs/technical/DASHBOARD_WIDGETS_AGENT_GUIDE.md` and comments in `backend/widget_catalog.py` to reflect changes. - Added new dashboard widgets for activity and body overview, enhancing user experience and data visualization capabilities. - Bumped application version to reflect these changes.
This commit is contained in:
1 parent
725e7ffe4b
commit
ddc87ba5ae
18 files changed
+70
-138
No files matched your search
+3
-3
@@ -8,9 +8,9 @@ import {
|
||||
BODY_CHART_DAYS_DEFAULT,
|
||||
normalizeBodyChartDays,
|
||||
} from '../../widgetSystem/bodyChartDays'
|
||||
import PilotRuleCard from './PilotRuleCard'
|
||||
import DashboardRuleCard from './DashboardRuleCard'
|
||||
|
||||
export default function PilotActivitySection({ refreshTick = 0, chartDays = BODY_CHART_DAYS_DEFAULT }) {
|
||||
export default function ActivityOverviewWidget({ refreshTick = 0, chartDays = BODY_CHART_DAYS_DEFAULT }) {
|
||||
const periodDays = normalizeBodyChartDays(chartDays)
|
||||
const { activeProfile } = useProfile()
|
||||
const globalQualityLevel = activeProfile?.quality_filter_level
|
||||
@@ -124,7 +124,7 @@ export default function PilotActivitySection({ refreshTick = 0, chartDays = BODY
|
||||
</Link>
|
||||
</p>
|
||||
) : (
|
||||
actRules.map((item, i) => <PilotRuleCard key={i} item={item} />)
|
||||
actRules.map((item, i) => <DashboardRuleCard key={i} item={item} />)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
+4
-4
@@ -15,14 +15,14 @@ import dayjs from 'dayjs'
|
||||
import { api } from '../../utils/api'
|
||||
import { useProfile } from '../../context/ProfileContext'
|
||||
import { getInterpretation } from '../../utils/interpret'
|
||||
import { rollingAvg, fmtDate } from '../../pilot/pilotChartUtils'
|
||||
import { rollingAvg, fmtDate } from '../../widgetSystem/dashboardChartUtils'
|
||||
import {
|
||||
BODY_CHART_DAYS_DEFAULT,
|
||||
normalizeBodyChartDays,
|
||||
} from '../../widgetSystem/bodyChartDays'
|
||||
import PilotRuleCard from './PilotRuleCard'
|
||||
import DashboardRuleCard from './DashboardRuleCard'
|
||||
|
||||
export default function PilotBodySection({ refreshTick = 0, chartDays = BODY_CHART_DAYS_DEFAULT }) {
|
||||
export default function BodyOverviewWidget({ refreshTick = 0, chartDays = BODY_CHART_DAYS_DEFAULT }) {
|
||||
const windowDays = normalizeBodyChartDays(chartDays)
|
||||
const { activeProfile } = useProfile()
|
||||
const [weights, setWeights] = useState([])
|
||||
@@ -221,7 +221,7 @@ export default function PilotBodySection({ refreshTick = 0, chartDays = BODY_CHA
|
||||
Körperfett, Magermasse (FFMI), BMI – gleiche Logik wie auf der Verlauf-Seite (Körper).
|
||||
</p>
|
||||
{rules.map((item, i) => (
|
||||
<PilotRuleCard key={i} item={item} />
|
||||
<DashboardRuleCard key={i} item={item} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { useState } from 'react'
|
||||
import { ChevronDown, ChevronUp } from 'lucide-react'
|
||||
import { getStatusColor, getStatusBg } from '../../utils/interpret'
|
||||
|
||||
export default function PilotRuleCard({ item }) {
|
||||
export default function DashboardRuleCard({ item }) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const color = getStatusColor(item.status)
|
||||
return (
|
||||
+1
-1
@@ -38,7 +38,7 @@ function buildAutoTileIds(refTiles, hasBf, hasKcal) {
|
||||
* @param {{ refreshTick?: number, kpiConfig?: Record<string, unknown> }} props
|
||||
* kpiConfig.tiles: geordnete Kachel-ids; fehlend = automatische Belegung (wie bisher).
|
||||
*/
|
||||
export default function PilotKpiBoard({ refreshTick = 0, kpiConfig }) {
|
||||
export default function KpiBoardWidget({ refreshTick = 0, kpiConfig }) {
|
||||
const manualOrder = useMemo(() => kpiTileOrderFromConfig(kpiConfig), [kpiConfig])
|
||||
|
||||
const { activeProfile } = useProfile()
|
||||
+7
-7
@@ -9,7 +9,7 @@ import { api } from '../../utils/api'
|
||||
* @param {{ onSaved?: () => void, captureConfig?: Record<string, unknown> }} props
|
||||
* captureConfig: show_weight, show_resting_hr, show_hrv, show_vo2_max (false = ausblenden; fehlend = true)
|
||||
*/
|
||||
export default function PilotQuickCapture({ onSaved, captureConfig }) {
|
||||
export default function QuickCaptureWidget({ onSaved, captureConfig }) {
|
||||
const cfgRaw = captureConfig && typeof captureConfig === 'object' ? captureConfig : {}
|
||||
const showWeight = cfgRaw.show_weight !== false
|
||||
const showRestingHr = cfgRaw.show_resting_hr !== false
|
||||
@@ -200,7 +200,7 @@ export default function PilotQuickCapture({ onSaved, captureConfig }) {
|
||||
{showRestingHr && (
|
||||
<div>
|
||||
<label
|
||||
htmlFor="pqc-resting-hr"
|
||||
htmlFor="qcw-resting-hr"
|
||||
className="form-label"
|
||||
style={{ display: 'block', marginBottom: 4, fontSize: 11, fontWeight: 600, color: 'var(--text2)' }}
|
||||
>
|
||||
@@ -208,7 +208,7 @@ export default function PilotQuickCapture({ onSaved, captureConfig }) {
|
||||
<span style={{ fontWeight: 400, color: 'var(--text3)' }}> (bpm)</span>
|
||||
</label>
|
||||
<input
|
||||
id="pqc-resting-hr"
|
||||
id="qcw-resting-hr"
|
||||
type="number"
|
||||
className="form-input"
|
||||
style={{ width: '100%' }}
|
||||
@@ -221,7 +221,7 @@ export default function PilotQuickCapture({ onSaved, captureConfig }) {
|
||||
{showHrv && (
|
||||
<div>
|
||||
<label
|
||||
htmlFor="pqc-hrv"
|
||||
htmlFor="qcw-hrv"
|
||||
className="form-label"
|
||||
style={{ display: 'block', marginBottom: 4, fontSize: 11, fontWeight: 600, color: 'var(--text2)' }}
|
||||
>
|
||||
@@ -229,7 +229,7 @@ export default function PilotQuickCapture({ onSaved, captureConfig }) {
|
||||
<span style={{ fontWeight: 400, color: 'var(--text3)' }}> (ms)</span>
|
||||
</label>
|
||||
<input
|
||||
id="pqc-hrv"
|
||||
id="qcw-hrv"
|
||||
type="number"
|
||||
className="form-input"
|
||||
style={{ width: '100%' }}
|
||||
@@ -242,14 +242,14 @@ export default function PilotQuickCapture({ onSaved, captureConfig }) {
|
||||
{showVo2 && (
|
||||
<div>
|
||||
<label
|
||||
htmlFor="pqc-vo2"
|
||||
htmlFor="qcw-vo2"
|
||||
className="form-label"
|
||||
style={{ display: 'block', marginBottom: 4, fontSize: 11, fontWeight: 600, color: 'var(--text2)' }}
|
||||
>
|
||||
VO₂max
|
||||
</label>
|
||||
<input
|
||||
id="pqc-vo2"
|
||||
id="qcw-vo2"
|
||||
type="number"
|
||||
className="form-input"
|
||||
style={{ width: '100%' }}
|
||||
+2
-2
@@ -4,7 +4,7 @@ import { useProfile } from '../../context/ProfileContext'
|
||||
|
||||
dayjs.locale('de')
|
||||
|
||||
export default function PilotWelcome() {
|
||||
export default function WelcomeWidget() {
|
||||
const { activeProfile } = useProfile()
|
||||
return (
|
||||
<div className="card section-gap" style={{ marginBottom: 16 }}>
|
||||
@@ -12,7 +12,7 @@ export default function PilotWelcome() {
|
||||
Hallo, {activeProfile?.name || 'Nutzer'} 👋
|
||||
</h2>
|
||||
<p style={{ fontSize: 12, color: 'var(--text3)', margin: '6px 0 0' }}>
|
||||
{dayjs().format('dddd, DD. MMMM YYYY')} · Pilot-Übersicht
|
||||
{dayjs().format('dddd, DD. MMMM YYYY')} · Übersicht
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
Reference in new issue
Block a user