UI: новый общий стиль, тёмная/светлая тема, настраиваемая палитра

- styles/main.css: роли цветов (по умолчанию «Индиго»), шкала отступов/скруглений/шрифтов,
  цвета отношений для обеих тем; жёсткие цвета в стилях заменены на роли.
- Палитра: пресеты и личные правки, «Оформление» Авто/День/Ночь, долгое нажатие —
  редактор цветов с экспортом/импортом.
- Каналы: пузыри постов автора, плашки дней, строка «Написать в канал…», «О канале»,
  создание канала с адресом из названия; лента открывается на свежих постах.
- Чаты: плоский список, чипы-фильтры, пузыри, плашки дней; нижняя панель скрыта в переписке.
- Корневые разделы — единая шапка; профиль и чужой профиль — общая карточка;
  настройки, кошелёк, сеансы — меню-списки.
- Нижняя панель: иконки без подписей, бейджи на иконках.
- confirmDialog вместо window.confirm/alert; на телефоне диалоги — шторки снизу.
- docs/UI-Design/ISSUES-for-dev.md — найденные ошибки сервера/UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
q
2026-09-26 10:05:26 +03:00
co-authored by Claude Opus 5.5
parent 6e5b57fd7c
commit f8900e531a
94 changed files with 3337 additions and 2432 deletions
+14 -15
View File
@@ -1,10 +1,10 @@
import { confirmDialog } from '../components/confirm-dialog.js';
import { createTopBar } from '../components/topbar.js';
import {
closeAllSavedProfiles,
closeSavedProfile,
getSavedProfiles,
prepareAddProfileLogin,
state,
switchToSavedProfile,
} from '../state.js';
@@ -58,12 +58,12 @@ export function render({navigate, chrome}) {
const closeAllButton = document.createElement('button');
closeAllButton.type = 'button';
closeAllButton.className = 'secondary-btn profiles-close-all';
closeAllButton.textContent = 'Закрыть все профили';
closeAllButton.className = 'destructive-btn profiles-close-all';
closeAllButton.textContent = 'Выйти из всех профилей';
closeAllButton.addEventListener('click', async () => {
const profiles = getSavedProfiles();
if (!profiles.length) return;
const confirmed = window.confirm('Закрыть все профили на этом устройстве? После этого откроется экран входа.');
const confirmed = await confirmDialog({ title: 'Выйти из всех профилей?', text: 'Все профили на этом устройстве будут закрыты, откроется экран входа.', confirmLabel: 'Выйти', danger: true });
if (!confirmed) return;
closeAllButton.disabled = true;
status.hidden = false;
@@ -83,10 +83,8 @@ export function render({navigate, chrome}) {
const renderList = () => {
const profiles = getSavedProfiles();
const active = profiles.find((item) => item.isActive);
intro.textContent = profiles.length
? `Профилей на устройстве: ${profiles.length}. Активен: ${active?.login || state.session.login || '—'}`
: 'На устройстве нет сохранённых профилей.';
intro.textContent = profiles.length ? '' : 'На устройстве нет сохранённых профилей.';
intro.hidden = profiles.length > 0;
closeAllButton.disabled = profiles.length === 0;
list.innerHTML = '';
@@ -97,11 +95,11 @@ export function render({navigate, chrome}) {
const select = document.createElement('button');
select.type = 'button';
select.className = 'profiles-select';
select.innerHTML = `<span class="profiles-login">${profile.login}</span>${profile.isActive ? '<span class="badge">Активный</span>' : ''}`;
select.innerHTML = `<span class="profiles-login">${profile.login}</span>${profile.isActive ? '<span class="profiles-active-badge">Сейчас открыт</span>' : ''}`;
select.disabled = profile.isActive;
select.addEventListener('click', async () => {
if (profile.isActive) return;
const confirmed = window.confirm(`Переключиться на профиль «${profile.login}»?`);
const confirmed = await confirmDialog({ title: 'Переключить профиль?', text: `Откроется профиль «${profile.login}».`, confirmLabel: 'Переключить' });
if (!confirmed) return;
status.hidden = false;
status.className = 'status-line';
@@ -118,16 +116,17 @@ export function render({navigate, chrome}) {
const close = document.createElement('button');
close.type = 'button';
close.className = 'profiles-close';
close.setAttribute('aria-label', `Закрыть профиль ${profile.login}`);
close.setAttribute('aria-label', `Выйти из профиля ${profile.login}`);
close.title = 'Выйти из профиля';
close.textContent = '×';
close.addEventListener('click', async () => {
const others = profiles.filter((item) => item.login.toLowerCase() !== profile.login.toLowerCase());
const message = profile.isActive
? (others.length
? `Закрыть текущий профиль «${profile.login}»? После закрытия приложение переключится на следующий сохранённый профиль.`
: `Закрыть текущий профиль «${profile.login}»? После закрытия откроется экран входа.`)
: `Закрыть профиль «${profile.login}» на этом устройстве?`;
if (!window.confirm(message)) return;
? 'Приложение переключится на следующий сохранённый профиль.'
: 'После выхода откроется экран входа.')
: 'Профиль будет закрыт на этом устройстве.';
if (!await confirmDialog({ title: `Выйти из профиля «${profile.login}»?`, text: message, confirmLabel: 'Выйти', danger: true })) return;
status.hidden = false;
status.className = 'status-line';