Plany: usunieto kolumne Trudnosc z tabeli serii (trudnosc uzupelnia cwiczacy dopiero po wykonaniu serii, w sesji)

This commit is contained in:
tisachi
2026-09-13 22:26:47 +02:00
parent 07e9adabe3
commit d466bc4e50
3 changed files with 26 additions and 3 deletions

View File

@@ -18,12 +18,13 @@ function setsSummary(sets: EditorSet[]): string {
const SET_INPUT_CLS =
'w-full rounded-[10px] border border-line bg-input px-2.5 py-1.5 text-[0.9rem] text-ink shadow-(--inset-shadow) focus:border-accent-text focus:ring-[3px] focus:ring-accent/18 focus:outline-none';
/* Trudności NIE planujemy — to pole uzupełnia ćwiczący dopiero po wykonaniu serii
(w oknie „Uzupełnij serię” podczas sesji). */
const SET_COLUMNS: { key: keyof EditorSet; label: string; inputMode: 'numeric' | 'decimal' }[] = [
{ key: 'reps', label: 'Powt.', inputMode: 'numeric' },
{ key: 'loadKg', label: 'Obciążenie', inputMode: 'decimal' },
{ key: 'restSec', label: 'Przerwa', inputMode: 'numeric' },
{ key: 'rir', label: 'RIR', inputMode: 'numeric' },
{ key: 'difficulty', label: 'Trudność', inputMode: 'numeric' },
];
/* Ćwiczenie dnia: nazwa + zmiana kolejności + Wyniki/Usuń + kompaktowa tabela
@@ -120,7 +121,7 @@ export function ExerciseEditor({
{/* relative: sr-only (absolute) w nagłówku nie rozlewa dokumentu poza scroll container */}
<div className="relative overflow-x-auto overscroll-contain">
<table className="w-full min-w-[460px] border-separate border-spacing-0">
<table className="w-full min-w-[380px] border-separate border-spacing-0">
<thead>
<tr>
<th className="w-8 px-1 py-1 text-center text-[10.5px] font-bold uppercase tracking-[0.11em] text-dim">

View File

@@ -28,7 +28,8 @@ export const DEFAULT_SET: EditorSet = {
loadKg: '20',
restSec: '90',
rir: '2',
difficulty: '3',
// trudności nie planujemy — uzupełnia ją ćwiczący po wykonaniu serii (sesja)
difficulty: '',
};
export function emptyWeek(): EditorWeek {

View File

@@ -331,6 +331,27 @@ describe('PlanEditor — data startu i menu kontekstowe', () => {
expect(screen.getByText(/Tylko sprzęt siłowni/)).toBeInTheDocument();
});
it('krok 2: kolumna „Trudność” nie jest planowana (uzupełniana dopiero po wykonaniu serii)', async () => {
mockApi({});
const user = userEvent.setup();
renderApp();
await loginAndOpenNewPlan(user);
await user.type(screen.getByPlaceholderText('np. Plan masowy 8-tygodniowy'), 'Plan');
await user.click(screen.getByRole('button', { name: 'Dalej' }));
await user.click(screen.getByRole('button', { name: 'Poniedziałek' }));
await user.click(screen.getByRole('button', { name: 'dodaj ćwiczenie…' }));
await user.click(await screen.findByRole('option', { name: /Przysiady/ }));
// tabela serii: # / Powt. / Obciążenie / Przerwa / RIR — bez „Trudności”
expect(screen.getByRole('columnheader', { name: 'Powt.' })).toBeInTheDocument();
expect(screen.getByRole('columnheader', { name: 'Obciążenie' })).toBeInTheDocument();
expect(screen.getByRole('columnheader', { name: 'Przerwa' })).toBeInTheDocument();
expect(screen.getByRole('columnheader', { name: 'RIR' })).toBeInTheDocument();
expect(screen.queryByRole('columnheader', { name: 'Trudność' })).not.toBeInTheDocument();
expect(screen.queryByRole('textbox', { name: 'Seria 1: Trudność' })).not.toBeInTheDocument();
});
it('wizard: pusta lista siłowni — informacja z linkiem do /gyms', async () => {
mockApi({});
const user = userEvent.setup();