From dbdb6db0fa0512ea8c79030fdc3e3f27be4a1fa6 Mon Sep 17 00:00:00 2001 From: anor Date: Fri, 17 Jul 2026 23:12:54 +1000 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=D1=81=D1=80=D0=B5=D0=B7=205.x=20?= =?UTF-8?q?=E2=80=94=20=D0=B1=D1=8B=D1=81=D1=82=D1=80=D1=8B=D0=B5=20=D0=B4?= =?UTF-8?q?=D0=B5=D0=B9=D1=81=D1=82=D0=B2=D0=B8=D1=8F=20(=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=B8=D1=82=D1=8C=20=D1=81=D0=BC=D0=B5?= =?UTF-8?q?=D1=82=D1=83=20/=20=D0=9A=D0=90=20/=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=20=D1=8D=D0=BA=D1=81=D0=BF=D0=B5=D1=80=D1=82=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ряд чипов над вводом: клик подставляет заготовку в поле (не отправляет — можно дополнить, курсор в конце). Скрываются при вводе текста, возвращаются при очистке. Делает новые инструменты (verify/КА/precheck) видимыми пользователю. APP_VERSION 2026-07-17l. Браузер-verified. --- main.py | 2 +- static/chat.html | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) 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); + }; });