Read the walks list newest first too
Needed, on the evidence: the history log, the notes log, the weigh-in list and now sleep & wake all run newest first, so the walks list was the only one in the app reading the other way. A short list makes the inconsistency cheap rather than absent — two panels of the same rows in the same shape should not have to be checked for direction before they can be read. Reversed at the point of display rather than in walkWindowsForDay. Its other two callers — the day's total and the history rails — read the windows as a set, and giving a shared helper a display order would only make them harder to follow.
This commit is contained in:
+5
-1
@@ -1054,9 +1054,13 @@
|
||||
function renderWalks(events) {
|
||||
const day = selectedDay();
|
||||
const windows = walkWindowsForDay(events, day);
|
||||
// Newest first, like every other list in the app, so a walk in progress is
|
||||
// the first row. Reversed here rather than in walkWindowsForDay, whose
|
||||
// other callers — the day's total and the history rails — read the windows
|
||||
// as a set and would only be made harder to follow by a display order.
|
||||
renderWindowList(
|
||||
"walk-list", "walk-empty",
|
||||
windows,
|
||||
[...windows].reverse(),
|
||||
"Walking", "walk-ww",
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user