[habit][library] Habit: the local day with rollover, days read, the forgiving weekly streak, the reminder schedule, medals as a pure function of the log; sessions carry their UTC offset

This commit is contained in:
2026-11-17 11:58:09 +01:00
parent b9462af39f
commit 9a2ba174ce
15 changed files with 822 additions and 9 deletions
+7
View File
@@ -177,11 +177,18 @@ pub fn ops_from(lib: &Library) -> Vec<Op> {
active_ms: s.active_ms,
pages: s.pages,
date: s.date.clone(),
offset_min: s.offset_min,
});
}
for g in lib.goals.values() {
ops.push(Op::Goal { year: g.year, kind: g.kind, target: g.target });
}
if let Some(h) = lib.habit {
ops.push(Op::HabitGoal { goal: h });
}
for m in &lib.medals_seen {
ops.push(Op::MedalSeen { medal: m.clone() });
}
ops
}