feat: Remove deprecated pilot widgets and layout management
- Deleted unused components: GoalsSnapshotWidget, ReferenceValuesSummaryWidget, WeightKpiWidget, and PilotVizAdminCard. - Removed associated layout storage and widget registry logic to streamline the pilot visualization module. - Updated PilotVizPage to integrate new components for improved user experience and functionality.
This commit is contained in:
1 parent
8c8f595385
commit
c0cb995a7b
15 files changed
+837
-504
No files matched your search
@@ -1,19 +1,24 @@
|
||||
import { useState } from 'react'
|
||||
import { FlaskConical } from 'lucide-react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { resolvePilotWidgetsForRender } from '../pilot/widgetRegistry'
|
||||
import { loadPilotLayout } from '../pilot/pilotLayoutStorage'
|
||||
import PilotVizAdminCard from '../components/pilot/PilotVizAdminCard'
|
||||
import PilotWelcome from '../components/pilot/PilotWelcome'
|
||||
import PilotQuickCapture from '../components/pilot/PilotQuickCapture'
|
||||
import PilotKpiBoard from '../components/pilot/PilotKpiBoard'
|
||||
import PilotBodySection from '../components/pilot/PilotBodySection'
|
||||
import PilotActivitySection from '../components/pilot/PilotActivitySection'
|
||||
|
||||
/**
|
||||
* Pilot: Widget-Schicht (Layer 3b) parallel zum produktiven Dashboard.
|
||||
* Pilot-Übersicht nach Product-Spec:
|
||||
* Willkommen → Schnelleingabe (Gewicht + Vitalwerte) → KPIs (Referenzen + KF% + Ø kcal, max. 9)
|
||||
* → Bereich Körper (Gewicht-Chart 30 T, Ø7/Ø14, Bewertung wie Verlauf)
|
||||
* → Bereich Aktivität (Trainingstyp 30 T, Konsistenz).
|
||||
*/
|
||||
export default function PilotVizPage() {
|
||||
const [layout, setLayout] = useState(() => loadPilotLayout())
|
||||
const widgets = resolvePilotWidgetsForRender(layout)
|
||||
const [refreshTick, setRefreshTick] = useState(0)
|
||||
const bump = () => setRefreshTick((t) => t + 1)
|
||||
|
||||
return (
|
||||
<div style={{ paddingBottom: 96, textAlign: 'left', maxWidth: 900, margin: '0 auto' }}>
|
||||
<div style={{ paddingBottom: 96, textAlign: 'left', maxWidth: 920, margin: '0 auto' }}>
|
||||
<div style={{ marginBottom: 20 }}>
|
||||
<Link
|
||||
to="/settings"
|
||||
@@ -24,37 +29,19 @@ export default function PilotVizPage() {
|
||||
</Link>
|
||||
<h1 className="page-title" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
<FlaskConical size={26} color="var(--accent)" />
|
||||
Pilot: Visualisierungs-Module
|
||||
Pilot: Übersicht
|
||||
</h1>
|
||||
<p style={{ fontSize: 14, color: 'var(--text2)', lineHeight: 1.6, marginTop: 8 }}>
|
||||
Testumgebung für die Widget-Registry. Konfiguration unten; produktive Übersicht und Verlauf sind unverändert.
|
||||
<p style={{ fontSize: 13, color: 'var(--text2)', lineHeight: 1.6, marginTop: 8 }}>
|
||||
Konfigurierbare Ziel-Übersicht (Test). Produktives Dashboard und Verlauf unverändert. Nach Speichern von
|
||||
Gewicht oder Vitalwerten werden KPIs und Körperbereich neu geladen.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<PilotVizAdminCard layout={layout} onLayoutChange={setLayout} />
|
||||
|
||||
{widgets.length === 0 ? (
|
||||
<div className="card section-gap" style={{ textAlign: 'center', padding: 24 }}>
|
||||
<p style={{ fontSize: 14, color: 'var(--text2)', margin: 0 }}>
|
||||
Keine Widgets sichtbar. Aktiviere mindestens eines in der <strong>Widget-Konfiguration</strong> oben.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
widgets.map((def) => {
|
||||
const { Component } = def
|
||||
return (
|
||||
<section key={def.id} className="card section-gap" style={{ overflow: 'hidden' }}>
|
||||
<div className="card-title">{def.title}</div>
|
||||
{def.description && (
|
||||
<p style={{ fontSize: 13, color: 'var(--text2)', marginTop: 4, marginBottom: 14, lineHeight: 1.5 }}>
|
||||
{def.description}
|
||||
</p>
|
||||
)}
|
||||
<Component />
|
||||
</section>
|
||||
)
|
||||
})
|
||||
)}
|
||||
<PilotWelcome />
|
||||
<PilotQuickCapture onSaved={bump} />
|
||||
<PilotKpiBoard refreshTick={refreshTick} />
|
||||
<PilotBodySection refreshTick={refreshTick} />
|
||||
<PilotActivitySection refreshTick={refreshTick} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -449,7 +449,8 @@ export default function SettingsPage() {
|
||||
Pilot: Visualisierungs-Module
|
||||
</div>
|
||||
<p style={{ fontSize: 12, color: 'var(--text2)', marginBottom: 12, lineHeight: 1.5 }}>
|
||||
Testumgebung für die Widget-Schicht (Layer 3b). Die Übersicht und der Verlauf bleiben unverändert.
|
||||
Ziel-Übersicht-Pilot: Schnelleingabe, KPIs (Referenzen + KF% + Ø-Kalorien), Körper-Chart,
|
||||
Bewertungen, Aktivität. Produktives Dashboard bleibt unverändert.
|
||||
</p>
|
||||
<Link
|
||||
to="/pilot/viz"
|
||||
|
||||
Reference in new issue
Block a user