UI: полные счётчики ответов, поле сообщения как в Telegram, переключатель «Связей», шапка

- Счётчик ответов – по всем уровням: обсуждение считает по дереву, лента берёт итог из обсуждения
  (кэш или фоновая подгрузка видимых записей, они же потом открываются сразу).
  Сервер пока отдаёт только прямые ответы.
- Чат: поле-«таблетка» растёт плавно (высота меряется по скрытой копии, без сброса в auto),
  смайлик внутри поля справа внизу, «Отправить» 44 px по низу; убраны правила перестройки
  в две колонки.
- «Связи»: фильтры – общий блок-переключатель (.tabs), как на других вкладках, всё помещается.
- Шапка: название крупнее и жирнее, подпись под ним компактнее.
This commit is contained in:
q
2026-10-12 09:45:08 +03:00
parent 9ea276ba77
commit 923f281bf6
10 changed files with 201 additions and 105 deletions
+24 -4
View File
@@ -626,10 +626,28 @@ function showTtsMissingConfigDialog() {
root.querySelector('#chat-tts-ok')?.addEventListener('click', close);
}
// Высоту меряем по скрытой копии поля: так поле не сбрасывается в auto и растёт плавно (transition в chat.css).
const composerMeasures = new WeakMap();
function autoResizeComposer(textarea) {
if (!textarea) return;
textarea.style.height = 'auto';
textarea.style.height = `${Math.min(180, Math.max(42, textarea.scrollHeight))}px`;
let measure = composerMeasures.get(textarea);
if (!measure || !measure.isConnected) {
measure = textarea.cloneNode(false);
measure.removeAttribute('name');
measure.removeAttribute('id');
measure.tabIndex = -1;
measure.setAttribute('aria-hidden', 'true');
measure.classList.add('dm-input-measure');
measure.removeAttribute('style');
textarea.after(measure);
composerMeasures.set(textarea, measure);
}
measure.style.width = `${textarea.offsetWidth}px`;
measure.value = textarea.value || ' ';
const style = getComputedStyle(textarea);
const borders = (Number.parseFloat(style.borderTopWidth) || 0) + (Number.parseFloat(style.borderBottomWidth) || 0);
const next = Math.min(180, Math.max(44, measure.scrollHeight + borders));
if (textarea.style.height !== `${next}px`) textarea.style.height = `${next}px`;
}
function createHeaderPhoneHandsetIcon() {
@@ -1566,11 +1584,13 @@ export function render({ navigate, route, chrome }) {
<span class="dm-voice-recording-time" id="chat-voice-recording-time">0:00</span>
<span class="dm-voice-recording-hint" id="chat-voice-recording-hint">↑ проведите вверх, чтобы закрепить</span>
</div>
<textarea class="input dm-input" name="message" rows="1" placeholder="Введите сообщение" maxlength="12000" enterkeyhint="enter"></textarea>
<div class="dm-field">
<textarea class="input dm-input" name="message" rows="1" placeholder="Сообщение" maxlength="12000" enterkeyhint="enter"></textarea>
<button class="ghost-btn dm-emoji-btn" type="button" id="chat-emoji-toggle" aria-label="Эмодзи" title="Эмодзи"><span class="dm-emoji-btn__glyph">☺</span></button>
</div>
<input id="chat-file-input" type="file" multiple hidden />
<div class="dm-actions-col">
<button class="ghost-btn dm-file-btn" type="button" id="chat-file-toggle" aria-label="Прикрепить файлы" title="Прикрепить файлы" hidden>📎</button>
<button class="ghost-btn dm-emoji-btn" type="button" id="chat-emoji-toggle" aria-label="Эмодзи" title="Эмодзи"><span class="dm-emoji-btn__glyph">☺</span></button>
<button class="primary-btn dm-send-btn dm-send-icon-btn" type="button" title="Записать голосовое сообщение" data-mode="voice" aria-label="Записать голосовое сообщение"></button>
</div>
`;