fix(ui): remover sidebar innecesario, desduplicar nombres de pestañas y reincorporar selector de tema claro/oscuro

This commit is contained in:
Carlos Tello
2026-10-14 21:35:42 -03:00
parent b09f8e4b5e
commit 918b87c645
2 changed files with 98 additions and 53 deletions
+56 -3
View File
@@ -725,11 +725,64 @@ button:disabled, .btn:disabled, .touch-button:disabled {
}
@media (max-width: 880px) {
.desktop-sidebar {
display: none !important;
}
.desktop-cockpit-grid {
grid-template-columns: 1fr !important;
}
}
/* Soporte de Tema Claro para Cockpit de Escritorio */
[data-theme="light"] .desktop-shell {
background-color: #F1F5F9;
color: #0F172A;
}
[data-theme="light"] .desktop-top-header {
background-color: #FFFFFF;
border-bottom: 1px solid #CBD5E1;
}
[data-theme="light"] .desktop-tab-btn {
color: #475569;
}
[data-theme="light"] .desktop-tab-btn.active {
color: #0284C7;
border-bottom: 3px solid #0284C7;
}
[data-theme="light"] .desktop-cockpit-grid {
background-color: #F1F5F9;
}
[data-theme="light"] .desktop-groupbox {
background-color: #FFFFFF;
border: 1px solid #CBD5E1;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .desktop-groupbox-title {
color: #475569;
}
[data-theme="light"] .desktop-input,
[data-theme="light"] .desktop-select {
background-color: #F8FAFC;
border: 1px solid #CBD5E1;
color: #0F172A;
}
[data-theme="light"] .desktop-input:focus,
[data-theme="light"] .desktop-select:focus {
border-color: #0284C7;
background-color: #FFFFFF;
}
[data-theme="light"] .desktop-label {
color: #334155;
}
[data-theme="light"] .desktop-avatar-box {
background-color: #F8FAFC;
border: 1px dashed #CBD5E1;
}
+42 -50
View File
@@ -8,6 +8,7 @@ import { workstationApi, WorkstationListItem } from '../api/workstationApi';
import { accessApi } from '../api/accessApi';
import { hardwareApi } from '../api/hardwareApi';
import { useWebSocket } from '../hooks/useWebSocket';
import { useTheme } from '../hooks/useTheme';
import { CameraScannerModal } from '../components/scanner/CameraScannerModal';
import { CompanionsRegistrationModal } from '../components/modals/CompanionsRegistrationModal';
import { ExitVerificationModal } from '../components/modals/ExitVerificationModal';
@@ -34,7 +35,7 @@ export interface LaneTab {
export const ControlPostView: React.FC = () => {
const { user, workstation, setWorkstation, logout } = useAuth();
// Theme is managed via base.css / document element
const { theme, toggleTheme } = useTheme();
// Configuración de Estación y Módulos
const [config, setConfig] = useState<WorkstationConfig | null>(null);
@@ -709,49 +710,6 @@ export const ControlPostView: React.FC = () => {
return (
<div className="desktop-shell">
{/* Barra Lateral Izquierda (Iconos de Escritorio) */}
<aside className="desktop-sidebar">
<div className="desktop-rail-item active" title="Puesto de Control">
<img src="/icons/puesto-control.ico" alt="Control" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Personas">
<img src="/icons/personas.ico" alt="Personas" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Grupos">
<img src="/icons/grupos.ico" alt="Grupos" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Identificaciones">
<img src="/icons/identificaciones.ico" alt="Identificaciones" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Lotes">
<img src="/icons/lotes.ico" alt="Lotes" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Vehículos">
<img src="/icons/autos.ico" alt="Autos" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Visitas y Preautorizados">
<img src="/icons/vis_preauto.ico" alt="Preautorizados" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Permisos">
<img src="/icons/permisos.ico" alt="Permisos" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Módulos de Hardware">
<img src="/icons/modulos.ico" alt="Modulos" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Movimientos">
<img src="/icons/movimientos.ico" alt="Movimientos" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Reportes">
<img src="/icons/reportes.ico" alt="Reportes" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" title="Usuarios">
<img src="/icons/usuarios.ico" alt="Usuarios" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
<div className="desktop-rail-item" style={{ marginTop: 'auto' }} title="Sistema / Configuración">
<img src="/icons/sistema.ico" alt="Sistema" onError={(e) => { (e.target as HTMLElement).style.display = 'none'; }} />
</div>
</aside>
{/* Área Principal */}
<main className="desktop-main-area">
{/* Cabecera Superior: Usuario + Logo Infinito + Tabs Entrada/Salida + Puesto + Reloj */}
@@ -794,9 +752,20 @@ export const ControlPostView: React.FC = () => {
const isActive = tab.key === activeLaneTabKey;
const isEntry = tab.direction === 'ENTRY';
const dotColor = isEntry ? '#10B981' : '#EF4444';
const tabLabel = isEntry
? `ENTRADA VISITAS${tab.name ? ` (${tab.name})` : ''}`
: `SALIDA DE VISITAS${tab.name ? ` (${tab.name})` : ''}`;
let tabLabel = isEntry ? 'ENTRADA VISITAS' : 'SALIDA DE VISITAS';
if (tab.name) {
const norm = tab.name.trim().toUpperCase();
if (
norm !== 'ENTRADA' &&
norm !== 'SALIDA' &&
norm !== 'ENTRADA VISITAS' &&
norm !== 'SALIDA DE VISITAS' &&
!norm.includes('ENTRADA') &&
!norm.includes('SALIDA')
) {
tabLabel += ` (${tab.name})`;
}
}
return (
<button
@@ -821,8 +790,8 @@ export const ControlPostView: React.FC = () => {
})}
</div>
{/* Reloj y Estado Puesto */}
<div style={{ marginLeft: 'auto', display: 'flex', alignItems: 'center', gap: '1rem', fontSize: '0.85rem' }}>
{/* Reloj, Puesto, Botón Tema y Pantalla Completa */}
<div style={{ marginLeft: 'auto', display: 'flex', alignItems: 'center', gap: '0.75rem', fontSize: '0.85rem' }}>
{actionSuccess && (
<span style={{ color: '#10B981', fontWeight: 600, animation: 'fadeIn 0.2s' }}>
{actionSuccess}
@@ -852,6 +821,29 @@ export const ControlPostView: React.FC = () => {
<span>🖥️ {workstation}</span>
<span style={{ color: wsConnected ? '#10B981' : '#F59E0B' }}>●</span>
</button>
{/* Botón Selector Tema Claro / Oscuro */}
<button
type="button"
onClick={toggleTheme}
style={{
background: 'none',
border: '1px solid #475569',
borderRadius: '6px',
color: '#94A3B8',
padding: '0.2rem 0.5rem',
cursor: 'pointer',
fontSize: '0.8rem',
display: 'inline-flex',
alignItems: 'center',
gap: '0.35rem',
}}
title={`Cambiar a tema ${theme === 'dark' ? 'claro' : 'oscuro'}`}
>
<span>{theme === 'dark' ? '☀️' : '🌙'}</span>
<span>{theme === 'dark' ? 'Claro' : 'Oscuro'}</span>
</button>
<span style={{ fontFamily: 'monospace', fontSize: '0.95rem', fontWeight: 700, color: '#F8FAFC' }}>
{clock}
</span>
@@ -865,7 +857,7 @@ export const ControlPostView: React.FC = () => {
color: '#94A3B8',
padding: '0.2rem 0.45rem',
cursor: 'pointer',
fontSize: '0.85rem'
fontSize: '0.85rem',
}}
title="Pantalla Completa"
>