Files
workouts/Workouts/ContentView.swift
T
rzen 6e440317c4 Restructure into a three-tab app with Progress, goals, and Meditation
The UX redesign's first landing (spec in UX-REDESIGN.md): ContentView
becomes a Today / Progress / Settings TabView, "Routine" replaces
"Split" in every user-facing string and view name (code-level types
keep their names), and workout starting moves to shared
WorkoutStarter / StartedWorkoutNavigator plumbing.

- New Progress tab: weekly goal streaks, workout trends, per-exercise
  weight progression, achievements, and the full history list
  (WorkoutLogsView -> WorkoutHistoryView).
- Goals: stable categories workouts roll up to, managed from Settings.
- New Meditation exercise + starter routine; timed sits record to
  Apple Health as Mind & Body sessions.

Claude-Session: https://claude.ai/code/session_012qw2itfzKyEJ1HpsFt8Ex4
2026-07-11 07:53:01 -04:00

41 lines
1.3 KiB
Swift

//
// ContentView.swift
// Workouts
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ContentView: View {
@Environment(LiveRunState.self) private var liveRun
var body: some View {
TabView {
Tab("Today", systemImage: "sun.max.fill") {
TodayView()
}
Tab("Progress", systemImage: "chart.line.uptrend.xyaxis") {
ProgressTabView()
}
Tab("Settings", systemImage: "gearshape.2") {
SettingsView()
}
}
// Prop the phone up and it runs the live Apple Watch workout — two-way: drive from
// either device and the other follows.
.fullScreenCover(isPresented: Binding(
get: { liveRun.presentable != nil },
set: { presenting in if !presenting { liveRun.mute() } }
)) {
if let frame = liveRun.presentable {
// Re-key on the followed log so a flow-mode auto-advance (the driver
// moving to the next exercise) rebuilds the mirror for the new exercise
// instead of leaving a stale one pinned to the previous log.
LiveRunCoverView(frame: frame) { liveRun.mute() }
.id(frame.logID)
}
}
}
}