From 681437acb130b9a5f99b74bb1157bd5127345b253f52c214af68d094282bd674 Mon Sep 17 00:00:00 2001 From: AidarKC Date: Wed, 22 Jul 2026 19:18:56 +0400 Subject: [PATCH] =?UTF-8?q?UI:=20=D1=83=D0=B1=D1=80=D0=B0=D1=82=D1=8C=20?= =?UTF-8?q?=D0=B3=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2=D0=BE=D0=B9=20=D0=B2?= =?UTF-8?q?=D0=B2=D0=BE=D0=B4=20=D0=B8=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B9=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION.properties | 4 +- shine-UI/assets/profile-icon-profile.svg | 5 +- shine-UI/assets/profile-icon-settings.svg | 1 - shine-UI/assets/profile-icon-wallet.svg | 8 +- shine-UI/js/app.js | 2 - shine-UI/js/components/speech-input-modal.js | 132 --------------- shine-UI/js/pages/channel-thread-view.js | 26 --- shine-UI/js/pages/channel-view.js | 25 --- shine-UI/js/pages/chat-view.js | 15 +- shine-UI/js/pages/settings-view.js | 4 +- shine-UI/js/pages/tools-settings-view.js | 168 ------------------- shine-UI/js/router.js | 3 - shine-UI/js/services/speech-tools-service.js | 147 ---------------- shine-UI/js/state.js | 9 - shine-UI/styles/components.css | 26 --- 15 files changed, 14 insertions(+), 561 deletions(-) delete mode 100644 shine-UI/js/components/speech-input-modal.js delete mode 100644 shine-UI/js/pages/tools-settings-view.js diff --git a/VERSION.properties b/VERSION.properties index f326fdfc..920a658b 100644 --- a/VERSION.properties +++ b/VERSION.properties @@ -1,2 +1,2 @@ -client.version=1.2.344 -server.version=1.2.316 +client.version=1.2.345 +server.version=1.2.317 diff --git a/shine-UI/assets/profile-icon-profile.svg b/shine-UI/assets/profile-icon-profile.svg index 73b7bf52..5d7244e4 100644 --- a/shine-UI/assets/profile-icon-profile.svg +++ b/shine-UI/assets/profile-icon-profile.svg @@ -1,5 +1,4 @@ - - - + + diff --git a/shine-UI/assets/profile-icon-settings.svg b/shine-UI/assets/profile-icon-settings.svg index ec391c81..c3bd6471 100644 --- a/shine-UI/assets/profile-icon-settings.svg +++ b/shine-UI/assets/profile-icon-settings.svg @@ -1,5 +1,4 @@ - diff --git a/shine-UI/assets/profile-icon-wallet.svg b/shine-UI/assets/profile-icon-wallet.svg index 59551d96..03cccb21 100644 --- a/shine-UI/assets/profile-icon-wallet.svg +++ b/shine-UI/assets/profile-icon-wallet.svg @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/shine-UI/js/app.js b/shine-UI/js/app.js index f24721a0..173978d9 100644 --- a/shine-UI/js/app.js +++ b/shine-UI/js/app.js @@ -58,7 +58,6 @@ import * as walletView from './pages/wallet-view.js?v=202606281930'; import * as settingsView from './pages/settings-view.js'; import * as developerSettingsView from './pages/developer-settings-view.js'; import * as serverSettingsView from './pages/server-settings-view.js?v=202606161240'; -import * as toolsSettingsView from './pages/tools-settings-view.js'; import * as remoteAddBlockSessionView from './pages/remote-addblock-session-view.js?v=202606281300'; import * as deviceView from './pages/device-view.js?v=202606131435'; import * as connectDeviceView from './pages/connect-device-view.js?v=202606142055'; @@ -119,7 +118,6 @@ const routes = { 'settings-view': settingsView, 'developer-settings-view': developerSettingsView, 'server-settings-view': serverSettingsView, - 'tools-settings-view': toolsSettingsView, 'remote-addblock-session-view': remoteAddBlockSessionView, 'device-view': deviceView, 'connect-device-view': connectDeviceView, diff --git a/shine-UI/js/components/speech-input-modal.js b/shine-UI/js/components/speech-input-modal.js deleted file mode 100644 index 57075fef..00000000 --- a/shine-UI/js/components/speech-input-modal.js +++ /dev/null @@ -1,132 +0,0 @@ -import { - createMicrophoneRecorder, - isSpeechToTextConfigured, - transcribeAudioBySettings, -} from '../services/speech-tools-service.js'; -import { state } from '../state.js'; - -function formatDuration(ms) { - const totalSec = Math.max(0, Math.floor(Number(ms || 0) / 1000)); - const mm = String(Math.floor(totalSec / 60)).padStart(2, '0'); - const ss = String(totalSec % 60).padStart(2, '0'); - return `${mm}:${ss}`; -} - -function showSttMissingConfigDialog(navigate) { - const goSettings = window.confirm( - 'Распознавание речи не настроено. Перейти в настройки инструментов?' - ); - if (goSettings) navigate('tools-settings-view'); -} - -export async function openSpeechInputModal({ navigate, onTextReady, onSendText, onSendQueued }) { - if (!isSpeechToTextConfigured(state.entrySettings)) { - showSttMissingConfigDialog(navigate); - return; - } - - const root = document.getElementById('modal-root'); - const host = document.createElement('div'); - host.innerHTML = ` - - `; - root.append(host); - - const statusEl = host.querySelector('#speech-input-status'); - const timeEl = host.querySelector('#speech-input-time'); - const levelEl = host.querySelector('#speech-level-fill'); - const errorEl = host.querySelector('#speech-input-error'); - const cancelBtn = host.querySelector('#speech-cancel'); - const sendNowBtn = host.querySelector('#speech-send-now'); - const okBtn = host.querySelector('#speech-ok'); - const recorder = createMicrophoneRecorder(); - let closed = false; - let busy = false; - - const close = () => { - if (closed) return; - closed = true; - host.remove(); - }; - - const setBusy = (flag) => { - busy = !!flag; - cancelBtn.disabled = busy; - sendNowBtn.disabled = busy; - okBtn.disabled = busy; - okBtn.textContent = busy ? 'Распознаю...' : 'OK'; - sendNowBtn.textContent = busy ? 'Распознаю...' : 'Распознать и сразу отправить сообщение'; - }; - - try { - await recorder.start(({ elapsedMs, level }) => { - if (timeEl) timeEl.textContent = formatDuration(elapsedMs); - if (levelEl) levelEl.style.width = `${Math.max(2, Math.round((Number(level) || 0) * 100))}%`; - }); - } catch (error) { - close(); - window.alert(`Не удалось получить доступ к микрофону: ${error?.message || 'unknown'}`); - return; - } - - cancelBtn.addEventListener('click', () => { - recorder.cancel(); - close(); - }); - - okBtn.addEventListener('click', async () => { - if (busy) return; - setBusy(true); - try { - const audioBlob = await recorder.stop(); - host.innerHTML = ` - - `; - const text = await transcribeAudioBySettings(audioBlob, state.entrySettings); - if (typeof onTextReady === 'function') onTextReady(text); - close(); - } catch (error) { - setBusy(false); - statusEl.textContent = 'Идёт запись...'; - errorEl.textContent = `Ошибка распознавания: ${error?.message || 'unknown'}`; - } - }); - - sendNowBtn.addEventListener('click', async () => { - if (busy) return; - setBusy(true); - try { - const audioBlob = await recorder.stop(); - close(); - if (typeof onSendQueued === 'function') onSendQueued(); - const text = await transcribeAudioBySettings(audioBlob, state.entrySettings); - if (typeof onSendText === 'function') { - await onSendText(text); - } else if (typeof onTextReady === 'function') { - onTextReady(text); - } - } catch (error) { - setBusy(false); - close(); - window.alert(`Ошибка распознавания: ${error?.message || 'unknown'}`); - } - }); -} diff --git a/shine-UI/js/pages/channel-thread-view.js b/shine-UI/js/pages/channel-thread-view.js index 02565b51..6761d663 100644 --- a/shine-UI/js/pages/channel-thread-view.js +++ b/shine-UI/js/pages/channel-thread-view.js @@ -10,7 +10,6 @@ import { showToast, softHaptic, } from '../services/channels-ux.js'; -import { openSpeechInputModal } from '../components/speech-input-modal.js'; import { navigateBack } from '../router.js'; import { renderUserAvatar } from '../components/avatar-image.js'; import { loadProfileSnapshot } from '../services/user-profile-params.js'; @@ -339,9 +338,6 @@ function openReplyModal({ onSubmit, navigate }) {