From 41f04ff62cc2c5f7a5c0d6fceaf6a2d4815d7349 Mon Sep 17 00:00:00 2001 From: tisachi Date: Thu, 5 Nov 2026 22:41:52 +0100 Subject: [PATCH] App: fix typow pickera pod tsc -b - WHEEL_SPECS po Exclude i SET_COLUMNS pod SetNumericKey (przyczyna FAIL builda na stagingu; testy unit/e2e nie typuja src) --- app/src/pages/plans/plan-editor/ExerciseEditor.tsx | 4 ++-- app/src/pages/plans/plan-editor/setWheelSpecs.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/pages/plans/plan-editor/ExerciseEditor.tsx b/app/src/pages/plans/plan-editor/ExerciseEditor.tsx index d19af69..1833709 100644 --- a/app/src/pages/plans/plan-editor/ExerciseEditor.tsx +++ b/app/src/pages/plans/plan-editor/ExerciseEditor.tsx @@ -7,7 +7,7 @@ import { MUSCLE_COLORS, muscleName } from '../../../lib/labels'; import type { Exercise, ExerciseProgressPoint, LatestExerciseResult } from '../../../api/types'; import type { EditorExercise, EditorSet } from './types'; import { ExerciseResultsPanel } from './ExerciseResultsPanel'; -import { WHEEL_SPECS } from './setWheelSpecs'; +import { WHEEL_SPECS, type SetNumericKey } from './setWheelSpecs'; /** Szybkie podsumowanie serii wg pierwszej: „3×10 @ 20 kg · RIR 2”; brak obciążenia = masa ciała. */ function setsSummary(sets: EditorSet[], bodyweightLabel: string): string { @@ -29,7 +29,7 @@ const SET_INPUT_CLS = Komórka serii to picker kółkowy (bottom sheet jak alarm w iPhonie) z przełącznikiem na ręczne wpisanie wartości („Wpisz”). */ const SET_COLUMNS: { - key: keyof EditorSet; + key: SetNumericKey; labelKey: string; advanced?: boolean; }[] = [ diff --git a/app/src/pages/plans/plan-editor/setWheelSpecs.ts b/app/src/pages/plans/plan-editor/setWheelSpecs.ts index 08c3ec2..be5ebfc 100644 --- a/app/src/pages/plans/plan-editor/setWheelSpecs.ts +++ b/app/src/pages/plans/plan-editor/setWheelSpecs.ts @@ -6,6 +6,9 @@ import type { EditorSet } from './types'; wartości spoza zakresu koła trafiają do najbliższej — ręczny tryb „Wpisz” obsługuje dokładne/egzotyczne liczby. */ +/** Klucze liczbowe serii (bez opcjonalnego `id` wiersza). */ +export type SetNumericKey = Exclude; + const NONE: WheelOption = { value: '', label: '—' }; const range = (from: number, to: number): WheelOption[] => Array.from({ length: to - from + 1 }, (_, i) => ({ @@ -103,7 +106,7 @@ export const RIR_WHEEL: WheelFieldSpec = { sanitizeManual: (raw) => raw.replace(/\D/g, '').slice(0, 2), }; -export const WHEEL_SPECS: Record = { +export const WHEEL_SPECS: Record = { reps: REPS_WHEEL, loadKg: LOAD_WHEEL, restSec: REST_WHEEL,