From 8620a0e71f862689bd4132d4acefceebce2f39ca Mon Sep 17 00:00:00 2001 From: Carlos Tello Date: Thu, 29 Oct 2026 23:11:29 -0300 Subject: [PATCH] fix(ui/ux): optimize tablet aspect ratio, single-screen landscape fit and portrait sticky dock --- frontend/src/styles/base.css | 96 +++-- frontend/src/views/ControlPostView.tsx | 569 ++++++++++++------------- 2 files changed, 349 insertions(+), 316 deletions(-) diff --git a/frontend/src/styles/base.css b/frontend/src/styles/base.css index 64ed939..841f272 100644 --- a/frontend/src/styles/base.css +++ b/frontend/src/styles/base.css @@ -633,9 +633,9 @@ button:disabled, .btn:disabled, .touch-button:disabled { .desktop-cockpit-grid { flex: 1; display: grid; - grid-template-columns: 240px 1fr 220px; - gap: 12px; - padding: 10px 14px; + grid-template-columns: 225px 1fr 215px; + gap: 8px; + padding: 6px 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; background-color: var(--bg-main, #0B1120); @@ -644,25 +644,25 @@ button:disabled, .btn:disabled, .touch-button:disabled { .desktop-groupbox { background-color: var(--bg-surface, #1E293B); border: 1px solid var(--border, #334155); - border-radius: 10px; - padding: 12px 14px; + border-radius: 8px; + padding: 8px 10px; display: flex; flex-direction: column; - gap: 10px; + gap: 6px; box-sizing: border-box; box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.3)); } .desktop-groupbox-title { - font-size: 0.85rem; - font-weight: 700; + font-size: 0.8rem; + font-weight: 800; color: var(--text-2, #93C5FD); letter-spacing: 0.03em; text-transform: uppercase; - margin-bottom: 2px; + margin-bottom: 1px; display: flex; align-items: center; - gap: 6px; + gap: 5px; } .desktop-input { @@ -670,9 +670,9 @@ button:disabled, .btn:disabled, .touch-button:disabled { border: 1px solid var(--border-strong, #475569); border-radius: 6px; color: var(--text-1, #F8FAFC); - font-size: 0.92rem; - padding: 6px 10px; - min-height: 42px; + font-size: 0.88rem; + padding: 4px 8px; + min-height: 36px; width: 100%; box-sizing: border-box; outline: none; @@ -689,9 +689,9 @@ button:disabled, .btn:disabled, .touch-button:disabled { border: 1px solid var(--border-strong, #475569); border-radius: 6px; color: var(--text-1, #F8FAFC); - font-size: 0.92rem; - padding: 6px 10px; - min-height: 42px; + font-size: 0.88rem; + padding: 4px 8px; + min-height: 36px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; } @@ -702,24 +702,24 @@ button:disabled, .btn:disabled, .touch-button:disabled { } .desktop-label { - font-size: 0.82rem; - font-weight: 600; + font-size: 0.8rem; + font-weight: 700; color: var(--text-2, #CBD5E1); white-space: nowrap; } .desktop-btn-action { - font-size: 0.85rem; + font-size: 0.82rem; font-weight: 700; - padding: 6px 12px; - min-height: 42px; + padding: 5px 10px; + min-height: 36px; border-radius: 6px; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; - gap: 6px; + gap: 5px; white-space: nowrap; transition: background-color 0.15s ease, transform 0.05s ease, filter 0.15s ease, box-shadow 0.15s ease; color: #FFFFFF; @@ -786,10 +786,10 @@ button:disabled, .btn:disabled, .touch-button:disabled { .desktop-avatar-box { width: 100%; - height: 120px; + height: 75px; background-color: var(--input-bg, #091124); border: 1px dashed var(--border-strong, #334155); - border-radius: 8px; + border-radius: 6px; display: flex; align-items: center; justify-content: center; @@ -801,18 +801,52 @@ button:disabled, .btn:disabled, .touch-button:disabled { ============================================================================== */ @media (max-width: 1180px) and (min-width: 961px) { .desktop-cockpit-grid { - grid-template-columns: 220px 1fr 200px !important; - gap: 10px !important; - padding: 8px 10px !important; + grid-template-columns: 210px 1fr 195px !important; + gap: 8px !important; + padding: 6px 8px !important; } } -/* Modo Vertical (Portrait) en Tablets o Pantallas Estrechas */ -@media (max-width: 960px) { +/* Modo Vertical (Portrait) en Tablets (Samsung Galaxy Tab 800x1340) -> 2 Columnas */ +@media (max-width: 960px) and (min-width: 680px) { + .desktop-cockpit-grid { + grid-template-columns: 270px 1fr !important; + gap: 8px !important; + padding: 8px 10px !important; + padding-bottom: 64px !important; + } + .desktop-column-actions { + grid-column: span 2; + } +} + +/* Modo Smartphone o Pantalla Muy Estrecha (<680px) */ +@media (max-width: 679px) { .desktop-cockpit-grid { grid-template-columns: 1fr !important; - gap: 14px !important; - padding: 10px 12px !important; + gap: 10px !important; + padding: 8px 10px !important; + padding-bottom: 64px !important; + } +} + +/* Dock de Acciones Rápidas para Modo Vertical (Portrait) */ +.tablet-portrait-dock { + display: none; +} + +@media (max-width: 960px) { + .tablet-portrait-dock { + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + background-color: var(--bg-surface); + border-top: 1px solid var(--border-strong); + position: sticky; + bottom: 0; + z-index: 100; + box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35); } } diff --git a/frontend/src/views/ControlPostView.tsx b/frontend/src/views/ControlPostView.tsx index 9dae3f9..17ebe02 100644 --- a/frontend/src/views/ControlPostView.tsx +++ b/frontend/src/views/ControlPostView.tsx @@ -1509,58 +1509,60 @@ export const ControlPostView: React.FC = () => { )} - {/* Groupbox Cámaras / Imágenes */} -
+ {/* Groupbox Cámaras / Imágenes (Compacto en 2 ranuras para encajar en 800px de alto) */} +
Cámaras / Imágenes - {/* Foto Persona BD */} -
-
Foto (BD):
-
- {fotoPersonaUrl ? ( - Persona - ) : ( -
- - - - Foto Persona -
- )} +
+ {/* Foto Persona BD */} +
+
Foto (BD):
+
+ {fotoPersonaUrl ? ( + Persona + ) : ( +
+ + + + Persona +
+ )} +
+
- -
- {/* Foto DNI Frente */} -
-
DNI (Frente):
-
- {fotoDniUrl ? ( - DNI - ) : ( -
- - - - Foto DNI -
- )} + {/* Foto DNI Frente */} +
+
DNI (Frente):
+
+ {fotoDniUrl ? ( + DNI + ) : ( +
+ + + + DNI +
+ )} +
+
-
@@ -1568,19 +1570,19 @@ export const ControlPostView: React.FC = () => { {/* ========================================================================= COLUMNA 2: DATOS PERSONA, UBICACIÓN/DESTINO, OBSERVACIONES Y DOCUMENTACIÓN ========================================================================= */} -
+
{/* Groupbox: Datos Persona */} -
+
Datos Persona - {/* Fila 1: Ingreso / Doc / Nro Doc / Radios Conductor - Peatón */} -
+ {/* Fila 1: Ingreso / Doc / Nro Doc / Radios Conductor - Peatón (Fluido con flex-wrap para que Nro Doc nunca se aplaste) */} +
Ingreso / Doc: -
+
Nro Doc: { const raw = e.target.value; @@ -1625,30 +1627,30 @@ export const ControlPostView: React.FC = () => { }} />
-
-
{/* Fila 2: Nombre / Apellido */} -
+
Nombre: { />
- {/* Fila 3: Entidad/Empresa / Adultos */} -
+ {/* Fila 3: Entidad/Empresa / Adultos / Menores */} +
Entidad/Empresa: { type="number" min="1" className="desktop-input" - style={{ width: '65px', textAlign: 'center' }} + style={{ width: '55px', textAlign: 'center' }} value={form.cantidad_ocupantes} onChange={(e) => setForm((prev) => ({ ...prev, cantidad_ocupantes: Math.max(1, parseInt(e.target.value) || 1) }))} /> + Menores: + setForm((prev) => ({ ...prev, cantidad_menores: Math.max(0, parseInt(e.target.value) || 0) }))} + />
- {/* Fila 4: Patente / Menores */} -
+ {/* Fila 4: Patente y Botonera Operativa Integrada */} +
Patente: -
+
setForm((prev) => ({ ...prev, patente: e.target.value.toUpperCase() }))} onKeyDown={(e) => { @@ -1706,116 +1717,91 @@ export const ControlPostView: React.FC = () => {
- Menores: - setForm((prev) => ({ ...prev, cantidad_menores: Math.max(0, parseInt(e.target.value) || 0) }))} - /> -
- {/* Fila 5: Botonera Operativa */} -
- +
+ - {isModoSalida ? ( - <> - - - - - - ) : ( - <> - - - - - - )} + {!isModoSalida ? ( + <> + + + + ) : ( + <> + + + + )} + + +
{/* Dos Cajas Lado a Lado: Ubicación / Destino + Observaciones */} -
+
{/* Ubicación / Destino */} -
+
Ubicación / Destino -
+
Lote: setIsLotModalOpen(true)} style={{ cursor: 'pointer' }} @@ -1824,7 +1810,7 @@ export const ControlPostView: React.FC = () => { type="button" className="desktop-btn-action desktop-btn-blue" onClick={() => setIsLotModalOpen(true)} - style={{ whiteSpace: 'nowrap' }} + style={{ whiteSpace: 'nowrap', minHeight: '36px', padding: '0 0.65rem' }} > Seleccionar... @@ -1832,24 +1818,10 @@ export const ControlPostView: React.FC = () => { type="button" onClick={clearLot} title="Limpiar Lote" - style={{ - background: 'none', - border: '1px solid #475569', - borderRadius: '4px', - padding: '0.35rem 0.5rem', - cursor: 'pointer', - display: 'flex', - alignItems: 'center', - }} + className="desktop-btn-action desktop-btn-slate" + style={{ padding: '0 0.55rem', minHeight: '36px', fontSize: '0.9rem' }} > - Limpiar { - (e.target as HTMLElement).style.display = 'none'; - }} - /> + 🧹
@@ -1868,9 +1840,9 @@ export const ControlPostView: React.FC = () => { : 'var(--border-subtle)' }`, borderRadius: '6px', - padding: '0.45rem', + padding: '0.3rem 0.5rem', textAlign: 'center', - fontSize: '0.85rem', + fontSize: '0.82rem', fontWeight: 700, }} > @@ -1879,11 +1851,11 @@ export const ControlPostView: React.FC = () => {
{/* Observaciones */} -
+
Observaciones