From 2dc5587fd18d7ffa0d87f9c7b03ce6add54f8482 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Sat, 29 Aug 2026 14:31:03 +0300 Subject: [PATCH] Clarify chat response progress --- cmd/creator-web/static/assets/chat.css | 1 + cmd/creator-web/static/assets/chat.js | 7 +++++++ cmd/creator-web/static/chat.html | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/creator-web/static/assets/chat.css b/cmd/creator-web/static/assets/chat.css index 9710f96..db45089 100644 --- a/cmd/creator-web/static/assets/chat.css +++ b/cmd/creator-web/static/assets/chat.css @@ -85,6 +85,7 @@ textarea { resize: vertical; min-height: 84px; max-height: 240px; padding: 14px; .composer-hint { display: flex; justify-content: space-between; gap: 12px; padding: 0 12px 8px; color: #68776d; font: 9px/1 var(--mono); } .composer-hint output { color: var(--muted); white-space: nowrap; } .composer button { height: 48px; align-self: end; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline: 15px; } +.composer button[aria-busy="true"] { color: #4b432d; background: #ad9353; } .composer button span:last-child { opacity: .65; font: 16px/1 var(--mono); } .composer button:disabled { cursor: wait; filter: saturate(.3); } .media-tools { width: min(100%, 920px); margin: 0 auto; padding: 0 18px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font: 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; } diff --git a/cmd/creator-web/static/assets/chat.js b/cmd/creator-web/static/assets/chat.js index 6917f30..a9bb14d 100644 --- a/cmd/creator-web/static/assets/chat.js +++ b/cmd/creator-web/static/assets/chat.js @@ -6,6 +6,7 @@ const messages = document.querySelector("#messages"); const chatForm = document.querySelector("#chat-form"); const messageInput = document.querySelector("#message"); const sendButton = document.querySelector("#send"); +const sendLabel = document.querySelector("#send-label"); const messageCount = document.querySelector("#message-count"); const logoutButton = document.querySelector("#logout"); const activeFocus = document.querySelector("#active-focus"); @@ -303,6 +304,9 @@ async function sendChatMessage(text, options = {}) { if (!clean) return; if (!options.silentUser) appendMessage("user", clean); sendButton.disabled = true; + sendButton.setAttribute("aria-busy", "true"); + if (sendLabel) sendLabel.textContent = "Домовой обрабатывает"; + messages.setAttribute("aria-busy", "true"); try { const result = await api("/api/chat/messages", {method: "POST", body: JSON.stringify({conversation_id: conversationID, message: clean})}); conversationID = result.conversation_id; @@ -323,6 +327,9 @@ async function sendChatMessage(text, options = {}) { } } finally { sendButton.disabled = false; + sendButton.removeAttribute("aria-busy"); + if (sendLabel) sendLabel.textContent = "Отправить"; + messages.removeAttribute("aria-busy"); messageInput.focus(); } } diff --git a/cmd/creator-web/static/chat.html b/cmd/creator-web/static/chat.html index f083150..f494e27 100644 --- a/cmd/creator-web/static/chat.html +++ b/cmd/creator-web/static/chat.html @@ -61,7 +61,7 @@
Enter — отправить · Shift+Enter — новая строка0 / 16384
- +