From efbf57e6bc5a1c1d133aa68393ae692aa1c4c7fe Mon Sep 17 00:00:00 2001 From: ronalds Date: Thu, 27 Nov 2025 03:01:06 -0300 Subject: [PATCH] v1.0.67 Backend / v1.0.67 Frontend - Ordenamiento consistente de checklists e inspecciones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Frontend (1.0.67): - 🔧 Checklists e inspecciones se ordenan por ID descendente (más recientes primero) - Mantiene posición de elementos después de editar/actualizar - Ya no se mueven al final de la lista tras modificaciones - Orden consistente en todas las recargas de datos - Mejora UX al preservar contexto visual del usuario Backend (1.0.67): - Sin cambios (mantiene versión actual) --- frontend/package.json | 2 +- frontend/src/App.jsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 4c72089..a041182 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "checklist-frontend", "private": true, - "version": "1.0.66", + "version": "1.0.67", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index dbd0053..edab63e 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -233,7 +233,11 @@ function DashboardPage({ user, setUser }) { if (checklistsRes.ok) { const checklistsData = await checklistsRes.json() console.log('Checklists data:', checklistsData) - setChecklists(Array.isArray(checklistsData) ? checklistsData : []) + // Ordenar por ID descendente para mantener orden consistente + const sortedChecklists = Array.isArray(checklistsData) + ? checklistsData.sort((a, b) => b.id - a.id) + : [] + setChecklists(sortedChecklists) } else { console.error('Error loading checklists:', checklistsRes.status) setChecklists([]) @@ -251,7 +255,11 @@ function DashboardPage({ user, setUser }) { if (inspectionsRes.ok) { const inspectionsData = await inspectionsRes.json() console.log('Inspections data:', inspectionsData) - setInspections(Array.isArray(inspectionsData) ? inspectionsData : []) + // Ordenar por ID descendente para mantener orden consistente + const sortedInspections = Array.isArray(inspectionsData) + ? inspectionsData.sort((a, b) => b.id - a.id) + : [] + setInspections(sortedInspections) } else { console.error('Error loading inspections:', inspectionsRes.status) setInspections([])