Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/fonts/EdgeIcons.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions assets/fonts/edge_icons/rucking.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions lib/ble/live_step_runs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,20 @@ const String kStepSourceStrap = 'strap_100hz';
// * 'sprinting', 'track_intervals', 'hurdles' are out — mostly standing
// recovery, and sprint arm mechanics sit at the 5 steps/s ceiling of the
// 0.2-2.0 s interval guard rather than inside it.
// 'rucking' is in on hiking's footing: the same walk under a pack, with the
// arms still free to swing. Hands held on the shoulder straps damp the swing
// the way a rail does, so a ruck can under-count; it cannot over-count.
// 'treadmill_ruck' is the same walk on a belt, as 'treadmill' is to a run.
// Widening it is one line plus a test edit; do that only with evidence.
const Set<String> kGaitStepTypeKeys = {
'running',
'trail_running',
'walking',
'hiking',
'rucking',
'dog_walking',
'treadmill',
'treadmill_ruck',
'cross_country',
};

Expand Down
3 changes: 3 additions & 0 deletions lib/compute/manual_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ Map<String, dynamic> buildManualSessionRow({
if (existing != null) ...{
'private': existing['private'] ?? 0,
'rpe': existing['rpe'],
'load_kg': existing['load_kg'],
'body_kg': existing['body_kg'],
'entered_distance_m': existing['entered_distance_m'],
},
};
}
Expand Down
1 change: 1 addition & 0 deletions lib/data/backup_extras.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const Map<String, String> kPrefTypes = {
'workout.ghost_buzz': 'bool',
'workout.interval_buzz': 'bool',
'workout.interval_last': 'string',
'workout.load_carried_last': 'string',
'workout.show_map': 'bool',
};

Expand Down
51 changes: 50 additions & 1 deletion lib/data/db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ class LocalDb {
/// pass it: sqflite throws `ArgumentError('onCreate must be null if no
/// version is specified')` BEFORE opening anything when `onCreate` is given
/// without `version` (sqflite_common database_mixin.dart).
static const int schemaVersion = 62;
static const int schemaVersion = 64;

/// In-memory cache identity, advanced after open, wipe or committed import.
/// It is local to this isolate; no cache survives a process restart.
Expand Down Expand Up @@ -1615,6 +1615,14 @@ class LocalDb {
await _createStoreIdentity(db);
await _createDayCheckpoint(db);
}
if (oldV < 63) {
// Two nullable columns, no backfill: no earlier session knew its
// pack weight.
await _ensureSessionLoadColumns(db);
}
if (oldV < 64) {
await _ensureSessionEnteredDistanceColumn(db);
}
},
onOpen: (db) async {
await _repairOpenSchema(db);
Expand Down Expand Up @@ -6328,6 +6336,26 @@ class LocalDb {
await _addColumnIfMissing(db, 'sessions', 'trace_samples', 'INTEGER');
}

/// The weight carried on a ruck (v63), and the body weight it was carried
/// at, both in kg and both typed by the user: `load_kg` on the setup screen,
/// `body_kg` copied from the profile when the session ends. NULL is "not
/// entered" on every other session and every import. `body_kg` is banked
/// with the load rather than read from the profile later because a share of
/// body weight worked out against next year's weight describes a different
/// outing.
static Future<void> _ensureSessionLoadColumns(Database db) async {
await _addColumnIfMissing(db, 'sessions', 'load_kg', 'REAL');
await _addColumnIfMissing(db, 'sessions', 'body_kg', 'REAL');
}

/// A distance the user read off a machine and typed in (v64), in metres.
/// Its own column, and named for where it came from, so it is never read as
/// a measurement: a measured distance lives in `workout_route` and this app
/// has no other way to know one. NULL on every session nobody typed it for.
static Future<void> _ensureSessionEnteredDistanceColumn(Database db) async {
await _addColumnIfMissing(db, 'sessions', 'entered_distance_m', 'REAL');
}

static Future<void> _ensureSessionSchema(Database db) async {
await _addColumnIfMissing(db, 'sessions', 'steps', 'INTEGER');
await _addColumnIfMissing(db, 'sessions', 'hrr_bpm', 'REAL');
Expand Down Expand Up @@ -6383,6 +6411,8 @@ class LocalDb {
'INTEGER NOT NULL DEFAULT 0',
);
await _ensureSessionTraceColumns(db);
await _ensureSessionLoadColumns(db);
await _ensureSessionEnteredDistanceColumn(db);
// Which workout sensors scored a session ([stampSessionSensor]), one row
// each: a strap serving both heart-rate services can hand the live
// source from one to the other mid-workout. A side table, not a
Expand Down Expand Up @@ -16927,6 +16957,25 @@ class LocalDb {
await db.update('sessions', {'rpe': rpe}, where: 'id = ?', whereArgs: [id]);
}

/// Set a session's carried weight. Its own UPDATE for the reason
/// [setSessionRpe] has one: `putSession` replaces the whole row. [bodyKg] is
/// written only when given, so correcting the pack weight on an old session
/// keeps the body weight that was banked with it.
static Future<void> setSessionLoad(String id, double? loadKg,
{double? bodyKg}) async {
final db = await instance;
await db.update('sessions', {'load_kg': loadKg, 'body_kg': ?bodyKg},
where: 'id = ?', whereArgs: [id]);
}

/// Set the distance the user typed for a session, in metres, or clear it
/// with null. A narrow UPDATE like [setSessionLoad], for the same reason.
static Future<void> setSessionEnteredDistance(String id, double? meters) async {
final db = await instance;
await db.update('sessions', {'entered_distance_m': meters},
where: 'id = ?', whereArgs: [id]);
}

// NOTE: the in-app notifications feed (putNotification/notifications/
// markNotificationsRead/unreadCount, + the `notifications` table) was
// removed — OS-level notifications (NotificationCenter.emit's
Expand Down
10 changes: 10 additions & 0 deletions lib/data/local_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import '../ble/adapters/_registry.dart' show kBandRegistry;
import 'local_repository.dart';
import 'series_codec.dart';
import '../gps/route_models.dart';
import '../ui2/activity/catalogue.dart' show activityByName, loadCarried;
import '../gps/route_math.dart' as rmath;

class LocalRepositoryImpl extends LocalRepository {
Expand Down Expand Up @@ -3557,8 +3558,17 @@ class LocalRepositoryImpl extends LocalRepository {
// km split (a real known distance held over a real known duration) and
// never recomputed once banked, because the raw substrate it needs ages
// out in days while the split it was computed from does not change.
//
// Not for a session that carried weight. The estimate reads the speed
// as unloaded, and a pack raises the heart rate at any speed, so a ruck
// would bank a lower VO2max than the same person has. None is banked.
// The row's own weight counts too, so a ruck retyped to another activity
// stays out.
double? vo2max;
if ((row['vo2max_estimate'] as num?) == null &&
!loadCarried
.contains(activityByName(row['type'] as String?)?.name) &&
((row['load_kg'] as num?) ?? 0) <= 0 &&
hrMaxForSession != null &&
restingHrForSession != null) {
vo2max = await _submaxVo2maxFromSplits(
Expand Down
1 change: 1 addition & 0 deletions lib/gps/route_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Set<String> kRouteTypeKeys = {
'walking',
'dog_walking',
'hiking',
'rucking',
'cycling',
'mountain_biking',
'cross_country',
Expand Down
4 changes: 4 additions & 0 deletions lib/health/health_export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2193,6 +2193,8 @@ HealthWorkoutActivityType healthActivityForType(
case 'walk':
case 'walking':
case 'dog_walking':
// Not a hike: there is no trail. A loaded walk on a belt.
case 'treadmill_ruck':
return HealthWorkoutActivityType.WALKING;
case 'swim':
case 'swimming':
Expand Down Expand Up @@ -2225,6 +2227,8 @@ HealthWorkoutActivityType healthActivityForType(
case 'hike':
case 'hiking':
case 'hiking/rucking':
// Neither store has a rucking type; a ruck is a hike with a load.
case 'rucking':
return HealthWorkoutActivityType.HIKING;
case 'climb':
case 'climbing':
Expand Down
7 changes: 5 additions & 2 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@
"tabNutrition": "Ernährung",
"tabWorkout": "Training",
"tabWellness": "Wohlbefinden",
"activityCatalogueName": "{key, select, kcardio{Ausdauer} kstrength{Kraft} ksports{Sport} kathletics{Leichtathletik} koutdoor{Outdoor} kmindbody{Körper & Geist} keveryday{Alltag} kother{Sonstiges} krunning{Laufen} ktrailrunning{Trailrunning} kwalking{Gehen} khiking{Wandern} kcycling{Radfahren} kindoorbike{Indoor-Bike} krowing{Rudern} kswimming{Schwimmen} kelliptical{Crosstrainer} kstairclimber{Treppensteiger} ktreadmill{Laufband} kjumprope{Seilspringen} kweighttraining{Krafttraining} kpowerlifting{Kraftdreikampf} kbodyweight{Eigengewicht} kcalisthenics{Calisthenics} kkettlebell{Kettlebell} kcrossfit{CrossFit} khiit{HIIT} kcircuittraining{Zirkeltraining} kfunctional{Functional Training} kfootball{Fußball} kbasketball{Basketball} kcricket{Cricket} ktennis{Tennis} kbadminton{Badminton} ktabletennis{Tischtennis} ksquash{Squash} kpadel{Padel} kvolleyball{Volleyball} khockey{Hockey} kbaseball{Baseball} krugby{Rugby} kgolf{Golf} kbowling{Bowling} kboxing{Boxen} kmartialarts{Kampfsport} kwrestling{Ringen} kclimbing{Klettern} ksprinting{Sprint} ktrackintervals{Bahnintervalle} kcrosscountry{Crosslauf} khurdles{Hürdenlauf} klongjump{Weitsprung} kshotput{Kugelstoßen} kjavelin{Speerwurf} kpolevault{Stabhochsprung} kmountainbiking{Mountainbiken} kkayaking{Kajakfahren} ksurfing{Surfen} kpaddleboard{Stand-up-Paddling} kskiing{Skifahren} ksnowboarding{Snowboarden} kskating{Eislaufen} kskateboarding{Skateboarden} khorseriding{Reiten} kyoga{Yoga} kpilates{Pilates} kstretching{Dehnen} kmobility{Mobility} ktaichi{Tai-Chi} kbreathwork{Atemübungen} kmeditation{Meditation} khousework{Hausarbeit} kgardening{Gartenarbeit} kdogwalking{Gassi gehen} kchildcare{Kinderbetreuung} kdiy{Heimwerken} kshopping{Einkaufen} kstairs{Treppen} kgeneralworkout{Allgemeines Training} kdancing{Tanzen} kintimacy{Intimität} kphysiotherapy{Physiotherapie} ksauna{Sauna} kcoldplunge{Eisbad} other{{name}}}",
"activityCatalogueName": "{key, select, kcardio{Ausdauer} kstrength{Kraft} ksports{Sport} kathletics{Leichtathletik} koutdoor{Outdoor} kmindbody{Körper & Geist} keveryday{Alltag} kother{Sonstiges} krunning{Laufen} ktrailrunning{Trailrunning} kwalking{Gehen} khiking{Wandern} krucking{Rucking} kcycling{Radfahren} kindoorbike{Indoor-Bike} krowing{Rudern} kswimming{Schwimmen} kelliptical{Crosstrainer} kstairclimber{Treppensteiger} ktreadmill{Laufband} ktreadmillruck{Laufband-Rucking} kjumprope{Seilspringen} kweighttraining{Krafttraining} kpowerlifting{Kraftdreikampf} kbodyweight{Eigengewicht} kcalisthenics{Calisthenics} kkettlebell{Kettlebell} kcrossfit{CrossFit} khiit{HIIT} kcircuittraining{Zirkeltraining} kfunctional{Functional Training} kfootball{Fußball} kbasketball{Basketball} kcricket{Cricket} ktennis{Tennis} kbadminton{Badminton} ktabletennis{Tischtennis} ksquash{Squash} kpadel{Padel} kvolleyball{Volleyball} khockey{Hockey} kbaseball{Baseball} krugby{Rugby} kgolf{Golf} kbowling{Bowling} kboxing{Boxen} kmartialarts{Kampfsport} kwrestling{Ringen} kclimbing{Klettern} ksprinting{Sprint} ktrackintervals{Bahnintervalle} kcrosscountry{Crosslauf} khurdles{Hürdenlauf} klongjump{Weitsprung} kshotput{Kugelstoßen} kjavelin{Speerwurf} kpolevault{Stabhochsprung} kmountainbiking{Mountainbiken} kkayaking{Kajakfahren} ksurfing{Surfen} kpaddleboard{Stand-up-Paddling} kskiing{Skifahren} ksnowboarding{Snowboarden} kskating{Eislaufen} kskateboarding{Skateboarden} khorseriding{Reiten} kyoga{Yoga} kpilates{Pilates} kstretching{Dehnen} kmobility{Mobility} ktaichi{Tai-Chi} kbreathwork{Atemübungen} kmeditation{Meditation} khousework{Hausarbeit} kgardening{Gartenarbeit} kdogwalking{Gassi gehen} kchildcare{Kinderbetreuung} kdiy{Heimwerken} kshopping{Einkaufen} kstairs{Treppen} kgeneralworkout{Allgemeines Training} kdancing{Tanzen} kintimacy{Intimität} kphysiotherapy{Physiotherapie} ksauna{Sauna} kcoldplunge{Eisbad} other{{name}}}",
"supplementSmartWindowMinutes": "{m} Min. vor der Weckzeit",
"supplementGoalValue": "Ziel {target}",
"supplementOfCountUnit": "von {n} {unit}",
Expand Down Expand Up @@ -4159,5 +4159,8 @@
"activitySummaryUploadStrava": "Auf Strava hochladen",
"activitySummaryExportGpx": "GPX exportieren",
"settingsWorkoutMapRowTitle": "Karte bei Workouts",
"settingsWorkoutMapRowSub": "Aus zeigt nur, wo das Workout begann"
"settingsWorkoutMapRowSub": "Aus zeigt nur, wo das Workout begann",
"activityPackWeight": "Rucksackgewicht",
"activityLoadShare": "{pct} % deines Körpergewichts",
"activityMachineDistanceHint": "Vom Laufband abgelesen, von dir eingegeben"
}
17 changes: 17 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -18889,5 +18889,22 @@
"settingsWorkoutMapRowSub": "Off shows only where the workout started",
"@settingsWorkoutMapRowSub": {
"description": "Subtitle under the Map on workouts settings row"
},
"activityPackWeight": "Pack weight",
"@activityPackWeight": {
"description": "Label for the weight carried on a ruck: the stepper on the setup screen and the card on the finished workout"
},
"activityLoadShare": "{pct}% of your body weight",
"@activityLoadShare": {
"description": "Caption under the pack weight on a finished ruck: the pack as a share of the body weight banked with that session",
"placeholders": {
"pct": {
"type": "int"
}
}
},
"activityMachineDistanceHint": "Read off the treadmill, entered by you",
"@activityMachineDistanceHint": {
"description": "Line under Distance on a finished treadmill ruck: the figure is what the machine displayed, typed in by the user, not measured by the app"
}
}
7 changes: 5 additions & 2 deletions lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3348,7 +3348,7 @@
"activityEditWorkout": "Editar entrenamiento",
"activityNapAlerts": "Siestas detectadas",
"activityPushHint": "Solo notificaciones push. Las sugerencias siguen en Actividades detectadas.",
"activityCatalogueName": "{key, select, kcardio{Cardio} kstrength{Fuerza} ksports{Deportes} kathletics{Atletismo} koutdoor{Aire libre} kmindbody{Cuerpo y mente} keveryday{Día a día} kother{Otros} krunning{Carrera} ktrailrunning{Trail running} kwalking{Caminata} khiking{Senderismo} kcycling{Ciclismo} kindoorbike{Bicicleta estática} krowing{Remo} kswimming{Natación} kelliptical{Elíptica} kstairclimber{Escaladora} ktreadmill{Cinta de correr} kjumprope{Saltar la cuerda} kweighttraining{Entrenamiento con pesas} kpowerlifting{Powerlifting} kbodyweight{Peso corporal} kcalisthenics{Calistenia} kkettlebell{Kettlebell} kcrossfit{CrossFit} khiit{HIIT} kcircuittraining{Entrenamiento en circuito} kfunctional{Entrenamiento funcional} kfootball{Fútbol} kbasketball{Baloncesto} kcricket{Críquet} ktennis{Tenis} kbadminton{Bádminton} ktabletennis{Tenis de mesa} ksquash{Squash} kpadel{Pádel} kvolleyball{Voleibol} khockey{Hockey} kbaseball{Béisbol} krugby{Rugby} kgolf{Golf} kbowling{Bolos} kboxing{Boxeo} kmartialarts{Artes marciales} kwrestling{Lucha} kclimbing{Escalada} ksprinting{Esprint} ktrackintervals{Series en pista} kcrosscountry{Campo a través} khurdles{Vallas} klongjump{Salto de longitud} kshotput{Lanzamiento de peso} kjavelin{Lanzamiento de jabalina} kpolevault{Salto con pértiga} kmountainbiking{Ciclismo de montaña} kkayaking{Kayak} ksurfing{Surf} kpaddleboard{Paddle surf} kskiing{Esquí} ksnowboarding{Snowboard} kskating{Patinaje} kskateboarding{Skateboarding} khorseriding{Equitación} kyoga{Yoga} kpilates{Pilates} kstretching{Estiramientos} kmobility{Movilidad} ktaichi{Taichí} kbreathwork{Ejercicios de respiración} kmeditation{Meditación} khousework{Tareas del hogar} kgardening{Jardinería} kdogwalking{Pasear al perro} kchildcare{Cuidado de niños} kdiy{Bricolaje} kshopping{Compras} kstairs{Escaleras} kgeneralworkout{Entrenamiento general} kdancing{Baile} kintimacy{Intimidad} kphysiotherapy{Fisioterapia} ksauna{Sauna} kcoldplunge{Baño frío} other{{name}}}",
"activityCatalogueName": "{key, select, kcardio{Cardio} kstrength{Fuerza} ksports{Deportes} kathletics{Atletismo} koutdoor{Aire libre} kmindbody{Cuerpo y mente} keveryday{Día a día} kother{Otros} krunning{Carrera} ktrailrunning{Trail running} kwalking{Caminata} khiking{Senderismo} krucking{Rucking} kcycling{Ciclismo} kindoorbike{Bicicleta estática} krowing{Remo} kswimming{Natación} kelliptical{Elíptica} kstairclimber{Escaladora} ktreadmill{Cinta de correr} ktreadmillruck{Rucking en cinta} kjumprope{Saltar la cuerda} kweighttraining{Entrenamiento con pesas} kpowerlifting{Powerlifting} kbodyweight{Peso corporal} kcalisthenics{Calistenia} kkettlebell{Kettlebell} kcrossfit{CrossFit} khiit{HIIT} kcircuittraining{Entrenamiento en circuito} kfunctional{Entrenamiento funcional} kfootball{Fútbol} kbasketball{Baloncesto} kcricket{Críquet} ktennis{Tenis} kbadminton{Bádminton} ktabletennis{Tenis de mesa} ksquash{Squash} kpadel{Pádel} kvolleyball{Voleibol} khockey{Hockey} kbaseball{Béisbol} krugby{Rugby} kgolf{Golf} kbowling{Bolos} kboxing{Boxeo} kmartialarts{Artes marciales} kwrestling{Lucha} kclimbing{Escalada} ksprinting{Esprint} ktrackintervals{Series en pista} kcrosscountry{Campo a través} khurdles{Vallas} klongjump{Salto de longitud} kshotput{Lanzamiento de peso} kjavelin{Lanzamiento de jabalina} kpolevault{Salto con pértiga} kmountainbiking{Ciclismo de montaña} kkayaking{Kayak} ksurfing{Surf} kpaddleboard{Paddle surf} kskiing{Esquí} ksnowboarding{Snowboard} kskating{Patinaje} kskateboarding{Skateboarding} khorseriding{Equitación} kyoga{Yoga} kpilates{Pilates} kstretching{Estiramientos} kmobility{Movilidad} ktaichi{Taichí} kbreathwork{Ejercicios de respiración} kmeditation{Meditación} khousework{Tareas del hogar} kgardening{Jardinería} kdogwalking{Pasear al perro} kchildcare{Cuidado de niños} kdiy{Bricolaje} kshopping{Compras} kstairs{Escaleras} kgeneralworkout{Entrenamiento general} kdancing{Baile} kintimacy{Intimidad} kphysiotherapy{Fisioterapia} ksauna{Sauna} kcoldplunge{Baño frío} other{{name}}}",
"exerciseCatalogueName": "{key, select, other{{name}}}",
"presentationBluetoothHeartRateSensor": "Sensor de frecuencia cardíaca Bluetooth",
"presentationGarminWatch": "Reloj Garmin",
Expand Down Expand Up @@ -4159,5 +4159,8 @@
"activitySummaryUploadStrava": "Subir a Strava",
"activitySummaryExportGpx": "Exportar GPX",
"settingsWorkoutMapRowTitle": "Mapa en entrenamientos",
"settingsWorkoutMapRowSub": "Desactivado muestra solo dónde empezó el entrenamiento"
"settingsWorkoutMapRowSub": "Desactivado muestra solo dónde empezó el entrenamiento",
"activityPackWeight": "Peso de la mochila",
"activityLoadShare": "{pct} % de tu peso corporal",
"activityMachineDistanceHint": "Leída en la cinta, introducida por ti"
}
Loading