diff --git a/main.py b/main.py index 47482fc..d2172c4 100644 --- a/main.py +++ b/main.py @@ -138,7 +138,7 @@ MAX_MESSAGE_LEN = 10_000 # ⚠️ Версия UI — единый источник. БАМПАТЬ ПРИ КАЖДОМ ДЕПЛОЕ (формат: YYYY-MM-DD + буква). # Фронт берёт её через GET /api/version (chat.html + admin.html, элемент .app-version). -APP_VERSION = "2026-07-17k" +APP_VERSION = "2026-07-17l" # Audit: path → action name mapping _AUDIT_MAP = [ diff --git a/static/chat.html b/static/chat.html index 4d41f8f..fe0a3ec 100644 --- a/static/chat.html +++ b/static/chat.html @@ -104,6 +104,10 @@ button { font-family: inherit; } .ob-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; } .ob-chip { font-size: .88rem; padding: .5rem .85rem; border: 1.5px solid var(--border); border-radius: 999px; background: var(--bg-sunken); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; } .ob-chip:hover { border-color: var(--accent); background: var(--bg-card); } +#quick-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; justify-content: center; } +#quick-actions.hide { display: none; } +.qa-chip { font-size: .8rem; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-sunken); color: var(--text-muted); cursor: pointer; transition: border-color .15s, color .15s; } +.qa-chip:hover { border-color: var(--accent); color: var(--accent); } .msg-system { align-self: center; background: var(--system-bg); border: none; font-size: .8rem; color: var(--system-text); box-shadow: none; padding: .4rem .8rem; } .typing { align-self: flex-start; color: var(--text-light); font-style: italic; font-size: .85rem; padding: .4rem 0; } @@ -310,6 +314,11 @@ html { color-scheme: light; } +
+ + + +
О безопасности сервиса
@@ -1400,10 +1409,23 @@ async function switchChat(id) { renderSessions(); } -// Auto-resize textarea +// Auto-resize textarea + скрыть быстрые действия, когда пользователь начал печатать document.getElementById('msg-input').addEventListener('input', function() { this.style.height = 'auto'; this.style.height = Math.min(this.scrollHeight, 150) + 'px'; + const qa = document.getElementById('quick-actions'); + if (qa) qa.classList.toggle('hide', this.value.trim().length > 0); +}); +// Быстрые действия: клик подставляет заготовку в поле (не отправляет — можно дополнить) +document.querySelectorAll('#quick-actions .qa-chip').forEach(c => { + c.onclick = () => { + const inp = document.getElementById('msg-input'); + inp.value = c.dataset.q; + inp.focus(); + inp.dispatchEvent(new Event('input')); + // курсор в конец (для «КА по материалу: » — дописать название) + inp.setSelectionRange(inp.value.length, inp.value.length); + }; });