Dedup Garmin data storage, configurable chart colors, taxonomy fixes, sync/progression fixes
- Remove duplicated Garmin fields from storage; decode display-only fields (activity name/type, lap duration/HR, structured workout raw JSON) from RawJSON at API-response time instead of storing redundant columns - Add a fully configurable chart color system (pace/HR main-line colors, 4 effort-kind colors, tint/darken/brighten intensity knobs) under Profile > Chart colors - Rename training types and fix their display order (Easy, Long, 60'/30' Threshold, Tempo, Intervals, MAS Test, Race) everywhere they're listed - Add an Efficiency Factor progression metric; fix Progression chart axes to use tight non-zero-based domains, m:ss/km pace formatting, and rounded ticks instead of raw floating-point labels - Expose the raw get_workout_by_id() payload in the raw-data viewer alongside activity/lap/detail JSON; enlarge the modal and shrink array indentation for readability - Fix "last sync" reporting a meaningless activity count: record one combined sync run per manual "Sync now" and count genuinely new activities instead of re-listing whatever Garmin returned for the queried window - Let a Review Queue activity be manually cleared back to Unclassified, and make "Reset all" available even while disconnected from Garmin Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,8 +28,32 @@ func TestProfile_DefaultsThenUpdate(t *testing.T) {
|
||||
if p.MinRepresentativePaceSecPerKm != 720 || p.MinRepresentativeTimeSeconds != 3 {
|
||||
t.Errorf("pace artifact filter defaults = %+v, want pace=720, time=3", p)
|
||||
}
|
||||
if p.Name != "Default" {
|
||||
t.Errorf("Name = %q, want %q (migration default)", p.Name, "Default")
|
||||
}
|
||||
if p.PaceColor != "#3b82f6" || p.HeartRateColor != "#ef4444" {
|
||||
t.Errorf("main line color defaults = %+v, want pace=#3b82f6, heartRate=#ef4444", p)
|
||||
}
|
||||
if p.WarmupColor != "#c2410c" || p.EffortColor != "#7c3aed" || p.RecoveryColor != "#15803d" || p.CooldownColor != "#fb923c" {
|
||||
t.Errorf("effort color defaults = %+v", p)
|
||||
}
|
||||
if p.MainLineTintPct != 20 {
|
||||
t.Errorf("MainLineTintPct = %v, want 20 (migration default)", p.MainLineTintPct)
|
||||
}
|
||||
if p.BackgroundDarkenPct != 35 {
|
||||
t.Errorf("BackgroundDarkenPct = %v, want 35 (migration default)", p.BackgroundDarkenPct)
|
||||
}
|
||||
if p.TargetBrightenPct != 20 {
|
||||
t.Errorf("TargetBrightenPct = %v, want 20 (migration default)", p.TargetBrightenPct)
|
||||
}
|
||||
|
||||
maxHR, restingHR := 190.0, 50.0
|
||||
p.Name = "Kriss"
|
||||
p.PaceColor = "#111111"
|
||||
p.EffortColor = "#222222"
|
||||
p.MainLineTintPct = 45
|
||||
p.BackgroundDarkenPct = 60
|
||||
p.TargetBrightenPct = 50
|
||||
p.GarminEmail = "runner@example.com"
|
||||
p.GarminPassword = "hunter2"
|
||||
p.RollingWindowDays = 120
|
||||
@@ -51,6 +75,9 @@ func TestProfile_DefaultsThenUpdate(t *testing.T) {
|
||||
if got.GarminEmail != "runner@example.com" || got.RollingWindowDays != 120 {
|
||||
t.Errorf("got = %+v, want updated email/window", got)
|
||||
}
|
||||
if got.Name != "Kriss" {
|
||||
t.Errorf("Name = %q, want %q after update", got.Name, "Kriss")
|
||||
}
|
||||
if got.MaxHeartRate == nil || *got.MaxHeartRate != 190 {
|
||||
t.Errorf("MaxHeartRate = %v, want 190", got.MaxHeartRate)
|
||||
}
|
||||
@@ -63,4 +90,16 @@ func TestProfile_DefaultsThenUpdate(t *testing.T) {
|
||||
if got.MinRepresentativePaceSecPerKm != 600 || got.MinRepresentativeTimeSeconds != 5 {
|
||||
t.Errorf("pace artifact filter after update = %+v, want pace=600, time=5", got)
|
||||
}
|
||||
if got.PaceColor != "#111111" || got.EffortColor != "#222222" {
|
||||
t.Errorf("chart colors after update = %+v, want pace=#111111, effort=#222222", got)
|
||||
}
|
||||
if got.MainLineTintPct != 45 {
|
||||
t.Errorf("MainLineTintPct after update = %v, want 45", got.MainLineTintPct)
|
||||
}
|
||||
if got.BackgroundDarkenPct != 60 {
|
||||
t.Errorf("BackgroundDarkenPct after update = %v, want 60", got.BackgroundDarkenPct)
|
||||
}
|
||||
if got.TargetBrightenPct != 50 {
|
||||
t.Errorf("TargetBrightenPct after update = %v, want 50", got.TargetBrightenPct)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user