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
@@ -121,7 +121,8 @@ function renderExceptionsView(exceptions) {
let tags = '<span class="text-[11px] text-slate-400 italic">Список пуст</span>';
if (list && list.length > 0) {
tags = list.map(item => {
const sortedList = list.slice().sort((a, b) => String(a).localeCompare(String(b), 'ru'));
tags = sortedList.map(item => {
const val = escapeHtml(item);
return '<span class="inline-flex items-center gap-1.5 px-2 py-0.5 rounded-lg text-xs font-medium ' + badgeClass + '">' +
'<span>' + val + '</span>' +
@@ -192,7 +193,9 @@ async function loadRemoteWorkersView() {
try {
const res = await fetch('/api/v1/remote-workers', { headers: AuthManager.getAuthHeaders() });
const data = await res.json();
const workers = data.workers || [];
const workers = (data.workers || []).slice().sort((a, b) =>
String(a.fio || '').localeCompare(String(b.fio || ''), 'ru')
);
let listHtml = '';
if (workers.length === 0) {
@@ -277,7 +280,9 @@ async function loadManualAbsencesView(type) {
headers: AuthManager.getAuthHeaders()
});
const data = await res.json();
const items = data.items || [];
const items = (data.items || []).slice().sort((a, b) =>
String(a.fio || '').localeCompare(String(b.fio || ''), 'ru')
);
let listHtml = '';
if (items.length === 0) {
@@ -453,7 +458,9 @@ async function loadSchedulesView() {
const res = await fetch('/api/v1/schedules/employees', { headers: AuthManager.getAuthHeaders() });
if (!res.ok) throw new Error('Ошибка сети');
const data = await res.json();
allEmployeesSchedulesCache = data.items || [];
allEmployeesSchedulesCache = (data.items || []).slice().sort((a, b) =>
String(a.fio || '').localeCompare(String(b.fio || ''), 'ru')
);
renderSchedulesList(allEmployeesSchedulesCache);
} catch (e) {
container.innerHTML = '<div class="text-center py-8 text-rose-500 text-xs">Не удалось загрузить графики сотрудников</div>';