Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Settings: Fixed Week switches like Plan's, at once with nothing running and with Plan's words otherwise

Duarte Santosf8b6d4d873c8
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index 448876de9..bbf22ed40 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -1738,8 +1738,6 @@ export default {
'Start pass': 'بدء الدورة',
'This rotation couldn’t be read. Another device may have written it.': 'تعذّرت قراءة هذا التناوب. ربما كتبه جهاز آخر.',
'Discard it': 'التخلص منه',
- 'Switch to Fixed Week?': 'التبديل إلى الأسبوع الثابت؟',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'يتوقف التناوب وتُلغى دورته الحالية. تبقى خطتك الأسبوعية دون تغيير، ويُحتفظ بالتسلسل حتى تتمكن من بدء دورة جديدة لاحقًا.',
'Use Fixed Week': 'استخدام الأسبوع الثابت',
'No rotation yet. Add routines to it in Plan.': 'لا يوجد تناوب بعد. أضِف الروتينات إليه من الخطة.',
'Set up in Plan': 'الإعداد في الخطة',
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index faa334552..bc354f7b3 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -1705,8 +1705,6 @@ export default {
'Start pass': 'Durchgang starten',
'This rotation couldn’t be read. Another device may have written it.': 'Diese Rotation konnte nicht gelesen werden. Möglicherweise hat ein anderes Gerät sie geschrieben.',
'Discard it': 'Verwerfen',
- 'Switch to Fixed Week?': 'Zu Feste Woche wechseln?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'Die Rotation stoppt und ihr aktueller Durchgang wird verworfen. Dein Wochenplan bleibt unangetastet, und die Reihenfolge bleibt gespeichert, damit du später einen neuen Durchgang starten kannst.',
'Use Fixed Week': 'Feste Woche verwenden',
'No rotation yet. Add routines to it in Plan.': 'Noch keine Rotation. Füge im Plan Routinen hinzu.',
'Set up in Plan': 'Im Plan einrichten',
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 054943067..2cf092ff0 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'Iniciar pasada',
'This rotation couldn’t be read. Another device may have written it.': 'No se pudo leer esta rotación. Puede que la haya escrito otro dispositivo.',
'Discard it': 'Descartarla',
- 'Switch to Fixed Week?': '¿Cambiar a Semana fija?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'La rotación se detiene y su pasada actual se descarta. Tu plan semanal no se toca, y la secuencia se guarda para que puedas iniciar una nueva pasada más adelante.',
'Use Fixed Week': 'Usar Semana fija',
'No rotation yet. Add routines to it in Plan.': 'Aún no hay rotación. Añade rutinas en el Plan.',
'Set up in Plan': 'Configurar en el Plan',
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index cefe6e8f0..7b4720efe 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'Démarrer un passage',
'This rotation couldn’t be read. Another device may have written it.': 'Cette rotation n’a pas pu être lue. Un autre appareil l’a peut-être écrite.',
'Discard it': 'L’abandonner',
- 'Switch to Fixed Week?': 'Passer à Semaine fixe ?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'La rotation s’arrête et son passage en cours est abandonné. Ton planning hebdomadaire reste intact, et la séquence est conservée pour démarrer un nouveau passage plus tard.',
'Use Fixed Week': 'Utiliser Semaine fixe',
'No rotation yet. Add routines to it in Plan.': 'Aucune rotation pour l’instant. Ajoute des routines dans le Plan.',
'Set up in Plan': 'Configurer dans le Plan',
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index dc52e4c58..8f4992a56 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'पास शुरू करें',
'This rotation couldn’t be read. Another device may have written it.': 'यह रोटेशन पढ़ा नहीं जा सका। हो सकता है इसे किसी दूसरे डिवाइस ने लिखा हो।',
'Discard it': 'इसे हटा दें',
- 'Switch to Fixed Week?': 'नियत सप्ताह पर स्विच करें?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'रोटेशन रुक जाता है और उसका मौजूदा पास हटा दिया जाता है। आपकी साप्ताहिक योजना अछूती रहती है, और क्रम सुरक्षित रहता है ताकि आप बाद में नया पास शुरू कर सकें।',
'Use Fixed Week': 'नियत सप्ताह का उपयोग करें',
'No rotation yet. Add routines to it in Plan.': 'अभी कोई रोटेशन नहीं। योजना में इसमें रूटीन जोड़ें।',
'Set up in Plan': 'योजना में सेट करें',
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index 29e1cf17a..67bd4b16c 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -1688,8 +1688,6 @@ export default {
'Start pass': 'Menet indítása',
'This rotation couldn’t be read. Another device may have written it.': 'Ezt a rotációt nem sikerült beolvasni. Lehet, hogy egy másik eszköz írta.',
'Discard it': 'Elvetése',
- 'Switch to Fixed Week?': 'Átváltasz Fix hétre?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'A rotáció leáll, és a jelenlegi menete elvész. A heti terved érintetlen marad, és a sorrend megmarad, hogy később új menetet indíthass.',
'Use Fixed Week': 'Fix hét használata',
'No rotation yet. Add routines to it in Plan.': 'Még nincs rotáció. Adj hozzá rutinokat a Tervben.',
'Set up in Plan': 'Beállítás a Tervben',
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index ab2682a23..1527045b7 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'Avvia giro',
'This rotation couldn’t be read. Another device may have written it.': 'Questa rotazione non può essere letta. Potrebbe averla scritta un altro dispositivo.',
'Discard it': 'Scartala',
- 'Switch to Fixed Week?': 'Passare a Settimana fissa?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'La rotazione si ferma e il giro attuale viene scartato. Il tuo piano settimanale resta intatto, e la sequenza viene mantenuta così puoi avviare un nuovo giro più avanti.',
'Use Fixed Week': 'Usa Settimana fissa',
'No rotation yet. Add routines to it in Plan.': 'Ancora nessuna rotazione. Aggiungi routine nel Piano.',
'Set up in Plan': 'Configura nel Piano',
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index e17261279..5938cfc1d 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': '패스 시작',
'This rotation couldn’t be read. Another device may have written it.': '이 로테이션을 읽을 수 없어요. 다른 기기에서 작성했을 수 있어요.',
'Discard it': '삭제하기',
- 'Switch to Fixed Week?': '고정 주간으로 전환할까요?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': '로테이션이 멈추고 현재 패스는 삭제돼요. 주간 계획은 그대로 유지되고, 순서는 저장되어 나중에 새 패스를 시작할 수 있어요.',
'Use Fixed Week': '고정 주간 사용',
'No rotation yet. Add routines to it in Plan.': '아직 로테이션이 없어요. 계획에서 루틴을 추가하세요.',
'Set up in Plan': '계획에서 설정',
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index bef53af8d..82bdd8034 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'Rozpocznij przejście',
'This rotation couldn’t be read. Another device may have written it.': 'Nie udało się odczytać tej rotacji. Mogło ją zapisać inne urządzenie.',
'Discard it': 'Odrzuć ją',
- 'Switch to Fixed Week?': 'Przełączyć na Stały tydzień?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'Rotacja zatrzymuje się, a jej bieżące przejście zostaje odrzucone. Twój plan tygodnia pozostaje nietknięty, a kolejność zostaje zapisana, aby można było później rozpocząć nowe przejście.',
'Use Fixed Week': 'Użyj Stałego tygodnia',
'No rotation yet. Add routines to it in Plan.': 'Brak rotacji. Dodaj do niej plany w Planie.',
'Set up in Plan': 'Skonfiguruj w Planie',
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index f3c529789..2ab6540cd 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -1045,8 +1045,6 @@ export const PT_BR_OVERRIDES = {
'Start pass': 'Iniciar passagem',
'This rotation couldn’t be read. Another device may have written it.': 'Não foi possível ler esta rotação. Talvez outro dispositivo tenha gravado ela.',
'Discard it': 'Descartar',
- 'Switch to Fixed Week?': 'Mudar para Semana fixa?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'A rotação para e a passagem atual é descartada. Seu plano semanal fica intocado, e a sequência é salva para que você possa iniciar uma nova passagem mais tarde.',
'Use Fixed Week': 'Usar Semana fixa',
'No rotation yet. Add routines to it in Plan.': 'Ainda sem rotação. Adicione rotinas no Plano.',
'Set up in Plan': 'Configurar no Plano',
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index 26eef1d50..ad540651d 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'Iniciar passagem',
'This rotation couldn’t be read. Another device may have written it.': 'Não foi possível ler esta rotação. Pode ter sido escrita por outro dispositivo.',
'Discard it': 'Descartá-la',
- 'Switch to Fixed Week?': 'Mudar para Semana fixa?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'A rotação para e a passagem atual é descartada. O teu plano semanal fica intocado, e a sequência é guardada para poderes iniciar uma nova passagem mais tarde.',
'Use Fixed Week': 'Usar Semana fixa',
'No rotation yet. Add routines to it in Plan.': 'Ainda sem rotação. Adiciona rotinas no Plano.',
'Set up in Plan': 'Configurar no Plano',
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index d889039eb..ed4bd77a6 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -1641,8 +1641,6 @@ export default {
'Start pass': 'Начать проход',
'This rotation couldn’t be read. Another device may have written it.': 'Не удалось прочитать эту ротацию. Возможно, она была записана с другого устройства.',
'Discard it': 'Отменить её',
- 'Switch to Fixed Week?': 'Переключиться на фиксированную неделю?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'Ротация останавливается, и текущий проход отменяется. Твой недельный план остаётся нетронутым, а последовательность сохраняется, чтобы позже начать новый проход.',
'Use Fixed Week': 'Использовать фиксированную неделю',
'No rotation yet. Add routines to it in Plan.': 'Ротации пока нет. Добавь в неё программы в разделе «План».',
'Set up in Plan': 'Настроить в Плане',
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index 77d60d2df..34d02b984 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -1696,8 +1696,6 @@ export default {
'Start pass': 'เริ่มรอบ',
'This rotation couldn’t be read. Another device may have written it.': 'อ่านการหมุนเวียนนี้ไม่ได้ อาจถูกเขียนมาจากอุปกรณ์อื่น',
'Discard it': 'ทิ้งไป',
- 'Switch to Fixed Week?': 'เปลี่ยนเป็นสัปดาห์คงที่?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'การหมุนเวียนจะหยุด และรอบปัจจุบันจะถูกยกเลิก แผนรายสัปดาห์ของคุณจะไม่ถูกแตะต้องเลย และลำดับจะถูกเก็บไว้เพื่อเริ่มรอบใหม่ได้ในภายหลัง',
'Use Fixed Week': 'ใช้สัปดาห์คงที่',
'No rotation yet. Add routines to it in Plan.': 'ยังไม่มีการหมุนเวียน เพิ่มรูทีนได้ในแผน',
'Set up in Plan': 'ตั้งค่าในแผน',
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index 6daacf677..4db92300b 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': 'Tur başlat',
'This rotation couldn’t be read. Another device may have written it.': 'Bu rotasyon okunamadı. Başka bir cihaz yazmış olabilir.',
'Discard it': 'Sil',
- 'Switch to Fixed Week?': 'Sabit Haftaya geçilsin mi?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'Rotasyon durur ve mevcut turu silinir. Haftalık planın hiç etkilenmez ve sıralama daha sonra yeni bir tur başlatabilmen için saklanır.',
'Use Fixed Week': 'Sabit Haftayı kullan',
'No rotation yet. Add routines to it in Plan.': 'Henüz rotasyon yok. Plan’da rutin ekle.',
'Set up in Plan': "Plan'da ayarla",
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index 3697e4582..4fe89a6a1 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -1682,8 +1682,6 @@ export default {
'Start pass': 'Почати цикл',
'This rotation couldn’t be read. Another device may have written it.': 'Не вдалося прочитати цю ротацію. Можливо, її записав інший пристрій.',
'Discard it': 'Скасувати її',
- 'Switch to Fixed Week?': 'Перейти на фіксований тиждень?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': 'Ротація зупиниться, а її поточний цикл буде скасовано. Твій тижневий план не зміниться, а послідовність збережеться, тож пізніше можна буде почати новий цикл.',
'Use Fixed Week': 'Використати фіксований тиждень',
'No rotation yet. Add routines to it in Plan.': 'Ротації поки немає. Додай до неї програми в Плані.',
'Set up in Plan': 'Налаштувати в Плані',
diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js
index ddafd484d..5feb5da76 100644
--- a/frontend/src/locales/zh-TW.js
+++ b/frontend/src/locales/zh-TW.js
@@ -1658,8 +1658,6 @@ export default {
'Start pass': '開始這一輪',
'This rotation couldn’t be read. Another device may have written it.': '無法讀取這個輪替。可能是另一台裝置寫入的。',
'Discard it': '捨棄它',
- 'Switch to Fixed Week?': '要切換到固定週嗎?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': '輪替會停止,目前這一輪會被捨棄。你的每週計畫不受影響,順序也會保留,之後可以再開始新一輪。',
'Use Fixed Week': '使用固定週',
'No rotation yet. Add routines to it in Plan.': '尚未建立輪替。請在「計畫」中加入課表。',
'Set up in Plan': '在「計畫」中設定',
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index a1219e2ba..dd21cbed3 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -1685,8 +1685,6 @@ export default {
'Start pass': '开始一轮',
'This rotation couldn’t be read. Another device may have written it.': '无法读取此轮换。可能是另一台设备写入的。',
'Discard it': '丢弃它',
- 'Switch to Fixed Week?': '切换到固定周?',
- 'The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.': '轮换会停止,当前这一轮会被丢弃。你的每周计划不会受到影响,顺序会被保留,方便你以后重新开始新一轮。',
'Use Fixed Week': '使用固定周',
'No rotation yet. Add routines to it in Plan.': '还没有轮换。在计划中添加训练日。',
'Set up in Plan': '在计划中设置',
diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsx
index 3b4985374..7d9f01d38 100644
--- a/frontend/src/views/Settings.jsx
+++ b/frontend/src/views/Settings.jsx
@@ -117,15 +117,17 @@ export default function Settings({ page = null, find = null }) {
// written by a planner switches the app to Rotation on its own — but choosing Rotation with
// nothing built yet has no queue to derive from, so S.scheduleMode is what keeps it selected
// (and the weekday grid hidden, on both Home and Plan) until the first routine is added.
- // Fixed Week stops the pass but keeps the sequence for a later fresh pass.
+ // Fixed Week behaves as on Plan (views/Plan.jsx setMode), with the same words: with no loop
+ // running there is nothing to lose and it switches at once; a running loop asks first.
const setScheduleMode = v => {
if (v === scheduleModeOf(S)) return
if (v === 'week') {
// A planner's own queue is never this app's to drop — this control is text-only while one
// is live (below), but the guard stays here too rather than trust the render alone.
+ if (!liveQ) { update(s => { chooseFixedWeek(s) }); return }
confirmSheet({
- title: t('Switch to Fixed Week?'),
- message: t('The rotation stops and its current pass is dropped. Your weekday plan is untouched, and the sequence is kept so you can start a new pass later.'),
+ title: t('Back to a fixed week?'),
+ message: t('The loop stops. Your weekdays stay as they are, and the loop is saved for later.'),
confirmText: t('Use Fixed Week'),
onConfirm: () => update(s => { chooseFixedWeek(s) }),
})
diff --git a/frontend/src/views/Settings.schedule.test.jsx b/frontend/src/views/Settings.schedule.test.jsx
index d10faf7d5..5fdc62ffe 100644
--- a/frontend/src/views/Settings.schedule.test.jsx
+++ b/frontend/src/views/Settings.schedule.test.jsx
@@ -109,6 +109,7 @@ describe('Settings — How you train (Plan & schedule)', () => {
})
pick('Fixed Week')
expect(mocks.S.queue).not.toBe(null) // nothing happens before the confirmation
+ expect(confirmSheet.mock.calls[0][0]).toMatchObject({ title: 'Back to a fixed week?', confirmText: 'Use Fixed Week' }) // Plan's words
act(() => confirmSheet.mock.calls[0][0].onConfirm())
expect(mocks.S.queue).toBe(null)
expect(mocks.S.scheduleMode).toBe('week')
@@ -117,6 +118,13 @@ describe('Settings — How you train (Plan & schedule)', () => {
expect(mocks.S.dayPlan).toEqual({ '2020-01-01': 'b' }) // today's pin swept; the past one is not this pass's business
})
+ it('Fixed Week with nothing running switches at once, as on Plan', () => {
+ mount({ scheduleMode: 'rotation' })
+ pick('Fixed Week')
+ expect(confirmSheet).not.toHaveBeenCalled()
+ expect(mocks.S.scheduleMode).toBe('week')
+ })
+
it('Rotation starts a fresh pass from the saved sequence', () => {
mount({ rotation: { id: 'r1', sequence: ['a', 'b'], label: 'My split' } })
pick('Rotation')