fix(mobile): optimize mobile UI/UX for UdeCi chatbot and dashboard (v3.8.30)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "3.8.29",
|
||||
"version": "3.8.30",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -143,18 +143,132 @@
|
||||
border-color: rgba(30, 77, 140, 0.3) !important;
|
||||
}
|
||||
|
||||
/* Mobile Responsiveness */
|
||||
/* Mobile Responsiveness & Dashboard Optimization */
|
||||
@media (max-width: 768px) {
|
||||
.card {
|
||||
margin-bottom: 1rem;
|
||||
margin-bottom: 0.85rem;
|
||||
}
|
||||
|
||||
/* NO forzar flex-direction: column en .btn-group general para preservar segmented controls */
|
||||
.btn-group {
|
||||
flex-direction: column;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.btn-group .btn {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Switchers y grupos de botones en cabeceras de tarjeta en móviles:
|
||||
Permite deslizamiento táctil horizontal fluido sin desbordar ni amontonar */
|
||||
.card-header .btn-group,
|
||||
.btn-group-mobile-scroll {
|
||||
display: inline-flex !important;
|
||||
flex-direction: row !important;
|
||||
flex-wrap: nowrap !important;
|
||||
overflow-x: auto !important;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
max-width: 100% !important;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
border-radius: 8px !important;
|
||||
}
|
||||
.card-header .btn-group::-webkit-scrollbar,
|
||||
.btn-group-mobile-scroll::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.card-header .btn-group .btn,
|
||||
.btn-group-mobile-scroll .btn {
|
||||
white-space: nowrap !important;
|
||||
flex-shrink: 0 !important;
|
||||
padding: 0.35rem 0.65rem !important;
|
||||
font-size: 0.76rem !important;
|
||||
}
|
||||
|
||||
/* Dashboard Role Hero Banner en móvil */
|
||||
.dashboard-role-banner {
|
||||
padding: 0.85rem 1rem !important;
|
||||
border-radius: 0.85rem !important;
|
||||
margin-bottom: 0.85rem !important;
|
||||
}
|
||||
.dashboard-role-banner h1 {
|
||||
font-size: 1.25rem !important;
|
||||
}
|
||||
.dashboard-role-banner p {
|
||||
font-size: 0.8rem !important;
|
||||
}
|
||||
|
||||
/* KPI Cards en Dashboard: compactas, legibles y proporcionadas */
|
||||
.dashboard-stat-card .card-body {
|
||||
padding: 0.85rem 1rem !important;
|
||||
}
|
||||
.dashboard-stat-card h2 {
|
||||
font-size: 1.6rem !important;
|
||||
}
|
||||
.dashboard-stat-card h3 {
|
||||
font-size: 1.3rem !important;
|
||||
}
|
||||
.dashboard-stat-card .fs-3,
|
||||
.dashboard-stat-card .fs-4 {
|
||||
font-size: 1.35rem !important;
|
||||
}
|
||||
|
||||
/* Pestañas de estado (Comisiones y Aulas) en móviles */
|
||||
#commStatusPills,
|
||||
#classStatusPills {
|
||||
width: 100% !important;
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
gap: 6px !important;
|
||||
}
|
||||
#commStatusPills .nav-link,
|
||||
#classStatusPills .nav-link {
|
||||
width: 100% !important;
|
||||
text-align: left !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: space-between !important;
|
||||
font-size: 0.8rem !important;
|
||||
padding: 0.45rem 0.75rem !important;
|
||||
}
|
||||
|
||||
/* Filtros de selección (ej. Carrera) en móvil */
|
||||
#commCareerFilter,
|
||||
#classFloorFilter {
|
||||
min-width: 0 !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
/* Leyendas de Gráficos Pie en móvil */
|
||||
.chart-legend-mobile,
|
||||
.card-body .d-flex.justify-content-around.text-center.small.pt-2.border-top {
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
gap: 4px !important;
|
||||
padding-top: 0.5rem !important;
|
||||
}
|
||||
|
||||
/* Tablas de la cartelera y comisiones */
|
||||
.table-responsive {
|
||||
border-radius: 0 0 0.5rem 0.5rem;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.table td, .table th {
|
||||
padding: 0.55rem 0.75rem !important;
|
||||
font-size: 0.8rem !important;
|
||||
}
|
||||
.table thead th {
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
/* Separadores verticales que se colapsan a horizontales */
|
||||
.col-md-5.border-start {
|
||||
border-left: none !important;
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
|
||||
padding-top: 1rem !important;
|
||||
margin-top: 0.5rem !important;
|
||||
}
|
||||
[data-bs-theme="dark"] .col-md-5.border-start {
|
||||
border-top-color: rgba(255, 255, 255, 0.08) !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,6 +204,8 @@
|
||||
if (panel && launcher) {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
launcher.classList.remove('chat-open');
|
||||
document.body.classList.remove('ai-chat-mobile-open');
|
||||
}
|
||||
setTimeout(() => {
|
||||
window.WalkthroughEngine.startStep(data.guide_step);
|
||||
@@ -236,28 +238,45 @@
|
||||
const role = getUserRole();
|
||||
const name = getUserName();
|
||||
|
||||
function openChat() {
|
||||
panel.classList.remove('d-none');
|
||||
launcher.style.transform = 'scale(0.9)';
|
||||
launcher.classList.add('chat-open');
|
||||
if (window.innerWidth <= 768) {
|
||||
document.body.classList.add('ai-chat-mobile-open');
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (textarea) textarea.focus();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function closeChat() {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
launcher.classList.remove('chat-open');
|
||||
document.body.classList.remove('ai-chat-mobile-open');
|
||||
}
|
||||
|
||||
// Toggle panel
|
||||
launcher.addEventListener('click', () => {
|
||||
const isHidden = panel.classList.contains('d-none');
|
||||
if (isHidden) {
|
||||
panel.classList.remove('d-none');
|
||||
launcher.style.transform = 'scale(0.9)';
|
||||
setTimeout(() => {
|
||||
if (textarea) textarea.focus();
|
||||
}, 100);
|
||||
openChat();
|
||||
} else {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
closeChat();
|
||||
}
|
||||
});
|
||||
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', () => {
|
||||
panel.classList.add('d-none');
|
||||
launcher.style.transform = '';
|
||||
});
|
||||
closeBtn.addEventListener('click', closeChat);
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Escape' && panel && !panel.classList.contains('d-none')) {
|
||||
closeChat();
|
||||
}
|
||||
});
|
||||
|
||||
// Reiniciar conversación del usuario actual
|
||||
if (clearBtn) {
|
||||
clearBtn.addEventListener('click', () => {
|
||||
|
||||
+3
-3
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
|
||||
});
|
||||
|
||||
// Versiones institucionales del sistema
|
||||
const APP_VERSION = '3.8.29';
|
||||
const FRONTEND_VERSION = '3.8.29';
|
||||
const BACKEND_VERSION = '3.8.29';
|
||||
const APP_VERSION = '3.8.30';
|
||||
const FRONTEND_VERSION = '3.8.30';
|
||||
const BACKEND_VERSION = '3.8.30';
|
||||
|
||||
env.addGlobal('app_version', APP_VERSION);
|
||||
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
<button type="button" class="btn btn-sm btn-outline-light border-0 py-1 px-2" id="aiChatClearBtn" title="Reiniciar chat">
|
||||
<i class="bi bi-arrow-clockwise"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-light border-0 py-1 px-2" id="aiChatCloseBtn" title="Minimizar">
|
||||
<i class="bi bi-dash-lg"></i>
|
||||
<button type="button" class="btn btn-sm btn-outline-light border-0 py-1 px-2" id="aiChatCloseBtn" title="Cerrar">
|
||||
<i class="bi bi-x-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -333,15 +333,64 @@
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
@media (max-width: 768px) {
|
||||
.ai-chat-container {
|
||||
bottom: 16px;
|
||||
right: 16px;
|
||||
z-index: 1070;
|
||||
}
|
||||
.ai-chat-launcher {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
}
|
||||
.ai-chat-launcher.chat-open {
|
||||
display: none !important;
|
||||
}
|
||||
.ai-chat-panel {
|
||||
width: calc(100vw - 32px);
|
||||
height: calc(100vh - 110px);
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
bottom: 0 !important;
|
||||
width: 100vw !important;
|
||||
max-width: 100vw !important;
|
||||
height: 100dvh !important;
|
||||
max-height: 100dvh !important;
|
||||
border-radius: 0 !important;
|
||||
z-index: 1080 !important;
|
||||
box-shadow: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
.ai-chat-header {
|
||||
border-radius: 0 !important;
|
||||
padding: 0.75rem 1rem !important;
|
||||
}
|
||||
.ai-chat-messages {
|
||||
padding: 0.85rem !important;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.ai-msg {
|
||||
max-width: 90% !important;
|
||||
font-size: 0.88rem !important;
|
||||
}
|
||||
.ai-option-btn {
|
||||
font-size: 0.78rem !important;
|
||||
padding: 6px 12px !important;
|
||||
min-height: 32px;
|
||||
}
|
||||
.ai-chat-footer {
|
||||
padding: 0.65rem 0.85rem !important;
|
||||
padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px)) !important;
|
||||
}
|
||||
.ai-chat-textarea {
|
||||
font-size: 16px !important; /* Previene el auto-zoom involuntario en Safari iOS */
|
||||
padding: 8px 12px !important;
|
||||
}
|
||||
}
|
||||
|
||||
body.ai-chat-mobile-open {
|
||||
overflow: hidden !important;
|
||||
touch-action: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user