notes: make the session note real, and stop losing it

v1.2.10 shipped the session note as one of three kinds of note, and the release
notes say so. Only two of them existed.

buildCompletedWorkout read `active.note` and carried it onto the finished
workout — with a test covering it — but nothing anywhere in the app ever wrote
that field. The only way to get a session note was to open a past workout in
history and type one there, which is a different and much smaller feature than
"notes you can write during a workout". So the workout screen now has one, next
to the finish button: wrapping up is when you know how the session went. It
writes `active.note`, which makes the path that was already there and already
tested actually reachable.

The history one then threw the text away. It saved on blur only, and Escape, the
Android back gesture and swipe-to-dismiss all close a sheet without ever moving
focus out of the textarea — type a note, press Escape, gone. It now flushes on
unmount as well, through a ref, because a cleanup closes over the note from its
own render, which is the empty string it started with. Writing only happens when
the text actually changed, and deleting the workout from that same sheet leaves
nothing to write to, which the guard covers.

The new sheet has a Save button rather than repeating the blur trick.

Also adds both note sheets to Workout.test.jsx's module mock. Workout.jsx reads
sessionNoteSheet during render, so a missing export there is a render crash
rather than a quiet no-op — which is exactly how this was caught.
This commit is contained in:
Duarte Santos committed 2026-08-25 21:55:22 +02:00
1 parent 287550df6c
commit 3d30edddad
16 files changed
+155 -3

No files matched your search

+2
View File
@@ -687,6 +687,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Sitzhöhe, Pin-Position, ein Hinweis zur Ausführung — bei jedem Training sichtbar.',
'From {0}:': 'Vom {0}:',
'Session note': 'Notiz zum Training',
'Add session note': 'Notiz zum Training',
'Edit session note': 'Notiz bearbeiten',
'How the session went as a whole.': 'Wie das Training insgesamt lief.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-Pause trainiert immer als ein Aufwärmsatz mit dieser Wiederholungszahl und ein Rest-Pause-Arbeitssatz — „Sätze“ wird nicht verwendet.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Altura del asiento, posición del pin, una indicación técnica — visible en cada sesión.',
'From {0}:': 'Del {0}:',
'Session note': 'Nota de la sesión',
'Add session note': 'Añadir nota de la sesión',
'Edit session note': 'Editar nota de la sesión',
'How the session went as a whole.': 'Cómo fue la sesión en conjunto.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause siempre entrena como una serie de calentamiento con estas reps y una serie de trabajo rest-pause — «Series» no se usa.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Hauteur du siège, position de la goupille, un rappel technique — visible à chaque séance.',
'From {0}:': 'Du {0} :',
'Session note': 'Note de séance',
'Add session note': 'Ajouter une note de séance',
'Edit session note': 'Modifier la note de séance',
'How the session went as a whole.': 'Comment la séance s’est passée dans l’ensemble.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Le rest-pause s’entraîne toujours comme une série d’échauffement à ce nombre de reps, puis une série de travail rest-pause — « Séries » n’est pas utilisé.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'सीट की ऊँचाई, पिन की जगह, तकनीक का सुझाव — हर कसरत में दिखता है।',
'From {0}:': '{0} से:',
'Session note': 'सत्र का नोट',
'Add session note': 'सत्र का नोट जोड़ें',
'Edit session note': 'सत्र का नोट बदलें',
'How the session went as a whole.': 'पूरा सत्र कैसा रहा।',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'रेस्ट-पॉज़ हमेशा इसी रेप्स संख्या के एक वार्म-अप सेट और एक रेस्ट-पॉज़ वर्क सेट के रूप में किया जाता है — “सेट” का उपयोग नहीं होता।'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Altezza del sedile, posizione del pin, un promemoria tecnico — visibile a ogni sessione.',
'From {0}:': 'Del {0}:',
'Session note': 'Nota della sessione',
'Add session note': 'Aggiungi nota della sessione',
'Edit session note': 'Modifica nota della sessione',
'How the session went as a whole.': 'Com’è andata la sessione nel complesso.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Il rest-pause si allena sempre come una serie di riscaldamento a queste ripetizioni e una serie di lavoro rest-pause — “Serie” non viene usato.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': '시트 높이, 핀 위치, 자세 팁 — 매 운동마다 표시됩니다.',
'From {0}:': '{0}에서:',
'Session note': '운동 메모',
'Add session note': '운동 메모 추가',
'Edit session note': '운동 메모 편집',
'How the session went as a whole.': '이번 운동이 전체적으로 어땠는지.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': '레스트포즈는 항상 이 횟수의 워밍업 세트 하나와 레스트포즈 작업 세트 하나로 진행됩니다 — ‘세트’는 사용하지 않습니다.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Wysokość siedziska, pozycja bolca, wskazówka techniczna — widoczne w każdej sesji.',
'From {0}:': 'Z {0}:',
'Session note': 'Notatka do sesji',
'Add session note': 'Dodaj notatkę do sesji',
'Edit session note': 'Edytuj notatkę do sesji',
'How the session went as a whole.': 'Jak przebiegła cała sesja.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause zawsze trenuje się jako jedna seria rozgrzewkowa o tej liczbie powtórzeń i jedna seria robocza rest-pause — „Serie” nie są używane.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Altura do banco, posição do pino, uma indicação técnica — visível em todas as sessões.',
'From {0}:': 'De {0}:',
'Session note': 'Nota da sessão',
'Add session note': 'Adicionar nota da sessão',
'Edit session note': 'Editar nota da sessão',
'How the session went as a whole.': 'Como correu a sessão no seu todo.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'O rest-pause treina sempre como uma série de aquecimento com estas repetições e uma série de trabalho rest-pause — «Séries» não é usado.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Высота сиденья, положение фиксатора, подсказка по технике — видно на каждой тренировке.',
'From {0}:': 'От {0}:',
'Session note': 'Заметка о тренировке',
'Add session note': 'Добавить заметку',
'Edit session note': 'Изменить заметку',
'How the session went as a whole.': 'Как прошла тренировка в целом.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause всегда выполняется как один разминочный подход с этим числом повторений и один рабочий подход rest-pause — «Подходы» не используются.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': 'Sehpa yüksekliği, pim konumu, bir teknik ipucu — her antrenmanda görünür.',
'From {0}:': '{0} tarihinden:',
'Session note': 'Antrenman notu',
'Add session note': 'Antrenman notu ekle',
'Edit session note': 'Antrenman notunu düzenle',
'How the session went as a whole.': 'Antrenmanın genel olarak nasıl geçtiği.',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause her zaman bu tekrar sayısında bir ısınma seti ve bir rest-pause çalışma seti olarak çalışılır — “Setler” kullanılmaz.'
}
+2
View File
@@ -670,6 +670,8 @@ export default {
'Seat height, pin position, a form cue — shown every session.': '座椅高度、插销位置、动作要点 —— 每次训练都会显示。',
'From {0}:': '来自 {0}:',
'Session note': '训练备注',
'Add session note': '添加训练备注',
'Edit session note': '编辑训练备注',
'How the session went as a whole.': '这次训练整体感觉如何。',
'Rest-pause always trains as one warm-up set at this rep count, then one rest-pause work set — "Sets" is not used.': 'Rest-pause 始终按这个次数练一个热身组,再加一个 rest-pause 正式组 —— 不使用“组数”。'
}