From 4b51b0665a8bc25130a553953fd0a05408cc971d Mon Sep 17 00:00:00 2001 From: Duarte Santos Date: Mon, 20 Jul 2026 17:38:59 +0200 Subject: [PATCH] =?UTF-8?q?Home:=20heutiges=20Training=20direkt=20unter=20?= =?UTF-8?q?dem=20Wochenkalender=20statt=20gro=C3=9Fer=20Today-Karte,=20K?= =?UTF-8?q?=C3=B6rpergewicht-Chart=20wieder=20auf=20Home?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die prominente Today/Rest-day/Start-Karte entfernt; stattdessen zeigt eine kompakte Zeile unter dem Wochenstrip das heutige Training (mit Start-/Resume- Shortcut). Der Gewichts-Chart (mit Ziel0-Linie) ist wieder auf dem Home-Screen. --- frontend/src/index.css | 8 ++++++ frontend/src/views/Home.jsx | 55 +++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/frontend/src/index.css b/frontend/src/index.css index 7d2d3e2..53be7c3 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -321,3 +321,11 @@ h4.sec{font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;color:var(- .ss-ex{position:relative} .ss-amp{text-align:center;font-size:1.3rem;font-weight:800;color:var(--acc);margin:14px 0 8px} .exmedia.compact img{height:190px} + +/* ---------- home: today's session row under the week strip ---------- */ +.today-row{display:flex;align-items:center;justify-content:space-between;gap:10px; + margin-top:12px;padding:11px 13px;border-radius:13px;background:var(--bg2);border:1px solid var(--line)} +.today-row:active{background:var(--card2)} +.today-row .lbl2{font-size:.62rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--dim)} +.today-row .ttl{font-weight:700;font-size:.98rem;line-height:1.2;text-transform:capitalize; + white-space:nowrap;overflow:hidden;text-overflow:ellipsis} diff --git a/frontend/src/views/Home.jsx b/frontend/src/views/Home.jsx index 9b805ad..675870f 100644 --- a/frontend/src/views/Home.jsx +++ b/frontend/src/views/Home.jsx @@ -2,8 +2,9 @@ import { useState } from 'react' import { useNavigate } from 'react-router-dom' import { useStore } from '../store/useStore.js' import { effectiveRoutine, effectiveRoutineId, streakWeeks, lastBW, setsDoneActive } from '../lib/history.js' -import { fmtNum, fmtDate, todayISO, isoOf, weekKey, DAYS, DAYN } from '../lib/format.js' +import { fmtNum, fmtDate, todayISO, isoOf, weekKey, DAYS } from '../lib/format.js' import { bwSheet, goalSheet, dayOverrideSheet, calendarSheet, startFlow, loadStarterPlan, bwDeltaColor } from '../sheets.jsx' +import LineChart from '../components/LineChart.jsx' // Home = what to do now + a quick glance. Deep charts & history live in Stats. export default function Home() { @@ -35,6 +36,10 @@ export default function Home() { const wThisWeek = S.workouts.filter(w => weekKey(w.d) === weekKey(todayISO())).length const plannedPerWeek = Object.keys(S.week).filter(k => S.week[k]).length + const bwPoints = S.bodyweight.slice(-30).map(b => ({ t: b.t || new Date(b.d).getTime(), y: b.w, d: b.d })) + + // today's session shown right under the week strip + const onToday = () => { if (S.active) nav('/workout'); else if (routine) startFlow(routine.id); else dayOverrideSheet(todayISO()) } return
@@ -49,36 +54,26 @@ export default function Home() {
{strip}
-
Tap a day to plan or move a session
+
+
+ {S.active ? 'โฑ๏ธ' : routine ? (routine.emoji || '๐Ÿ’ช') : '๐Ÿ˜Œ'} +
+
Today
+
{S.active ? S.active.name + ' โ€” in progress' : routine ? routine.name : 'Rest day'}{todayOvr && routine ? ' ยท rescheduled' : ''}
+
+
+ {S.active ? Resume โ–ถ + : routine ? Start โ–ถ + : ๏ผ‹} +
- {S.active ? ( -
-

Workout in progress

-
-
{S.active.name}
{setsDoneActive(S.active)} sets logged
- -
-
- ) : ( + {!S.routines.length && !S.active && (
-

Today

- {routine ? <> -
-
{routine.name}
{routine.ex.length} exercises ยท ~{routine.ex.length * 8} min{todayOvr && ยท rescheduled}
-
{routine.emoji || '๐Ÿ’ช'}
-
- - : S.routines.length ? <> -
Rest day ๐Ÿ˜Œ
-
Nothing planned for {DAYN[today.getDay()]} โ€” recovery counts too. Feeling strong anyway?
- - : <> -
Welcome! ๐Ÿ‘‹
-
Set up your weekly routine to get going โ€” or load a ready-made Push / Pull / Legs plan.
- -
- } +
Welcome! ๐Ÿ‘‹
+
Set up your weekly routine to get going โ€” or load a ready-made Push / Pull / Legs plan.
+ +
)} @@ -97,8 +92,8 @@ export default function Home() { {fmtDate(bw.d, true)}
{S.targetW &&
๐ŸŽฏ Goal {fmtNum(S.targetW)} {S.unit} ยท {Math.abs(S.targetW - bw.w) < 0.05 ? 'reached! ๐ŸŽ‰' : fmtNum(Math.abs(S.targetW - bw.w)) + ' ' + S.unit + ' to ' + (S.targetW > bw.w ? 'gain' : 'lose')}
} - - :
No entries yet โ€” log your weight to start tracking. It's also asked before every workout.
} +
+ :
No entries yet โ€” log your weight to start the curve. It's also asked before every workout.
}
calendarSheet()}>