feat(chat): multi-session chat support (up to 15), human-like auto-titling, line-clamp titles and sorted registries

This commit is contained in:
2026-10-23 20:18:14 +03:00
parent b5c993486d
commit 09bd66923b
12 changed files with 1114 additions and 650 deletions
+10 -5
View File
@@ -30,7 +30,8 @@ async function loadModals() {
'profile_modal.html',
'admin_modal.html',
'snapshot_inspector_modal.html',
'presence_modal.html'
'presence_modal.html',
'confirm_modal.html'
];
const container = document.getElementById('modals-container');
@@ -102,6 +103,7 @@ async function handleLoginSubmit(e) {
hideAuthModal();
updateUIState();
if (window.SidebarManager) SidebarManager.switchTab('tasks');
if (window.TopicsManager && typeof window.TopicsManager.init === 'function') window.TopicsManager.init();
} else {
const err = await res.json();
if (errEl) {
@@ -249,7 +251,7 @@ async function deleteAdminUser(id, username) {
}
// ============================================================================
// 4. ВСПОМОГАТЕЛЬНЫЕ ФОРМАТЕРЫ И МОДАЛКА УДАЛЕНЩИКОВ
// 4. ВСПОМОГАТЕЛЬНЫЕ ФОРМАТЕРЫ И МОДАЛКА УДАЛЕНЩИКОВ (ИЗ СНАПШОТА)
// ============================================================================
function dmyToYmd(str) {
if (!str) return "";
@@ -383,7 +385,7 @@ document.addEventListener("DOMContentLoaded", async () => {
setupStaffAutocomplete(rwFioInput, "rw-fio-suggestions");
}
//3.1 Автокомплит для местных командировок и иного
// 3.1 Автокомплит для местных командировок и иного
const maFioInput = document.getElementById("manual-absence-fio-input");
if (maFioInput && typeof setupStaffAutocomplete === "function") {
setupStaffAutocomplete(maFioInput, "manual-absence-suggestions");
@@ -399,11 +401,11 @@ document.addEventListener("DOMContentLoaded", async () => {
});
}
// 5. Проверка сессии пользователя
// 5. Проверка сессии пользователя и запуск менеджеров
if (IS_GUEST) {
hideAuthModal();
updateUIState();
} else if (AuthManager && AuthManager.isAuthenticated()) {
} else if (typeof AuthManager !== 'undefined' && AuthManager.isAuthenticated()) {
hideAuthModal();
updateUIState();
if (typeof loadTasks === "function") {
@@ -412,6 +414,9 @@ document.addEventListener("DOMContentLoaded", async () => {
if (window.SidebarManager) {
SidebarManager.init();
}
if (window.TopicsManager && typeof window.TopicsManager.init === "function") {
TopicsManager.init();
}
} else {
showAuthModal();
}