From 190b4f6f34bb20ede159741b6d6abe8a3fe814dd Mon Sep 17 00:00:00 2001 From: javier Date: Wed, 8 Jul 2026 10:50:20 +0200 Subject: [PATCH] =?UTF-8?q?feat(ui):=20quitar=20pesta=C3=B1a=20Fases=20+?= =?UTF-8?q?=20selector=20de=20plantilla=20al=20inspeccionar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ProjectDetail: pestañas reducidas a Features | Incidencias (Features por defecto); PhasesSection eliminada. - InspectionForm en dos pasos: 1) selector de plantillas asignadas al proyecto (la de la feature marcada como sugerida ★, opción de inspección libre), 2) formulario dinámico. Enlace "Cambiar plantilla" para volver. Co-Authored-By: Claude Sonnet 4.6 --- src/screens/InspectionFormScreen.tsx | 105 +++++++++++++++++++++++-- src/screens/ProjectDetailScreen.tsx | 6 +- src/screens/sections/PhasesSection.tsx | 93 ---------------------- 3 files changed, 100 insertions(+), 104 deletions(-) delete mode 100644 src/screens/sections/PhasesSection.tsx diff --git a/src/screens/InspectionFormScreen.tsx b/src/screens/InspectionFormScreen.tsx index bd3d030..70501b6 100644 --- a/src/screens/InspectionFormScreen.tsx +++ b/src/screens/InspectionFormScreen.tsx @@ -8,9 +8,9 @@ */ import { NativeStackScreenProps } from '@react-navigation/native-stack'; import React, { useCallback, useEffect, useState } from 'react'; -import { Alert, ScrollView, StyleSheet, Switch, Text, View } from 'react-native'; +import { Alert, ScrollView, StyleSheet, Switch, Text, TouchableOpacity, View } from 'react-native'; import { Template } from '../api/types'; -import { getTemplate } from '../db/repositories'; +import { getTemplates } from '../db/repositories'; import { createInspection } from '../sync/mutations'; import { RootStackParamList } from '../navigation/types'; import { @@ -75,7 +75,12 @@ function groupFields(fields: NormField[]): { group: string; items: NormField[] } const RESULTS = ['pass', 'fail', 'na'] as const; export function InspectionFormScreen({ route, navigation }: Props) { - const { featureId, featureName, templateId } = route.params; + const { featureId, featureName, templateId: suggestedId } = route.params; + + // Paso 1: elegir plantilla (las asignadas al proyecto llegan en el bundle). + // Paso 2: rellenar el formulario. `chosen` = false → aún en el selector. + const [available, setAvailable] = useState([]); + const [chosen, setChosen] = useState(false); const [template, setTemplate] = useState