Merge !94: feat: add Upper/Lower, Full Body and 5×5 starter plans
# Conflicts: # frontend/src/lib/pt-br-locale.test.js
This commit is contained in:
commit
dfc63543ea
24 files changed
+626
-83
No files matched your search
@@ -1,13 +1,68 @@
|
||||
// The Push/Pull/Legs starter plan. Shared by the "Load starter plan" action in Settings
|
||||
// and by the demo build, which seeds a history on top of exactly these routines.
|
||||
// The starter-plan catalog. Training data only: the chooser's plan names and descriptions are
|
||||
// written as string literals inside t() calls in sheets.jsx, because check-source-strings.mjs
|
||||
// only finds them there — copy parked in here would silently ship English in every language.
|
||||
//
|
||||
// A routine is [key, name, emoji, [[exerciseId, sets, reps], …]]. The key is what a plan's
|
||||
// schedule points at, so a weekday never depends on the position of a routine in the array.
|
||||
// Names stay canonical English — they become ordinary user routines, which are not translated.
|
||||
import { uid } from './format.js'
|
||||
|
||||
const SPEC = [
|
||||
['Push Day', 'barbell', [['0025', 4, 8], ['0047', 3, 10], ['0426', 3, 10], ['0334', 3, 12], ['0241', 3, 12], ['0251', 3, 10]]],
|
||||
['Pull Day', 'pullup', [['2330', 4, 10], ['0027', 4, 8], ['1323', 3, 10], ['0031', 3, 10], ['0313', 3, 12]]],
|
||||
['Leg Day', 'legs', [['0043', 4, 8], ['0085', 3, 10], ['0739', 3, 12], ['0585', 3, 12], ['0586', 3, 12], ['0605', 4, 15]]]
|
||||
const PPL = [
|
||||
['push', 'Push Day', 'barbell', [['0025', 4, 8], ['0047', 3, 10], ['0426', 3, 10], ['0334', 3, 12], ['0241', 3, 12], ['0251', 3, 10]]],
|
||||
['pull', 'Pull Day', 'pullup', [['2330', 4, 10], ['0027', 4, 8], ['1323', 3, 10], ['0031', 3, 10], ['0313', 3, 12]]],
|
||||
['legs', 'Leg Day', 'legs', [['0043', 4, 8], ['0085', 3, 10], ['0739', 3, 12], ['0585', 3, 12], ['0586', 3, 12], ['0605', 4, 15]]]
|
||||
]
|
||||
|
||||
// Fresh routine objects (new ids) — [push, pull, legs].
|
||||
export const starterRoutines = () =>
|
||||
SPEC.map(([name, emoji, list]) => ({ id: uid(), name, emoji, ex: list.map(([id, sets, reps]) => ({ id, sets, reps, weight: 0 })) }))
|
||||
const UPPER_LOWER = [
|
||||
['upper-a', 'Upper A', 'barbell', [['0025', 3, 8], ['2330', 3, 10], ['0047', 2, 10], ['1323', 2, 10], ['0334', 2, 12], ['0241', 2, 12], ['0031', 2, 12]]],
|
||||
['lower-a', 'Lower A', 'legs', [['0043', 3, 8], ['0085', 3, 8], ['0739', 2, 10], ['0586', 2, 12], ['0605', 3, 15]]],
|
||||
['upper-b', 'Upper B', 'barbell', [['0047', 3, 8], ['0027', 3, 8], ['0426', 2, 10], ['2330', 2, 10], ['0334', 2, 12], ['0241', 2, 12], ['0313', 2, 12]]],
|
||||
['lower-b', 'Lower B', 'legs', [['0739', 3, 10], ['0085', 2, 10], ['0585', 2, 12], ['0586', 3, 12], ['0605', 3, 15]]]
|
||||
]
|
||||
|
||||
const FULL_BODY = [
|
||||
['fb-a', 'Full Body A', 'figureStrength', [['0043', 3, 8], ['0025', 3, 8], ['2330', 3, 10], ['0586', 3, 12], ['0334', 2, 12], ['0031', 2, 12]]],
|
||||
['fb-b', 'Full Body B', 'figureStrength', [['0085', 3, 8], ['0047', 3, 10], ['1323', 3, 10], ['0585', 3, 12], ['0334', 2, 12], ['0241', 2, 12]]],
|
||||
['fb-c', 'Full Body C', 'figureStrength', [['0739', 3, 10], ['0025', 2, 10], ['0027', 3, 10], ['0426', 2, 10], ['0586', 3, 12], ['0605', 3, 15]]]
|
||||
]
|
||||
|
||||
const FIVE_BY_FIVE = [
|
||||
['5x5-a', '5×5 A', 'barbell', [['0043', 5, 5], ['0025', 5, 5], ['0027', 5, 5]]],
|
||||
['5x5-b', '5×5 B', 'barbell', [['0085', 5, 5], ['0426', 5, 5], ['2330', 5, 5]]],
|
||||
['5x5-c', '5×5 C', 'barbell', [['0739', 5, 5], ['0047', 5, 5], ['1323', 5, 5]]]
|
||||
]
|
||||
|
||||
// [weekday, routineKey] — weekday is a DAYN index, so 1 is Monday. Fixed weeks only: every
|
||||
// plan repeats the same seven days, which is all the weekly plan model can represent.
|
||||
const PLANS = {
|
||||
ppl: { routines: PPL, schedule: [[1, 'push'], [3, 'pull'], [5, 'legs']] },
|
||||
'upper-lower': { routines: UPPER_LOWER, schedule: [[1, 'upper-a'], [2, 'lower-a'], [4, 'upper-b'], [5, 'lower-b']] },
|
||||
'full-body': { routines: FULL_BODY, schedule: [[1, 'fb-a'], [3, 'fb-b'], [5, 'fb-c']] },
|
||||
'5x5': { routines: FIVE_BY_FIVE, schedule: [[1, '5x5-a'], [3, '5x5-b'], [5, '5x5-c']] }
|
||||
}
|
||||
|
||||
const build = routines =>
|
||||
routines.map(([, name, emoji, list]) => ({ id: uid(), name, emoji, ex: list.map(([id, sets, reps]) => ({ id, sets, reps, weight: 0 })) }))
|
||||
|
||||
// Fresh routine objects (new ids) — [push, pull, legs]. The demo build seeds a history on
|
||||
// top of exactly these three, so this entry point keeps its shape.
|
||||
export const starterRoutines = () => build(PPL)
|
||||
|
||||
// [{ id, days }] for the chooser. The day count is read off the schedule rather than stored
|
||||
// beside it, so the two can never disagree.
|
||||
export const starterPlanOptions = () =>
|
||||
Object.entries(PLANS).map(([id, { schedule }]) => ({ id, days: schedule.length }))
|
||||
|
||||
// The weekdays a plan would claim, or null for an unknown id.
|
||||
export const starterPlanDays = id => PLANS[id]?.schedule.map(([day]) => day) ?? null
|
||||
|
||||
// Fresh routines plus the weekdays to put them on, or null for an unknown id — a caller that
|
||||
// treats null as "change nothing" can never half-apply a plan.
|
||||
export const buildStarterPlan = id => {
|
||||
const plan = PLANS[id]
|
||||
if (!plan) return null
|
||||
const routines = build(plan.routines)
|
||||
// key → the id just minted for it, so the schedule below names its routine
|
||||
const byKey = Object.fromEntries(plan.routines.map(([key], i) => [key, routines[i].id]))
|
||||
return { routines, schedule: plan.schedule.map(([day, key]) => ({ day, routineId: byKey[key] })) }
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { EXIDX } from './exercises.js'
|
||||
import { buildStarterPlan, starterPlanDays, starterPlanOptions, starterRoutines } from './starter.js'
|
||||
|
||||
// The approved prescription, written out again rather than imported: a test that reads the
|
||||
// same table as the code would pass no matter what that table said. [weekday, name, sets].
|
||||
const APPROVED = {
|
||||
ppl: [
|
||||
[1, 'Push Day', [['0025', 4, 8], ['0047', 3, 10], ['0426', 3, 10], ['0334', 3, 12], ['0241', 3, 12], ['0251', 3, 10]]],
|
||||
[3, 'Pull Day', [['2330', 4, 10], ['0027', 4, 8], ['1323', 3, 10], ['0031', 3, 10], ['0313', 3, 12]]],
|
||||
[5, 'Leg Day', [['0043', 4, 8], ['0085', 3, 10], ['0739', 3, 12], ['0585', 3, 12], ['0586', 3, 12], ['0605', 4, 15]]],
|
||||
],
|
||||
'upper-lower': [
|
||||
[1, 'Upper A', [['0025', 3, 8], ['2330', 3, 10], ['0047', 2, 10], ['1323', 2, 10], ['0334', 2, 12], ['0241', 2, 12], ['0031', 2, 12]]],
|
||||
[2, 'Lower A', [['0043', 3, 8], ['0085', 3, 8], ['0739', 2, 10], ['0586', 2, 12], ['0605', 3, 15]]],
|
||||
[4, 'Upper B', [['0047', 3, 8], ['0027', 3, 8], ['0426', 2, 10], ['2330', 2, 10], ['0334', 2, 12], ['0241', 2, 12], ['0313', 2, 12]]],
|
||||
[5, 'Lower B', [['0739', 3, 10], ['0085', 2, 10], ['0585', 2, 12], ['0586', 3, 12], ['0605', 3, 15]]],
|
||||
],
|
||||
'full-body': [
|
||||
[1, 'Full Body A', [['0043', 3, 8], ['0025', 3, 8], ['2330', 3, 10], ['0586', 3, 12], ['0334', 2, 12], ['0031', 2, 12]]],
|
||||
[3, 'Full Body B', [['0085', 3, 8], ['0047', 3, 10], ['1323', 3, 10], ['0585', 3, 12], ['0334', 2, 12], ['0241', 2, 12]]],
|
||||
[5, 'Full Body C', [['0739', 3, 10], ['0025', 2, 10], ['0027', 3, 10], ['0426', 2, 10], ['0586', 3, 12], ['0605', 3, 15]]],
|
||||
],
|
||||
'5x5': [
|
||||
[1, '5×5 A', [['0043', 5, 5], ['0025', 5, 5], ['0027', 5, 5]]],
|
||||
[3, '5×5 B', [['0085', 5, 5], ['0426', 5, 5], ['2330', 5, 5]]],
|
||||
[5, '5×5 C', [['0739', 5, 5], ['0047', 5, 5], ['1323', 5, 5]]],
|
||||
],
|
||||
}
|
||||
|
||||
const shape = r => r.ex.map(e => [e.id, e.sets, e.reps])
|
||||
|
||||
describe('starter plan catalog', () => {
|
||||
it('offers exactly the four plans, with the day count read off the schedule', () => {
|
||||
expect(starterPlanOptions()).toEqual([
|
||||
{ id: 'ppl', days: 3 }, { id: 'upper-lower', days: 4 },
|
||||
{ id: 'full-body', days: 3 }, { id: '5x5', days: 3 },
|
||||
])
|
||||
for (const { id, days } of starterPlanOptions()) expect(starterPlanDays(id)).toHaveLength(days)
|
||||
})
|
||||
|
||||
it('changes nothing for an unknown plan id', () => {
|
||||
expect(buildStarterPlan('nope')).toBeNull()
|
||||
expect(buildStarterPlan(undefined)).toBeNull()
|
||||
// A click handler wired straight to a loader would hand the event in as the plan.
|
||||
expect(buildStarterPlan({ type: 'click' })).toBeNull()
|
||||
expect(starterPlanDays('nope')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe.each(Object.keys(APPROVED))('%s', planId => {
|
||||
const approved = APPROVED[planId]
|
||||
|
||||
it('builds the approved exercises, sets and reps in order', () => {
|
||||
const { routines } = buildStarterPlan(planId)
|
||||
expect(routines.map(r => r.name)).toEqual(approved.map(([, name]) => name))
|
||||
routines.forEach((r, i) => expect(shape(r)).toEqual(approved[i][2]))
|
||||
})
|
||||
|
||||
it('puts each routine on its approved weekday, by identity not position', () => {
|
||||
const { routines, schedule } = buildStarterPlan(planId)
|
||||
const nameOf = Object.fromEntries(routines.map(r => [r.id, r.name]))
|
||||
expect(schedule.map(({ day, routineId }) => [day, nameOf[routineId]]))
|
||||
.toEqual(approved.map(([day, name]) => [day, name]))
|
||||
})
|
||||
|
||||
it('references only real exercises and starts every one at weight 0', () => {
|
||||
for (const r of buildStarterPlan(planId).routines) {
|
||||
for (const e of r.ex) {
|
||||
expect(EXIDX[e.id], e.id).toBeTruthy()
|
||||
expect(e.sets).toBeGreaterThan(0)
|
||||
expect(e.reps).toBeGreaterThan(0)
|
||||
expect(e.weight).toBe(0)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
it('mints fresh ids and independent objects on every build', () => {
|
||||
const first = buildStarterPlan(planId)
|
||||
const second = buildStarterPlan(planId)
|
||||
const ids = first.routines.map(r => r.id)
|
||||
expect(new Set(ids).size).toBe(ids.length)
|
||||
expect(second.routines.some(r => ids.includes(r.id))).toBe(false)
|
||||
expect(first.routines[0].ex[0]).not.toBe(second.routines[0].ex[0])
|
||||
// and the static definition survives a caller mutating what it got back
|
||||
first.routines[0].ex[0].sets = 99
|
||||
expect(buildStarterPlan(planId).routines[0].ex[0].sets).toBe(approved[0][2][0][1])
|
||||
})
|
||||
})
|
||||
|
||||
describe('starterRoutines (the demo build entry point)', () => {
|
||||
it('still returns push, pull and legs unchanged', () => {
|
||||
const routines = starterRoutines()
|
||||
expect(routines.map(r => r.name)).toEqual(['Push Day', 'Pull Day', 'Leg Day'])
|
||||
routines.forEach((r, i) => expect(shape(r)).toEqual(APPROVED.ppl[i][2]))
|
||||
expect(routines.map(r => r.emoji)).toEqual(['barbell', 'pullup', 'legs'])
|
||||
})
|
||||
|
||||
it('mints fresh ids on every invocation', () => {
|
||||
const first = starterRoutines().map(r => r.id)
|
||||
const second = starterRoutines().map(r => r.id)
|
||||
expect(new Set([...first, ...second]).size).toBe(6)
|
||||
})
|
||||
})
|
||||
@@ -217,8 +217,22 @@ export default {
|
||||
'{0} — in progress': '{0} — läuft',
|
||||
'Resume ▶': 'Weiter ▶',
|
||||
'Welcome!': 'Willkommen!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Richte deinen Wochenplan ein — oder lade einen fertigen Push-/Pull-/Beine-Plan.',
|
||||
'Load starter plan (PPL)': 'Starterplan laden (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Richte deinen Wochenplan ein — oder lade einen fertigen Starterplan.',
|
||||
'Load starter plan': 'Starterplan laden',
|
||||
'Choose starter plan': 'Starterplan wählen',
|
||||
'{0} days per week': '{0} Tage pro Woche',
|
||||
'{0} loaded': '{0} geladen',
|
||||
'Load {0}?': '{0} laden?',
|
||||
'Load plan': 'Plan laden',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Der neue Plan kommt auf {0}. Deine Routinen bleiben alle erhalten — nur diese Tage im Wochenplan ändern sich.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Beine',
|
||||
'Push, pull and legs each get their own day.': 'Drücken, Ziehen und Beine an je eigenen Tagen.',
|
||||
'Upper / Lower': 'Oberkörper / Unterkörper',
|
||||
'Upper body twice, lower body twice.': 'Oberkörper zweimal, Unterkörper zweimal.',
|
||||
'Full Body': 'Ganzkörper',
|
||||
'Three sessions, the whole body each time.': 'Drei Einheiten, jedes Mal der ganze Körper.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Fünf Sätze à fünf bei den großen Langhantelübungen.',
|
||||
'Build my own plan': 'Eigenen Plan erstellen',
|
||||
'{0} week streak': '{0} Wochen in Folge',
|
||||
'this week': 'diese Woche',
|
||||
@@ -245,7 +259,6 @@ export default {
|
||||
'Week schedule': 'Wochenplan',
|
||||
'No routines yet.': 'Noch keine Routinen.',
|
||||
'Create one or load the starter plan.': 'Erstelle eine oder lade den Starterplan.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Starterplan laden (Push / Pull / Beine)',
|
||||
// --- routine edit ---
|
||||
'Superset with exercise above': 'Supersatz mit der Übung darüber',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Notiz (optional) — Hinweise zur Belastung, z. B. „nur die Stange, dann pro Satz +1 Scheibe pro Seite“, was immer du dir merken willst',
|
||||
@@ -260,7 +273,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} Übungen mit Animationen',
|
||||
'Search…': 'Suchen…',
|
||||
'No workouts yet.': 'Noch keine Trainings.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Starterplan geladen — Mo Push · Mi Pull · Fr Beine',
|
||||
// --- login / account ---
|
||||
'Enter a name': 'Gib einen Namen ein',
|
||||
'Profile created — data from this device moved into it': 'Profil erstellt — Daten von diesem Gerät wurden übernommen',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — en curso',
|
||||
'Resume ▶': 'Seguir ▶',
|
||||
'Welcome!': '¡Bienvenido!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configura tu rutina semanal para empezar — o carga un plan Push / Pull / Piernas ya hecho.',
|
||||
'Load starter plan (PPL)': 'Cargar plan inicial (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Configura tu rutina semanal para empezar — o carga un plan inicial ya hecho.',
|
||||
'Load starter plan': 'Cargar plan inicial',
|
||||
'Choose starter plan': 'Elige un plan inicial',
|
||||
'{0} days per week': '{0} días por semana',
|
||||
'{0} loaded': '{0} cargado',
|
||||
'Load {0}?': '¿Cargar {0}?',
|
||||
'Load plan': 'Cargar plan',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'El nuevo plan se programará en {0}. Tus rutinas se conservan — solo cambian esos días del plan semanal.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Piernas',
|
||||
'Push, pull and legs each get their own day.': 'Empuje, tirón y piernas, cada uno en su día.',
|
||||
'Upper / Lower': 'Superior / Inferior',
|
||||
'Upper body twice, lower body twice.': 'Tren superior dos veces, tren inferior dos veces.',
|
||||
'Full Body': 'Cuerpo completo',
|
||||
'Three sessions, the whole body each time.': 'Tres sesiones, todo el cuerpo en cada una.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Cinco series de cinco en los básicos con barra.',
|
||||
'Build my own plan': 'Crear mi propio plan',
|
||||
'{0} week streak': 'racha de {0} semanas',
|
||||
'this week': 'esta semana',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Horario semanal',
|
||||
'No routines yet.': 'Aún no hay rutinas.',
|
||||
'Create one or load the starter plan.': 'Crea una o carga el plan inicial.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Cargar plan inicial (Push / Pull / Piernas)',
|
||||
'Superset with exercise above': 'Superserie con el ejercicio de arriba',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Nota (opcional) — indicaciones de carga, ej. «solo barra y +1 disco por lado en cada serie», lo que quieras recordar',
|
||||
'No exercises yet — add your first one.': 'Aún no hay ejercicios — añade el primero.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} ejercicios con animaciones',
|
||||
'Search…': 'Buscar…',
|
||||
'No workouts yet.': 'Aún no hay entrenamientos.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plan inicial cargado — Lun Push · Mié Pull · Vie Piernas',
|
||||
'Enter a name': 'Introduce un nombre',
|
||||
'Profile created — data from this device moved into it': 'Perfil creado — los datos de este dispositivo se han movido a él',
|
||||
'Profile created — data moved into it': 'Perfil creado — datos movidos a él',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — en cours',
|
||||
'Resume ▶': 'Reprendre ▶',
|
||||
'Welcome!': 'Bienvenue !',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configure ta routine hebdo pour commencer — ou charge un plan Push / Pull / Jambes tout prêt.',
|
||||
'Load starter plan (PPL)': 'Charger le plan de départ (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Configure ta routine hebdo pour commencer — ou charge un plan de départ tout prêt.',
|
||||
'Load starter plan': 'Charger un plan de départ',
|
||||
'Choose starter plan': 'Choisis un plan de départ',
|
||||
'{0} days per week': '{0} jours par semaine',
|
||||
'{0} loaded': '{0} chargé',
|
||||
'Load {0}?': 'Charger {0} ?',
|
||||
'Load plan': 'Charger le plan',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Le nouveau plan sera placé sur {0}. Tes routines sont toutes conservées — seuls ces jours du plan hebdo changent.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Jambes',
|
||||
'Push, pull and legs each get their own day.': 'Poussée, tirage et jambes, chacun son jour.',
|
||||
'Upper / Lower': 'Haut / Bas',
|
||||
'Upper body twice, lower body twice.': 'Haut du corps deux fois, bas du corps deux fois.',
|
||||
'Full Body': 'Corps entier',
|
||||
'Three sessions, the whole body each time.': 'Trois séances, tout le corps à chaque fois.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Cinq séries de cinq sur les gros mouvements à la barre.',
|
||||
'Build my own plan': 'Créer mon propre plan',
|
||||
'{0} week streak': 'série de {0} semaines',
|
||||
'this week': 'cette semaine',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Planning de la semaine',
|
||||
'No routines yet.': 'Aucune routine pour l’instant.',
|
||||
'Create one or load the starter plan.': 'Crées-en une ou charge le plan de départ.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Charger le plan de départ (Push / Pull / Jambes)',
|
||||
'Superset with exercise above': "Superset avec l'exercice au-dessus",
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Note (optionnelle) — indications de charge, ex. « barre seule puis +1 disque par côté à chaque série », tout ce que tu veux te rappeler',
|
||||
'No exercises yet — add your first one.': 'Aucun exercice — ajoute le premier.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} exercices avec animations',
|
||||
'Search…': 'Rechercher…',
|
||||
'No workouts yet.': 'Aucune séance pour l’instant.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plan de départ chargé — Lun Push · Mer Pull · Ven Jambes',
|
||||
'Enter a name': 'Entre un nom',
|
||||
'Profile created — data from this device moved into it': 'Profil créé — les données de cet appareil y ont été transférées',
|
||||
'Profile created — data moved into it': 'Profil créé — données transférées',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — चल रहा है',
|
||||
'Resume ▶': 'जारी रखें ▶',
|
||||
'Welcome!': 'स्वागत है!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'शुरू करने के लिए अपना साप्ताहिक रूटीन बनाएँ — या बना-बनाया पुश / पुल / लेग्स प्लान लोड करें।',
|
||||
'Load starter plan (PPL)': 'स्टार्टर प्लान लोड करें (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'शुरू करने के लिए अपना साप्ताहिक रूटीन बनाएँ — या बना-बनाया स्टार्टर प्लान लोड करें।',
|
||||
'Load starter plan': 'स्टार्टर प्लान लोड करें',
|
||||
'Choose starter plan': 'स्टार्टर प्लान चुनें',
|
||||
'{0} days per week': 'हफ़्ते में {0} दिन',
|
||||
'{0} loaded': '{0} लोड हुआ',
|
||||
'Load {0}?': '{0} लोड करें?',
|
||||
'Load plan': 'प्लान लोड करें',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'नया प्लान {0} पर लगेगा। आपकी सभी रूटीन बनी रहेंगी — साप्ताहिक प्लान में सिर्फ़ ये दिन बदलेंगे।',
|
||||
'Push / Pull / Legs': 'पुश / पुल / लेग्स',
|
||||
'Push, pull and legs each get their own day.': 'पुश, पुल और लेग्स, हर एक का अपना दिन।',
|
||||
'Upper / Lower': 'ऊपरी / निचला',
|
||||
'Upper body twice, lower body twice.': 'ऊपरी शरीर दो बार, निचला शरीर दो बार।',
|
||||
'Full Body': 'फ़ुल बॉडी',
|
||||
'Three sessions, the whole body each time.': 'तीन सेशन, हर बार पूरा शरीर।',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'मुख्य बारबेल लिफ़्ट पर पाँच सेट, पाँच रेप।',
|
||||
'Build my own plan': 'अपनी योजना बनाएँ',
|
||||
'{0} week streak': '{0} हफ़्तों की स्ट्रीक',
|
||||
'this week': 'इस हफ़्ते',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'हफ़्ते का कार्यक्रम',
|
||||
'No routines yet.': 'अभी कोई रूटीन नहीं।',
|
||||
'Create one or load the starter plan.': 'एक बनाएँ या स्टार्टर प्लान लोड करें।',
|
||||
'Load starter plan (Push / Pull / Legs)': 'स्टार्टर प्लान लोड करें (पुश / पुल / लेग्स)',
|
||||
'Superset with exercise above': 'ऊपर वाले व्यायाम के साथ सुपरसेट',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'नोट (वैकल्पिक) — लोडिंग संकेत, जैसे "सिर्फ़ खाली बार, फिर हर सेट में हर तरफ़ +1 प्लेट", जो भी याद रखना चाहें',
|
||||
'No exercises yet — add your first one.': 'अभी कोई व्यायाम नहीं — पहला जोड़ें।',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': 'एनिमेशन के साथ {0} व्यायाम',
|
||||
'Search…': 'खोजें…',
|
||||
'No workouts yet.': 'अभी कोई वर्कआउट नहीं।',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'स्टार्टर प्लान लोड हुआ — सोम पुश · बुध पुल · शुक्र लेग्स',
|
||||
'Enter a name': 'नाम दर्ज करें',
|
||||
'Profile created — data from this device moved into it': 'प्रोफ़ाइल बनी — इस डिवाइस का डेटा उसमें चला गया',
|
||||
'Profile created — data moved into it': 'प्रोफ़ाइल बनी — डेटा स्थानांतरित',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — folyamatban',
|
||||
'Resume ▶': 'Folytatás ▶',
|
||||
'Welcome!': 'Üdvözlünk!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Állítsd be a heti rutinod, hogy elindulhass — vagy tölts be egy kész Push / Pull / Legs tervet.',
|
||||
'Load starter plan (PPL)': 'Kezdő terv betöltése (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Állítsd be a heti rutinod, hogy elindulhass — vagy tölts be egy kész kezdő tervet.',
|
||||
'Load starter plan': 'Kezdő terv betöltése',
|
||||
'Choose starter plan': 'Válassz kezdő tervet',
|
||||
'{0} days per week': 'Heti {0} nap',
|
||||
'{0} loaded': '{0} betöltve',
|
||||
'Load {0}?': 'Betöltöd: {0}?',
|
||||
'Load plan': 'Terv betöltése',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Az új terv ide kerül: {0}. A meglévő rutinjaid megmaradnak — a heti tervben csak ezek a napok változnak.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Legs',
|
||||
'Push, pull and legs each get their own day.': 'Tolás, húzás és láb, mind a maga napján.',
|
||||
'Upper / Lower': 'Felső / Alsó',
|
||||
'Upper body twice, lower body twice.': 'Felsőtest kétszer, alsótest kétszer.',
|
||||
'Full Body': 'Teljes test',
|
||||
'Three sessions, the whole body each time.': 'Három edzés, mindegyiken az egész test.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Öt ötös sorozat a fő rúdgyakorlatokon.',
|
||||
'Build my own plan': 'Saját terv készítése',
|
||||
'{0} week streak': '{0} hetes sorozat',
|
||||
'this week': 'ezen a héten',
|
||||
@@ -238,7 +252,6 @@ export default {
|
||||
'Routines': 'Rutinok',
|
||||
'No routines yet.': 'Még nincs rutin.',
|
||||
'Create one or load the starter plan.': 'Hozz létre egyet, vagy töltsd be a kezdő tervet.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Kezdő terv betöltése (Push / Pull / Legs)',
|
||||
// --- routine edit ---
|
||||
'Superset with exercise above': 'Szuperszett a fenti gyakorlattal',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Megjegyzés (opcionális) — súlyozási tippek, pl. „csak a rúd, majd sorozatonként +1 tárcsa oldalanként”, bármi, amit érdemes megjegyezni',
|
||||
@@ -253,7 +266,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} gyakorlat animációval',
|
||||
'Search…': 'Keresés…',
|
||||
'No workouts yet.': 'Még nincs edzés.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Kezdő terv betöltve — H Push · Sze Pull · P Legs',
|
||||
// --- login / account ---
|
||||
'Enter a name': 'Adj meg egy nevet',
|
||||
'Profile created — data from this device moved into it': 'Profil létrehozva — az eszközön lévő adatok átkerültek bele',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — in corso',
|
||||
'Resume ▶': 'Riprendi ▶',
|
||||
'Welcome!': 'Benvenuto!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Imposta la tua routine settimanale — o carica un piano Push / Pull / Gambe già pronto.',
|
||||
'Load starter plan (PPL)': 'Carica piano iniziale (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Imposta la tua routine settimanale — o carica un piano iniziale già pronto.',
|
||||
'Load starter plan': 'Carica piano iniziale',
|
||||
'Choose starter plan': 'Scegli un piano iniziale',
|
||||
'{0} days per week': '{0} giorni a settimana',
|
||||
'{0} loaded': '{0} caricato',
|
||||
'Load {0}?': 'Caricare {0}?',
|
||||
'Load plan': 'Carica piano',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Il nuovo piano andrà su {0}. Le tue routine restano tutte — cambiano solo quei giorni del piano settimanale.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Gambe',
|
||||
'Push, pull and legs each get their own day.': 'Spinta, trazione e gambe, ognuna nel suo giorno.',
|
||||
'Upper / Lower': 'Superiore / Inferiore',
|
||||
'Upper body twice, lower body twice.': 'Parte superiore due volte, parte inferiore due volte.',
|
||||
'Full Body': 'Total body',
|
||||
'Three sessions, the whole body each time.': 'Tre sedute, ogni volta tutto il corpo.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Cinque serie da cinque sui fondamentali con bilanciere.',
|
||||
'Build my own plan': 'Crea il mio piano',
|
||||
'{0} week streak': 'serie di {0} settimane',
|
||||
'this week': 'questa settimana',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Programma settimanale',
|
||||
'No routines yet.': 'Ancora nessuna routine.',
|
||||
'Create one or load the starter plan.': 'Creane una o carica il piano iniziale.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Carica piano iniziale (Push / Pull / Gambe)',
|
||||
'Superset with exercise above': "Superset con l'esercizio sopra",
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Nota (facoltativa) — indicazioni di carico, es. "solo bilanciere poi +1 disco per lato a ogni serie", qualsiasi cosa tu voglia ricordare',
|
||||
'No exercises yet — add your first one.': 'Ancora nessun esercizio — aggiungi il primo.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} esercizi con animazioni',
|
||||
'Search…': 'Cerca…',
|
||||
'No workouts yet.': 'Ancora nessun allenamento.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Piano iniziale caricato — Lun Push · Mer Pull · Ven Gambe',
|
||||
'Enter a name': 'Inserisci un nome',
|
||||
'Profile created — data from this device moved into it': 'Profilo creato — i dati di questo dispositivo sono stati trasferiti',
|
||||
'Profile created — data moved into it': 'Profilo creato — dati trasferiti',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — 진행 중',
|
||||
'Resume ▶': '이어하기 ▶',
|
||||
'Welcome!': '환영합니다!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': '주간 루틴을 설정해 시작하세요 — 또는 미리 만들어진 푸시 / 풀 / 레그 계획을 불러오세요.',
|
||||
'Load starter plan (PPL)': '스타터 계획 불러오기 (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': '주간 루틴을 설정해 시작하세요 — 또는 미리 만들어진 스타터 계획을 불러오세요.',
|
||||
'Load starter plan': '스타터 계획 불러오기',
|
||||
'Choose starter plan': '스타터 계획 선택',
|
||||
'{0} days per week': '주 {0}일',
|
||||
'{0} loaded': '{0} 불러옴',
|
||||
'Load {0}?': '{0} 불러올까요?',
|
||||
'Load plan': '계획 불러오기',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': '새 계획은 {0}에 배치됩니다. 기존 루틴은 모두 유지되고 주간 계획에서 해당 요일만 바뀝니다.',
|
||||
'Push / Pull / Legs': '푸시 / 풀 / 레그',
|
||||
'Push, pull and legs each get their own day.': '푸시, 풀, 레그를 각각 다른 날에.',
|
||||
'Upper / Lower': '상체 / 하체',
|
||||
'Upper body twice, lower body twice.': '상체 두 번, 하체 두 번.',
|
||||
'Full Body': '전신',
|
||||
'Three sessions, the whole body each time.': '세 번의 세션, 매번 전신.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': '주요 바벨 종목을 5세트 5회로.',
|
||||
'Build my own plan': '내 계획 만들기',
|
||||
'{0} week streak': '{0}주 연속',
|
||||
'this week': '이번 주',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': '주간 일정',
|
||||
'No routines yet.': '아직 루틴이 없어요.',
|
||||
'Create one or load the starter plan.': '루틴을 만들거나 스타터 계획을 불러오세요.',
|
||||
'Load starter plan (Push / Pull / Legs)': '스타터 계획 불러오기 (푸시 / 풀 / 레그)',
|
||||
'Superset with exercise above': '위 운동과 슈퍼세트',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': '메모(선택 사항) — 중량 안내, 예: "빈 바로 시작 후 세트마다 양쪽 +1플레이트", 기억하고 싶은 모든 것',
|
||||
'No exercises yet — add your first one.': '아직 운동이 없어요 — 첫 운동을 추가하세요.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '애니메이션이 있는 운동 {0}개',
|
||||
'Search…': '검색…',
|
||||
'No workouts yet.': '아직 운동 기록이 없어요.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': '스타터 계획 불러옴 — 월 푸시 · 수 풀 · 금 레그',
|
||||
'Enter a name': '이름을 입력하세요',
|
||||
'Profile created — data from this device moved into it': '프로필 생성됨 — 이 기기의 데이터가 이동됨',
|
||||
'Profile created — data moved into it': '프로필 생성됨 — 데이터 이동됨',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — w trakcie',
|
||||
'Resume ▶': 'Wznów ▶',
|
||||
'Welcome!': 'Witaj!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Ustaw swój tygodniowy plan — albo wczytaj gotowy plan Push / Pull / Nogi.',
|
||||
'Load starter plan (PPL)': 'Wczytaj plan startowy (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Ustaw swój tygodniowy plan — albo wczytaj gotowy plan startowy.',
|
||||
'Load starter plan': 'Wczytaj plan startowy',
|
||||
'Choose starter plan': 'Wybierz plan startowy',
|
||||
'{0} days per week': '{0} dni w tygodniu',
|
||||
'{0} loaded': 'Wczytano: {0}',
|
||||
'Load {0}?': 'Wczytać {0}?',
|
||||
'Load plan': 'Wczytaj plan',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Nowy plan trafi na {0}. Twoje plany treningowe zostają — zmienią się tylko te dni w planie tygodnia.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Nogi',
|
||||
'Push, pull and legs each get their own day.': 'Pchanie, ciągnięcie i nogi — każde w swoim dniu.',
|
||||
'Upper / Lower': 'Góra / Dół',
|
||||
'Upper body twice, lower body twice.': 'Góra dwa razy, dół dwa razy.',
|
||||
'Full Body': 'Całe ciało',
|
||||
'Three sessions, the whole body each time.': 'Trzy treningi, za każdym razem całe ciało.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Pięć serii po pięć na głównych bojach ze sztangą.',
|
||||
'Build my own plan': 'Utwórz własny plan',
|
||||
'{0} week streak': 'seria {0} tyg.',
|
||||
'this week': 'w tym tygodniu',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Harmonogram tygodnia',
|
||||
'No routines yet.': 'Brak planów.',
|
||||
'Create one or load the starter plan.': 'Utwórz plan albo wczytaj startowy.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Wczytaj plan startowy (Push / Pull / Nogi)',
|
||||
'Superset with exercise above': 'Superseria z ćwiczeniem powyżej',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Notatka (opcjonalnie) — wskazówki dot. obciążenia, np. "sama sztanga, potem +1 talerz na stronę w każdej serii", cokolwiek chcesz zapamiętać',
|
||||
'No exercises yet — add your first one.': 'Brak ćwiczeń — dodaj pierwsze.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} ćwiczeń z animacjami',
|
||||
'Search…': 'Szukaj…',
|
||||
'No workouts yet.': 'Brak treningów.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plan startowy wczytany — Pn Push · Śr Pull · Pt Nogi',
|
||||
'Enter a name': 'Podaj imię',
|
||||
'Profile created — data from this device moved into it': 'Profil utworzony — dane z tego urządzenia zostały przeniesione',
|
||||
'Profile created — data moved into it': 'Profil utworzony — dane przeniesione',
|
||||
|
||||
@@ -62,13 +62,14 @@ export const PT_BR_OVERRIDES = {
|
||||
'The sets you logged in this session will be lost.': 'As séries registradas nesta sessão serão perdidas.',
|
||||
'Superset · do these back-to-back, rest when done': 'Superset · faça estes exercícios em sequência e descanse ao terminar',
|
||||
'Freestyle workout — add your first exercise.': 'Treino livre — adicione seu primeiro exercício.',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configure sua rotina semanal para começar ou carregue um plano pronto de Push / Pull / Legs.',
|
||||
'Load starter plan (PPL)': 'Carregar plano inicial (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Configure sua rotina semanal para começar — ou carregue um plano inicial já pronto.',
|
||||
'Choose starter plan': 'Escolha um plano inicial',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'O novo plano fica em {0}. Suas rotinas são todas mantidas — só esses dias do plano semanal mudam.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Legs',
|
||||
'Build my own plan': 'Criar meu próprio plano',
|
||||
'Finish your first workout to see progress curves here.': 'Finalize seu primeiro treino para ver os gráficos de progresso aqui.',
|
||||
'Your weekly routine': 'Sua rotina semanal',
|
||||
'Create one or load the starter plan.': 'Crie uma ou carregue o plano inicial.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Carregar plano inicial (Push / Pull / Legs)',
|
||||
'No exercises yet — add your first one.': 'Ainda não há exercícios — adicione o primeiro.',
|
||||
'Exclude from automatic progression': 'Excluir da progressão automática',
|
||||
'Use for planned deloads. Workouts stay in history and statistics.': 'Use para deloads planejados. Os treinos permanecem no histórico e nas estatísticas.',
|
||||
@@ -79,7 +80,6 @@ export const PT_BR_OVERRIDES = {
|
||||
'Copy routine': 'Copiar rotina',
|
||||
'Copy': 'Cópia',
|
||||
'Search…': 'Buscar…',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plano inicial carregado — Seg Push · Qua Pull · Sex Pernas',
|
||||
'{0} planned for {1}': '{0} planejado para {1}',
|
||||
'Planned': 'Planejado',
|
||||
'Enter a name': 'Informe um nome',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — em curso',
|
||||
'Resume ▶': 'Retomar ▶',
|
||||
'Welcome!': 'Bem-vindo!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Configura a tua rotina semanal — ou carrega um plano Push / Pull / Pernas já feito.',
|
||||
'Load starter plan (PPL)': 'Carregar plano inicial (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Configura a tua rotina semanal — ou carrega um plano inicial já feito.',
|
||||
'Load starter plan': 'Carregar plano inicial',
|
||||
'Choose starter plan': 'Escolhe um plano inicial',
|
||||
'{0} days per week': '{0} dias por semana',
|
||||
'{0} loaded': '{0} carregado',
|
||||
'Load {0}?': 'Carregar {0}?',
|
||||
'Load plan': 'Carregar plano',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'O novo plano fica em {0}. As tuas rotinas mantêm-se todas — só esses dias do plano semanal mudam.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Pernas',
|
||||
'Push, pull and legs each get their own day.': 'Empurrar, puxar e pernas, cada um no seu dia.',
|
||||
'Upper / Lower': 'Superior / Inferior',
|
||||
'Upper body twice, lower body twice.': 'Tronco superior duas vezes, inferior duas vezes.',
|
||||
'Full Body': 'Corpo inteiro',
|
||||
'Three sessions, the whole body each time.': 'Três sessões, o corpo todo de cada vez.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Cinco séries de cinco nos básicos com barra.',
|
||||
'Build my own plan': 'Criar o meu próprio plano',
|
||||
'{0} week streak': 'sequência de {0} semanas',
|
||||
'this week': 'esta semana',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Horário semanal',
|
||||
'No routines yet.': 'Ainda sem rotinas.',
|
||||
'Create one or load the starter plan.': 'Cria uma ou carrega o plano inicial.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Carregar plano inicial (Push / Pull / Pernas)',
|
||||
'Superset with exercise above': 'Supersérie com o exercício acima',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Nota (opcional) — dicas de carga, ex. "só a barra, depois +1 anilha por lado a cada série", o que quiser lembrar',
|
||||
'No exercises yet — add your first one.': 'Ainda sem exercícios — adiciona o primeiro.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} exercícios com animações',
|
||||
'Search…': 'Pesquisar…',
|
||||
'No workouts yet.': 'Ainda sem treinos.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Plano inicial carregado — Seg Push · Qua Pull · Sex Pernas',
|
||||
'Enter a name': 'Introduz um nome',
|
||||
'Profile created — data from this device moved into it': 'Perfil criado — os dados deste dispositivo foram movidos para ele',
|
||||
'Profile created — data moved into it': 'Perfil criado — dados movidos',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — идёт',
|
||||
'Resume ▶': 'Продолжить ▶',
|
||||
'Welcome!': 'Добро пожаловать!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Настрой свой недельный план — или загрузи готовый план Push / Pull / Ноги.',
|
||||
'Load starter plan (PPL)': 'Загрузить стартовый план (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Настрой свой недельный план — или загрузи готовый стартовый план.',
|
||||
'Load starter plan': 'Загрузить стартовый план',
|
||||
'Choose starter plan': 'Выбери стартовый план',
|
||||
'{0} days per week': 'Дней в неделю: {0}',
|
||||
'{0} loaded': '{0} загружен',
|
||||
'Load {0}?': 'Загрузить {0}?',
|
||||
'Load plan': 'Загрузить план',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Новый план встанет на {0}. Все твои программы сохранятся — в плане недели изменятся только эти дни.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Ноги',
|
||||
'Push, pull and legs each get their own day.': 'Жимы, тяги и ноги — каждому свой день.',
|
||||
'Upper / Lower': 'Верх / Низ',
|
||||
'Upper body twice, lower body twice.': 'Верх тела дважды, низ дважды.',
|
||||
'Full Body': 'Всё тело',
|
||||
'Three sessions, the whole body each time.': 'Три тренировки, каждый раз всё тело.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Пять подходов по пять в основных движениях со штангой.',
|
||||
'Build my own plan': 'Создать свой план',
|
||||
'{0} week streak': 'серия: {0} нед.',
|
||||
'this week': 'на этой неделе',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Расписание недели',
|
||||
'No routines yet.': 'Программ пока нет.',
|
||||
'Create one or load the starter plan.': 'Создай программу или загрузи стартовый план.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Загрузить стартовый план (Push / Pull / Ноги)',
|
||||
'Superset with exercise above': 'Суперсет с упражнением выше',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Заметка (необязательно) — подсказки по нагрузке, напр. «только гриф, затем +1 блин на сторону каждый подход», всё, что стоит запомнить',
|
||||
'No exercises yet — add your first one.': 'Упражнений пока нет — добавь первое.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} упражнений с анимациями',
|
||||
'Search…': 'Поиск…',
|
||||
'No workouts yet.': 'Тренировок пока нет.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Стартовый план загружен — Пн Push · Ср Pull · Пт Ноги',
|
||||
'Enter a name': 'Введите имя',
|
||||
'Profile created — data from this device moved into it': 'Профиль создан — данные с этого устройства перенесены в него',
|
||||
'Profile created — data moved into it': 'Профиль создан — данные перенесены',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — กำลังดำเนินการ',
|
||||
'Resume ▶': 'เล่นต่อ ▶',
|
||||
'Welcome!': 'ยินดีต้อนรับ!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'ตั้งค่ารูทีนรายสัปดาห์เพื่อเริ่มต้น — หรือโหลดแผนสำเร็จรูป Push / Pull / Legs',
|
||||
'Load starter plan (PPL)': 'โหลดแผนเริ่มต้น (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'ตั้งค่ารูทีนรายสัปดาห์เพื่อเริ่มต้น — หรือโหลดแผนเริ่มต้นสำเร็จรูป',
|
||||
'Load starter plan': 'โหลดแผนเริ่มต้น',
|
||||
'Choose starter plan': 'เลือกแผนเริ่มต้น',
|
||||
'{0} days per week': 'สัปดาห์ละ {0} วัน',
|
||||
'{0} loaded': 'โหลด {0} แล้ว',
|
||||
'Load {0}?': 'โหลด {0} ไหม',
|
||||
'Load plan': 'โหลดแผน',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'แผนใหม่จะลงใน {0} รูทีนเดิมของคุณยังอยู่ครบ — เปลี่ยนเฉพาะวันเหล่านี้ในแผนรายสัปดาห์',
|
||||
'Push / Pull / Legs': 'Push / Pull / Legs',
|
||||
'Push, pull and legs each get their own day.': 'ดัน ดึง และขา แยกกันคนละวัน',
|
||||
'Upper / Lower': 'บน / ล่าง',
|
||||
'Upper body twice, lower body twice.': 'ลำตัวบนสองครั้ง ลำตัวล่างสองครั้ง',
|
||||
'Full Body': 'เต็มตัว',
|
||||
'Three sessions, the whole body each time.': 'สามครั้ง ครบทั้งตัวทุกครั้ง',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'ห้าเซ็ต เซ็ตละห้าครั้ง ในท่าบาร์เบลหลัก',
|
||||
'Build my own plan': 'สร้างแผนของตัวเอง',
|
||||
'{0} week streak': 'ต่อเนื่อง {0} สัปดาห์',
|
||||
'this week': 'สัปดาห์นี้',
|
||||
@@ -238,7 +252,6 @@ export default {
|
||||
'Routines': 'รูทีน',
|
||||
'No routines yet.': 'ยังไม่มีรูทีน',
|
||||
'Create one or load the starter plan.': 'สร้างใหม่หรือโหลดแผนเริ่มต้น',
|
||||
'Load starter plan (Push / Pull / Legs)': 'โหลดแผนเริ่มต้น (Push / Pull / Legs)',
|
||||
// --- routine edit ---
|
||||
'Superset with exercise above': 'ซูเปอร์เซ็ตกับท่าด้านบน',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'บันทึก (ไม่บังคับ) — เคล็ดลับการตั้งน้ำหนัก เช่น "เอาแค่บาร์เปล่าก่อน แล้วค่อยเพิ่มแผ่นละ 1 แผ่นต่อข้างทุกเซ็ต" หรืออะไรก็ตามที่อยากจดจำไว้',
|
||||
@@ -253,7 +266,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} ท่าพร้อมภาพเคลื่อนไหว',
|
||||
'Search…': 'ค้นหา…',
|
||||
'No workouts yet.': 'ยังไม่มีการออกกำลังกาย',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'โหลดแผนเริ่มต้นแล้ว — จ. Push · พ. Pull · ศ. Legs',
|
||||
// --- login / account ---
|
||||
'Enter a name': 'กรอกชื่อ',
|
||||
'Profile created — data from this device moved into it': 'สร้างโปรไฟล์แล้ว — ย้ายข้อมูลจากเครื่องนี้เข้าไปแล้ว',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0} — devam ediyor',
|
||||
'Resume ▶': 'Devam et ▶',
|
||||
'Welcome!': 'Hoş geldin!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': 'Başlamak için haftalık rutinini kur — ya da hazır bir Push / Pull / Bacak planı yükle.',
|
||||
'Load starter plan (PPL)': 'Başlangıç planını yükle (PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': 'Başlamak için haftalık rutinini kur — ya da hazır bir başlangıç planı yükle.',
|
||||
'Load starter plan': 'Başlangıç planı yükle',
|
||||
'Choose starter plan': 'Başlangıç planı seç',
|
||||
'{0} days per week': 'Haftada {0} gün',
|
||||
'{0} loaded': '{0} yüklendi',
|
||||
'Load {0}?': '{0} yüklensin mi?',
|
||||
'Load plan': 'Planı yükle',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': 'Yeni plan {0} günlerine yerleşecek. Mevcut rutinlerin duruyor — haftalık planda yalnızca bu günler değişiyor.',
|
||||
'Push / Pull / Legs': 'Push / Pull / Bacak',
|
||||
'Push, pull and legs each get their own day.': 'İtiş, çekiş ve bacak; her biri kendi gününde.',
|
||||
'Upper / Lower': 'Üst / Alt',
|
||||
'Upper body twice, lower body twice.': 'Üst vücut iki kez, alt vücut iki kez.',
|
||||
'Full Body': 'Tüm vücut',
|
||||
'Three sessions, the whole body each time.': 'Üç antrenman, her seferinde tüm vücut.',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': 'Ana halter hareketlerinde beşer tekrarlı beş set.',
|
||||
'Build my own plan': 'Kendi planımı oluştur',
|
||||
'{0} week streak': '{0} haftalık seri',
|
||||
'this week': 'bu hafta',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': 'Hafta programı',
|
||||
'No routines yet.': 'Henüz rutin yok.',
|
||||
'Create one or load the starter plan.': 'Bir tane oluştur ya da başlangıç planını yükle.',
|
||||
'Load starter plan (Push / Pull / Legs)': 'Başlangıç planını yükle (Push / Pull / Bacak)',
|
||||
'Superset with exercise above': 'Üstteki egzersizle süperset',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': 'Not (isteğe bağlı) — yükleme ipuçları, örn. "sadece bar, sonra her sette +1 disk/taraf", aklında tutmak istediğin her şey',
|
||||
'No exercises yet — add your first one.': 'Henüz egzersiz yok — ilkini ekle.',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': 'animasyonlu {0} egzersiz',
|
||||
'Search…': 'Ara…',
|
||||
'No workouts yet.': 'Henüz antrenman yok.',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': 'Başlangıç planı yüklendi — Pzt Push · Çar Pull · Cum Bacak',
|
||||
'Enter a name': 'Bir isim gir',
|
||||
'Profile created — data from this device moved into it': 'Profil oluşturuldu — bu cihazdaki veriler profile taşındı',
|
||||
'Profile created — data moved into it': 'Profil oluşturuldu — veriler taşındı',
|
||||
|
||||
@@ -209,8 +209,22 @@ export default {
|
||||
'{0} — in progress': '{0}——进行中',
|
||||
'Resume ▶': '继续 ▶',
|
||||
'Welcome!': '欢迎!',
|
||||
'Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.': '设置每周计划开始训练——或加载现成的推 / 拉 / 腿计划。',
|
||||
'Load starter plan (PPL)': '加载入门计划(PPL)',
|
||||
'Set up your weekly routine to get going — or load a ready-made starter plan.': '设置每周计划开始训练——或加载现成的入门计划。',
|
||||
'Load starter plan': '加载入门计划',
|
||||
'Choose starter plan': '选择入门计划',
|
||||
'{0} days per week': '每周 {0} 天',
|
||||
'{0} loaded': '已加载{0}',
|
||||
'Load {0}?': '加载{0}?',
|
||||
'Load plan': '加载计划',
|
||||
'The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.': '新计划将安排在{0}。你现有的训练日都会保留——每周计划中只有这几天会改变。',
|
||||
'Push / Pull / Legs': '推 / 拉 / 腿',
|
||||
'Push, pull and legs each get their own day.': '推、拉、腿各占一天。',
|
||||
'Upper / Lower': '上肢 / 下肢',
|
||||
'Upper body twice, lower body twice.': '上肢两次,下肢两次。',
|
||||
'Full Body': '全身',
|
||||
'Three sessions, the whole body each time.': '三次训练,每次练全身。',
|
||||
'5×5': '5×5',
|
||||
'Five sets of five on the main barbell lifts.': '主要杠铃动作五组五次。',
|
||||
'Build my own plan': '创建自己的计划',
|
||||
'{0} week streak': '连续 {0} 周',
|
||||
'this week': '本周',
|
||||
@@ -235,7 +249,6 @@ export default {
|
||||
'Week schedule': '每周日程',
|
||||
'No routines yet.': '还没有训练日。',
|
||||
'Create one or load the starter plan.': '创建一个或加载入门计划。',
|
||||
'Load starter plan (Push / Pull / Legs)': '加载入门计划(推 / 拉 / 腿)',
|
||||
'Superset with exercise above': '与上面的动作组成超级组',
|
||||
'Note (optional) — loading cues, "bar only then +1 plate/side each set", anything worth remembering here': '备注(可选)— 加重提示,例如"空杠开始,之后每组每侧+1片",任何你想记住的内容',
|
||||
'No exercises yet — add your first one.': '还没有动作——添加第一个吧。',
|
||||
@@ -248,7 +261,6 @@ export default {
|
||||
'{0} exercises with animations': '{0} 个带动画的动作',
|
||||
'Search…': '搜索…',
|
||||
'No workouts yet.': '还没有训练。',
|
||||
'Starter plan loaded — Mon Push · Wed Pull · Fri Legs': '入门计划已加载——周一推 · 周三拉 · 周五腿',
|
||||
'Enter a name': '请输入名字',
|
||||
'Profile created — data from this device moved into it': '档案已创建——本设备数据已转入',
|
||||
'Profile created — data moved into it': '档案已创建——数据已转入',
|
||||
|
||||
+59
-9
@@ -7,9 +7,9 @@ import { fmtDate, fmtNum, fmtVol, fmtDur, durPart, todayISO, isoOf, uid, exCount
|
||||
import { lastEntryFor, bestWeightFor, bestWeightForEntry, buildSets, effectiveRoutineId, workoutVolume, setsDone, setsDoneActive, lastBW, supersetUnits, unitOf, setLabel, defaultConfig, cleanupSg, modeOf, effortOf, isBw, isPerSide, sideReps, workSetsDone, applyIntensifierPlan, MAX_PLANNED_WARMUPS, NOTE_MAX } from './lib/history.js'
|
||||
import { usesBar, barWeightFor, defaultBarWeight, hasBarOverride } from './lib/bar.js'
|
||||
import { beep, vibrate } from './lib/sound.js'
|
||||
import { t, instrFor, exerciseNameFor, getLang, INSTR_LANGS } from './lib/i18n.js'
|
||||
import { t, dateLocale, instrFor, exerciseNameFor, getLang, INSTR_LANGS } from './lib/i18n.js'
|
||||
import { nav } from './lib/nav.js'
|
||||
import { starterRoutines } from './lib/starter.js'
|
||||
import { buildStarterPlan, starterPlanDays, starterPlanOptions } from './lib/starter.js'
|
||||
import Media, { Thumb } from './components/Media.jsx'
|
||||
import Stepper from './components/Stepper.jsx'
|
||||
import Icon from './components/Icon.jsx'
|
||||
@@ -55,15 +55,65 @@ export function confirmSheet(opts) {
|
||||
}
|
||||
|
||||
/* ============================ starter plan ============================ */
|
||||
export function loadStarterPlan() {
|
||||
const [push, pull, legs] = starterRoutines()
|
||||
update(st => {
|
||||
st.routines.push(push, pull, legs)
|
||||
st.week[1] = push.id; st.week[3] = pull.id; st.week[5] = legs.id
|
||||
})
|
||||
toast(t('Starter plan loaded — Mon Push · Wed Pull · Fri Legs'))
|
||||
// Plan names and blurbs live here, not in lib/starter.js: check-source-strings.mjs only finds
|
||||
// string literals written inside a t() call, so copy parked in the catalog and passed in as a
|
||||
// variable is invisible to it — it would quietly stay English in every language.
|
||||
const PLAN_COPY = {
|
||||
ppl: () => ({ name: t('Push / Pull / Legs'), about: t('Push, pull and legs each get their own day.') }),
|
||||
'upper-lower': () => ({ name: t('Upper / Lower'), about: t('Upper body twice, lower body twice.') }),
|
||||
'full-body': () => ({ name: t('Full Body'), about: t('Three sessions, the whole body each time.') }),
|
||||
'5x5': () => ({ name: t('5×5'), about: t('Five sets of five on the main barbell lifts.') })
|
||||
}
|
||||
|
||||
// Adds the plan's routines and puts them on its weekdays. Existing routines are never touched
|
||||
// and only the weekdays the plan asks for are reassigned; an id with no plan behind it changes
|
||||
// nothing at all. planId is deliberately required — a default invites `onClick={loadStarterPlan}`,
|
||||
// which hands the click event in as the plan and silently loads nothing.
|
||||
export function loadStarterPlan(planId) {
|
||||
const plan = buildStarterPlan(planId)
|
||||
if (!plan) return false
|
||||
update(st => {
|
||||
st.routines.push(...plan.routines)
|
||||
plan.schedule.forEach(({ day, routineId }) => { st.week[day] = routineId })
|
||||
})
|
||||
toast(t('{0} loaded', PLAN_COPY[planId]().name))
|
||||
return true
|
||||
}
|
||||
|
||||
// Intl joins the days the way each language does it — "and" vs "und", "、" in Chinese.
|
||||
const dayList = days => new Intl.ListFormat(dateLocale()).format(days.map(d => t(DAYN[d])))
|
||||
|
||||
function StarterPlanChooser({ close }) {
|
||||
const week = useStore(s => s.S.week)
|
||||
const choose = (id, name) => {
|
||||
const days = starterPlanDays(id)
|
||||
close()
|
||||
// A confirmation is only worth showing when one of those days is actually occupied.
|
||||
if (!days.some(day => week[day])) { loadStarterPlan(id); return }
|
||||
confirmSheet({
|
||||
title: t('Load {0}?', name),
|
||||
message: t('The new plan will be scheduled on {0}. Existing routines are kept — only those days of the weekly plan change.', dayList(days)),
|
||||
confirmText: t('Load plan'),
|
||||
onConfirm: () => loadStarterPlan(id)
|
||||
})
|
||||
}
|
||||
return <>
|
||||
<h3>{t('Choose starter plan')}</h3>
|
||||
<div className="list">
|
||||
{starterPlanOptions().map(({ id, days }) => {
|
||||
const { name, about } = PLAN_COPY[id]()
|
||||
return <div key={id} className="item" {...tappable(() => choose(id, name))}>
|
||||
<span className="lrow-i" style={{ background: 'var(--surface-3)' }}><Icon name="sparkles" /></span>
|
||||
<div className="grow"><div className="tt">{name}</div><div className="ss">{t('{0} days per week', days)} · {about}</div></div>
|
||||
<Icon name="chevronRight" className="chev" />
|
||||
</div>
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
||||
export const starterPlanSheet = () => ui().openSheet(close => <StarterPlanChooser close={close} />)
|
||||
|
||||
/* ============================ weight picker (shared: body weight + goal) ============================ */
|
||||
// Fixed range, not a moving window — a window that resizes itself mid-drag (the previous
|
||||
// attempt) makes the thumb's position unpredictable: every time it grows, everything already
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
// @vitest-environment happy-dom
|
||||
// The chooser is where a starter plan can quietly do the wrong thing: overwrite a weekday
|
||||
// without asking, ask when there was nothing to overwrite, or apply a plan the user cancelled.
|
||||
import React, { act } from 'react'
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { useStore } from './store/useStore.js'
|
||||
import { useUI } from './store/useUI.js'
|
||||
import { loadStarterPlan, starterPlanSheet } from './sheets.jsx'
|
||||
|
||||
const mounted = []
|
||||
|
||||
const S = () => useStore.getState().S
|
||||
const nameOn = day => S().routines.find(r => r.id === S().week[day])?.name
|
||||
|
||||
// Renders whatever sheet is on top and returns its host element.
|
||||
function renderTop() {
|
||||
const sheet = useUI.getState().sheets.at(-1)
|
||||
const host = document.createElement('div')
|
||||
document.body.appendChild(host)
|
||||
const root = createRoot(host)
|
||||
mounted.push(root)
|
||||
act(() => root.render(sheet.render(() => useUI.getState().closeSheet(sheet.id))))
|
||||
return host
|
||||
}
|
||||
|
||||
const rowFor = (host, name) => [...host.querySelectorAll('.item')].find(el => el.querySelector('.tt')?.textContent === name)
|
||||
const buttonFor = (host, label) => [...host.querySelectorAll('button')].find(b => b.textContent === label)
|
||||
|
||||
// Opens the chooser and taps one of its rows.
|
||||
function choose(name) {
|
||||
starterPlanSheet()
|
||||
const host = renderTop()
|
||||
act(() => { rowFor(host, name).click() })
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
globalThis.IS_REACT_ACT_ENVIRONMENT = true
|
||||
useUI.setState({ sheets: [], toastMsg: '' })
|
||||
useStore.setState(s => ({
|
||||
S: { ...s.S, routines: [{ id: 'mine', name: 'My routine', emoji: 'star', ex: [] }], week: {}, active: null },
|
||||
}))
|
||||
document.body.innerHTML = ''
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
act(() => { mounted.splice(0).forEach(root => root.unmount()) })
|
||||
})
|
||||
|
||||
describe('starter plan chooser', () => {
|
||||
it('lists every plan with its day count', () => {
|
||||
starterPlanSheet()
|
||||
const host = renderTop()
|
||||
expect([...host.querySelectorAll('.item .tt')].map(el => el.textContent))
|
||||
.toEqual(['Push / Pull / Legs', 'Upper / Lower', 'Full Body', '5×5'])
|
||||
expect(rowFor(host, 'Upper / Lower').querySelector('.ss').textContent).toContain('4 days per week')
|
||||
})
|
||||
|
||||
it('loads straight away when the plan’s weekdays are free, without asking', () => {
|
||||
useStore.setState(s => ({ S: { ...s.S, week: { 0: 'mine', 6: 'mine' } } }))
|
||||
choose('Upper / Lower')
|
||||
|
||||
expect(useUI.getState().sheets).toHaveLength(0) // no confirmation was raised
|
||||
expect(nameOn(1)).toBe('Upper A')
|
||||
expect(nameOn(2)).toBe('Lower A')
|
||||
expect(nameOn(4)).toBe('Upper B')
|
||||
expect(nameOn(5)).toBe('Lower B')
|
||||
expect(S().week[0]).toBe('mine') // untouched weekdays stay put
|
||||
expect(S().week[6]).toBe('mine')
|
||||
expect(S().routines[0].name).toBe('My routine') // and nothing is deleted
|
||||
expect(useUI.getState().toastMsg).toBe('Upper / Lower loaded')
|
||||
})
|
||||
|
||||
it('asks first when a weekday the plan wants is already taken', () => {
|
||||
useStore.setState(s => ({ S: { ...s.S, week: { 3: 'mine' } } }))
|
||||
choose('Full Body')
|
||||
|
||||
const confirm = renderTop()
|
||||
expect(confirm.querySelector('h3').textContent).toBe('Load Full Body?')
|
||||
expect(confirm.textContent).toContain('Monday, Wednesday and Friday')
|
||||
expect(S().week[3]).toBe('mine') // nothing applied yet
|
||||
expect(S().routines).toHaveLength(1)
|
||||
|
||||
act(() => { buttonFor(confirm, 'Load plan').click() })
|
||||
expect(nameOn(1)).toBe('Full Body A')
|
||||
expect(nameOn(3)).toBe('Full Body B')
|
||||
expect(nameOn(5)).toBe('Full Body C')
|
||||
})
|
||||
|
||||
it('leaves everything alone when the confirmation is cancelled', () => {
|
||||
useStore.setState(s => ({ S: { ...s.S, week: { 1: 'mine' } } }))
|
||||
const before = structuredClone(S())
|
||||
choose('5×5')
|
||||
|
||||
const confirm = renderTop()
|
||||
act(() => { buttonFor(confirm, 'Cancel').click() })
|
||||
expect(S()).toEqual(before)
|
||||
expect(useUI.getState().toastMsg).toBe('')
|
||||
})
|
||||
|
||||
it('does not ask when only weekdays outside the plan are occupied', () => {
|
||||
useStore.setState(s => ({ S: { ...s.S, week: { 2: 'mine', 4: 'mine' } } })) // Tue + Thu
|
||||
choose('5×5') // wants Mon/Wed/Fri
|
||||
expect(useUI.getState().sheets).toHaveLength(0)
|
||||
expect(nameOn(1)).toBe('5×5 A')
|
||||
})
|
||||
})
|
||||
|
||||
describe('loadStarterPlan', () => {
|
||||
it('appends independent routines each time the same plan is loaded', () => {
|
||||
loadStarterPlan('ppl')
|
||||
const first = S().routines.slice(1).map(r => r.id)
|
||||
loadStarterPlan('ppl')
|
||||
const second = S().routines.slice(4).map(r => r.id)
|
||||
expect(S().routines).toHaveLength(7)
|
||||
expect(new Set([...first, ...second]).size).toBe(6)
|
||||
expect(second.some(id => first.includes(id))).toBe(false)
|
||||
})
|
||||
|
||||
it('refuses a plan it does not know and changes nothing', () => {
|
||||
const before = structuredClone(S())
|
||||
expect(loadStarterPlan('nope')).toBe(false)
|
||||
expect(loadStarterPlan(undefined)).toBe(false)
|
||||
expect(S()).toEqual(before)
|
||||
expect(useUI.getState().toastMsg).toBe('')
|
||||
})
|
||||
})
|
||||
@@ -4,7 +4,7 @@ import { useStore } from '../store/useStore.js'
|
||||
import { effectiveRoutine, effectiveRoutineId, nextTrainingDay, streakWeeks, lastBW, setsDoneActive } from '../lib/history.js'
|
||||
import { fmtNum, fmtDate, todayISO, isoOf, weekKey, weekStartOf, weekDayOffset, DAYS, DAYN } from '../lib/format.js'
|
||||
import { t, dateLocale } from '../lib/i18n.js'
|
||||
import { bwSheet, goalSheet, dayOverrideSheet, calendarSheet, startFlow, loadStarterPlan, bwDeltaColor } from '../sheets.jsx'
|
||||
import { bwSheet, goalSheet, dayOverrideSheet, calendarSheet, startFlow, starterPlanSheet, bwDeltaColor } from '../sheets.jsx'
|
||||
import LineChart from '../components/LineChart.jsx'
|
||||
import Icon from '../components/Icon.jsx'
|
||||
import { Button } from '../components/ui.jsx'
|
||||
@@ -117,8 +117,8 @@ export default function Home() {
|
||||
<span className="lrow-i"><Icon name="sparkles" /></span>
|
||||
<div className="big" style={{ fontSize: 22 }}>{t('Welcome!')}</div>
|
||||
</div>
|
||||
<div className="muted small" style={{ marginBottom: 12 }}>{t('Set up your weekly routine to get going — or load a ready-made Push / Pull / Legs plan.')}</div>
|
||||
<Button variant="primary" icon="sparkles" onClick={loadStarterPlan}>{t('Load starter plan (PPL)')}</Button>
|
||||
<div className="muted small" style={{ marginBottom: 12 }}>{t('Set up your weekly routine to get going — or load a ready-made starter plan.')}</div>
|
||||
<Button variant="primary" icon="sparkles" onClick={starterPlanSheet}>{t('Load starter plan')}</Button>
|
||||
<div style={{ height: 8 }} /><Button onClick={() => nav('/plan')}>{t('Build my own plan')}</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useNavigate } from 'react-router-dom'
|
||||
import { useStore } from '../store/useStore.js'
|
||||
import { DAYN, weekOrder, weekStartOf, uid, exCount } from '../lib/format.js'
|
||||
import { t } from '../lib/i18n.js'
|
||||
import { dayAssignSheet, loadStarterPlan, planToolsSheet } from '../sheets.jsx'
|
||||
import { dayAssignSheet, starterPlanSheet, planToolsSheet } from '../sheets.jsx'
|
||||
import Icon from '../components/Icon.jsx'
|
||||
import { Button } from '../components/ui.jsx'
|
||||
import { tappable } from '../lib/use-sheet-keyboard.js'
|
||||
@@ -66,7 +66,7 @@ export default function Plan() {
|
||||
<div className="grow"><div className="tt">{r.name}</div><div className="ss">{exCount(r.ex.length)}</div></div>
|
||||
<Icon name="chevronRight" className="chev" /></div>)}</div> : <>
|
||||
<div className="empty"><div className="ico"><Icon name="clipboard" /></div>{t('No routines yet.')}<br />{t('Create one or load the starter plan.')}</div>
|
||||
<Button icon="sparkles" onClick={loadStarterPlan}>{t('Load starter plan (Push / Pull / Legs)')}</Button>
|
||||
<Button icon="sparkles" onClick={starterPlanSheet}>{t('Load starter plan')}</Button>
|
||||
</>}
|
||||
</div></div>
|
||||
</>
|
||||
|
||||
@@ -41,7 +41,7 @@ vi.mock('../lib/wakelock.js', () => ({ wakeLockSupported: () => false }))
|
||||
vi.mock('../lib/mobile.js', () => ({ MOBILE: false, shareExport: vi.fn(), syncReminder: vi.fn() }))
|
||||
vi.mock('./MobileOnboarding.jsx', () => ({ ConnectSheet: () => null }))
|
||||
vi.mock('../sheets.jsx', () => ({
|
||||
loadStarterPlan: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),
|
||||
starterPlanSheet: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),
|
||||
importFromHevy: vi.fn(), equipmentProfileSheet: vi.fn(),
|
||||
}))
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { t, LANGS, INSTR_LANGS } from '../lib/i18n.js'
|
||||
import { DEMO, REPO } from '../lib/demo.js'
|
||||
import { MOBILE, shareExport, syncReminder } from '../lib/mobile.js'
|
||||
import { ConnectSheet } from './MobileOnboarding.jsx'
|
||||
import { loadStarterPlan, confirmSheet, importFromApp, importFromHevy, equipmentProfileSheet } from '../sheets.jsx'
|
||||
import { starterPlanSheet, confirmSheet, importFromApp, importFromHevy, equipmentProfileSheet } from '../sheets.jsx'
|
||||
import Icon from '../components/Icon.jsx'
|
||||
import { Section, Row, SelectRow, Switch, Segmented, Button, TextField } from '../components/ui.jsx'
|
||||
|
||||
@@ -239,7 +239,7 @@ export default function Settings() {
|
||||
|
||||
{/* ---------- data: fill it, bring things over, back it up, wipe it ---------- */}
|
||||
<Section title={t('Data')}>
|
||||
<Row icon="sparkles" iconTint="var(--acc)" title={t('Load starter plan (PPL)')} accessory="chevron" onClick={loadStarterPlan} />
|
||||
<Row icon="sparkles" iconTint="var(--acc)" title={t('Load starter plan')} accessory="chevron" onClick={starterPlanSheet} />
|
||||
<Row icon="shuffle" iconTint="var(--teal)" title={t('Import from another app')}
|
||||
subtitle={t('FitNotes, Strong, Hevy — or body weight from Apple Health')}
|
||||
accessory="chevron" onClick={() => importRef.current.click()} />
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// @vitest-environment happy-dom
|
||||
// Home and Plan both offer the starter plan to someone who has no routines yet. Both used to
|
||||
// wire the button straight to the loader, which quietly handed the click event in as the plan
|
||||
// id and loaded nothing at all — so both entry points are pinned here.
|
||||
import React, { act } from 'react'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { useStore } from '../store/useStore.js'
|
||||
import { starterPlanSheet } from '../sheets.jsx'
|
||||
import Home from './Home.jsx'
|
||||
import Plan from './Plan.jsx'
|
||||
|
||||
vi.mock('react-router-dom', () => ({ useNavigate: () => () => {} }))
|
||||
vi.mock('../sheets.jsx', () => ({
|
||||
starterPlanSheet: vi.fn(), bwSheet: vi.fn(), goalSheet: vi.fn(), dayOverrideSheet: vi.fn(),
|
||||
calendarSheet: vi.fn(), startFlow: vi.fn(), bwDeltaColor: () => '',
|
||||
dayAssignSheet: vi.fn(), planToolsSheet: vi.fn(),
|
||||
}))
|
||||
|
||||
let host, root
|
||||
beforeEach(() => {
|
||||
globalThis.IS_REACT_ACT_ENVIRONMENT = true
|
||||
starterPlanSheet.mockClear()
|
||||
useStore.setState(s => ({ S: { ...s.S, routines: [], week: {}, active: null }, user: null }))
|
||||
host = document.createElement('div')
|
||||
document.body.appendChild(host)
|
||||
root = createRoot(host)
|
||||
})
|
||||
afterEach(() => {
|
||||
act(() => root.unmount())
|
||||
host.remove()
|
||||
})
|
||||
|
||||
const starterButton = () => [...host.querySelectorAll('button')].find(b => b.textContent === 'Load starter plan')
|
||||
|
||||
describe.each([['Home', Home], ['Plan', Plan]])('%s empty state', (_name, View) => {
|
||||
it('opens the starter plan chooser instead of loading one plan blind', () => {
|
||||
act(() => root.render(<View />))
|
||||
const button = starterButton()
|
||||
expect(button).toBeTruthy()
|
||||
|
||||
act(() => { button.click() })
|
||||
expect(starterPlanSheet).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('drops the offer once the user has routines', () => {
|
||||
useStore.setState(s => ({ S: { ...s.S, routines: [{ id: 'r', name: 'Mine', emoji: 'star', ex: [] }] } }))
|
||||
act(() => root.render(<View />))
|
||||
expect(starterButton()).toBeFalsy()
|
||||
})
|
||||
})
|
||||
@@ -44,7 +44,7 @@ vi.mock('../lib/wakelock.js', () => ({ wakeLockSupported: () => false }))
|
||||
vi.mock('../lib/mobile.js', () => ({ MOBILE: false, shareExport: vi.fn(), syncReminder: vi.fn() }))
|
||||
vi.mock('./MobileOnboarding.jsx', () => ({ ConnectSheet: () => null }))
|
||||
vi.mock('../sheets.jsx', () => ({
|
||||
loadStarterPlan: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),
|
||||
starterPlanSheet: vi.fn(), confirmSheet: vi.fn(), importFromApp: vi.fn(),
|
||||
importFromHevy: vi.fn(), equipmentProfileSheet: vi.fn(),
|
||||
dayAssignSheet: vi.fn(), planToolsSheet: vi.fn(),
|
||||
}))
|
||||
|
||||
Reference in new issue
Block a user