fix(mobile): optimize mobile UI/UX for UdeCi chatbot and dashboard (v3.8.30)

This commit is contained in:
2026-10-27 09:38:55 -03:00
parent 96d8618157
commit da7c96d083
9 changed files with 231 additions and 34 deletions
+30 -11
View File
@@ -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', () => {