diff --git a/app/src/pages/DayExecution.tsx b/app/src/pages/DayExecution.tsx index eec5cae..229fe01 100644 --- a/app/src/pages/DayExecution.tsx +++ b/app/src/pages/DayExecution.tsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState, type ReactNode } from 'react'; import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { useQueryClient } from '@tanstack/react-query'; -import { Check, ChevronDown, Plus, Trash2 } from 'lucide-react'; +import { Check, ChevronDown, MessageSquare, Plus, Trash2 } from 'lucide-react'; import { abandonSession, addSessionExercise, @@ -248,6 +248,13 @@ function SetRow({ ))}

)} + {/* komentarz trenujący zapisany przy serii (ten sam co w historii i u trenera) */} + {set.note && ( +

+

+ )}
{done && set.reps != null && ( diff --git a/app/src/pages/plans/PlanDetail.tsx b/app/src/pages/plans/PlanDetail.tsx index 7be2fd3..59196fd 100644 --- a/app/src/pages/plans/PlanDetail.tsx +++ b/app/src/pages/plans/PlanDetail.tsx @@ -130,17 +130,17 @@ export default function PlanDetail() { ] : // plan zamknięty (ukończony/porzucony) — wznowienie tylko dla // właściciela (trener nie wznawia planów podopiecznych) - (isOwner - ? [ - { - label: t('actions.reopen'), - icon: RotateCcw, - variant: 'secondary' as const, - disabled: busy || hasOtherActivePlan, - onClick: () => setConfirm('reopen'), - }, - ] - : [])), + isOwner + ? [ + { + label: t('actions.reopen'), + icon: RotateCcw, + variant: 'secondary' as const, + disabled: busy || hasOtherActivePlan, + onClick: () => setConfirm('reopen'), + }, + ] + : []), // udostępnianie = tylko właściciel planu ...(isOwner ? [ diff --git a/app/src/pages/plans/plan-editor/ExerciseEditor.tsx b/app/src/pages/plans/plan-editor/ExerciseEditor.tsx index 989809d..a64f4d2 100644 --- a/app/src/pages/plans/plan-editor/ExerciseEditor.tsx +++ b/app/src/pages/plans/plan-editor/ExerciseEditor.tsx @@ -93,7 +93,10 @@ export function ExerciseEditor({ nie zostają rozbite między wiersze */} {exerciseMeta && ( - + {muscleName(exerciseMeta.primaryMuscle)} )} diff --git a/app/test/DayExecution.test.tsx b/app/test/DayExecution.test.tsx index ef51441..af1900d 100644 --- a/app/test/DayExecution.test.tsx +++ b/app/test/DayExecution.test.tsx @@ -749,6 +749,9 @@ describe('Kolejka serii w sesji', () => { await user.type(screen.getByRole('textbox', { name: 'Komentarz do serii' }), 'ostatnia seria ciężka'); await user.click(screen.getByRole('button', { name: 'Zapisz' })); + // komentarz musi być widoczny też na wierszu serii (dowód zapisu), nie tylko w oknie + expect(await screen.findByText('ostatnia seria ciężka')).toBeInTheDocument(); + // mock utrzymuje zapis (jak serwer) — ss-1 jest już uzupełniona, wracamy do niej // przez „Edytuj”, by sprawdzić, że komentarz przeżył zapis await user.click(screen.getByRole('button', { name: 'Edytuj' })); diff --git a/app/test/e2e/day-execution.spec.ts b/app/test/e2e/day-execution.spec.ts index 9a46686..c2fd23d 100644 --- a/app/test/e2e/day-execution.spec.ts +++ b/app/test/e2e/day-execution.spec.ts @@ -121,6 +121,8 @@ test('okno „Uzupełnij serię” zapisuje opcjonalny komentarz serii', async ( await page.getByRole('button', { name: 'Zapisz' }).click(); const req = await patch; expect(JSON.parse(req.postData() ?? '')).toMatchObject({ note: 'plecy bolały' }); + // zapisany komentarz widoczny na wierszu serii (dowód, że nie zniknął) + await expect(page.getByText('plecy bolały')).toBeVisible(); }); test('przycisk „Norma spełniona” wypełnia wartości z planu', async ({ page }) => {