@foreach (var entry in RunEntries)
{
-
-
-
diff --git a/src/ASTRAIN.Client/Pages/Routines.razor.cs b/src/ASTRAIN.Client/Pages/Routines.razor.cs
index 4cd8432..fe91bb0 100644
--- a/src/ASTRAIN.Client/Pages/Routines.razor.cs
+++ b/src/ASTRAIN.Client/Pages/Routines.razor.cs
@@ -32,6 +32,42 @@ public partial class Routines
private RoutineDto? ActiveRun { get; set; }
private List
RunEntries { get; set; } = new();
+ ///
+ /// Available weight options for the routine run select input.
+ /// 10–40 kg in 2.5 kg steps, then 40–100 kg in 5 kg steps.
+ ///
+ private static readonly List WeightOptions = BuildWeightOptions();
+
+ ///
+ /// Builds the list of available weight options for the routine run select input.
+ ///
+ /// A list of double values representing weight options.
+ private static List BuildWeightOptions()
+ {
+ var options = new List();
+ for (var w = 10.0; w <= 40.0; w += 2.5)
+ {
+ options.Add(w);
+ }
+
+ for (var w = 45.0; w <= 100.0; w += 5.0)
+ {
+ options.Add(w);
+ }
+
+ return options;
+ }
+
+ ///
+ /// Snaps a weight value to the nearest available option.
+ ///
+ /// The weight value to snap to the nearest option.
+ /// The nearest available weight option.
+ private static double SnapToNearest(double weight)
+ {
+ return WeightOptions.OrderBy(w => Math.Abs(w - weight)).First();
+ }
+
///
protected override async Task OnInitializedAsync()
{
@@ -197,7 +233,7 @@ public partial class Routines
.Select(e =>
{
var last = lastRun.Entries.FirstOrDefault(x => x.ExerciseId == e.ExerciseId);
- return new RoutineRunEntryDto(e.ExerciseId, last?.Weight ?? 0, false);
+ return new RoutineRunEntryDto(e.ExerciseId, SnapToNearest(last?.Weight ?? WeightOptions[0]), false);
}).ToList();
}
diff --git a/src/ASTRAIN.Client/wwwroot/css/app.css b/src/ASTRAIN.Client/wwwroot/css/app.css
index af2220f..f5331d1 100644
--- a/src/ASTRAIN.Client/wwwroot/css/app.css
+++ b/src/ASTRAIN.Client/wwwroot/css/app.css
@@ -91,6 +91,8 @@ p {
.input-sm {
max-width: 110px;
+ appearance: none;
+ -webkit-appearance: none;
}
.primary {
@@ -173,6 +175,13 @@ p {
font-weight: 600;
}
+.item-actions {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ margin-left: auto;
+}
+
.item-subtitle {
color: #bdbdbd;
font-size: 0.85rem;