diff --git a/frontend/js/logic/set.js b/frontend/js/logic/set.js
index faddb3c..95905c6 100644
--- a/frontend/js/logic/set.js
+++ b/frontend/js/logic/set.js
@@ -22,7 +22,7 @@ export function addSet(workoutId, exerciseId) {
w.id
);
- showSetDialog(lastSet, history, (setData) => {
+ showSetDialog(null, history, (setData) => {
if (!setData) return;
setData.id = genId();
@@ -32,6 +32,9 @@ export function addSet(workoutId, exerciseId) {
saveState();
renderMainScreen();
+ }, {
+ prefill: lastSet,
+ historyLabel: ex.name,
});
}
@@ -62,7 +65,7 @@ export function editSet(workoutId, exerciseId, setId) {
saveState();
renderMainScreen();
- });
+ }, { historyLabel: ex.name });
}
export function deleteSet(workoutId, exerciseId, setId) {
diff --git a/frontend/js/modals/cardio-modal.js b/frontend/js/modals/cardio-modal.js
index 6f15317..5919bc1 100644
--- a/frontend/js/modals/cardio-modal.js
+++ b/frontend/js/modals/cardio-modal.js
@@ -1,19 +1,30 @@
import { showModal, closeModal, stepperHtml } from './modal-base.js';
+import { state } from '../state.js';
let _cb = null;
export function showCardioDialog(existing, callback) {
_cb = callback;
const e = existing || {};
+ const types = [
+ ['вело', '🚴 Вело'],
+ ['ходьба', '🚶 Ходьба'],
+ ['бег', '🏃 Бег'],
+ ['эллипс', '⚡ Эллипс'],
+ ['гребля', '🚣 Гребля'],
+ ];
+ // Популярные типы — выше: считаем, сколько раз каждый уже использовался
+ const counts = {};
+ state.workouts.forEach(w => (w.cardio || []).forEach(c => {
+ counts[c.type] = (counts[c.type] || 0) + 1;
+ }));
+ const orderedTypes = [...types].sort((a, b) => (counts[b[0]] || 0) - (counts[a[0]] || 0));
+
showModal(`
${existing ? 'Редактировать' : 'Новое'} кардио