Доработать UI личных сообщений

This commit is contained in:
AidarKC
2026-11-14 00:14:27 +03:00
parent 42a05a7a67
commit c972a975fd
9 changed files with 132 additions and 2 deletions
+11
View File
@@ -2215,6 +2215,17 @@
"text_039": "Who to show"
},
"chat_view": {
"security_notice": {
"title": "Your conversation is protected by end-to-end encryption",
"encryption": "All private messages are encrypted using modern cryptographic algorithms. Encryption keys are stored ONLY on the participants’ devices.",
"servers": "SHiNE servers do not possess your private keys and cannot technically read your messages.",
"derivation": "Your encryption key is derived from your login and password.",
"rotation": "When you change your password, your messages are re-encrypted from the old password to the new one on your device.",
"source": "The source code of our applications is fully open, so you can verify these claims yourself.",
"warning_label": "Important:",
"warning": "if you forget your password, you will not be able to recover access to your encrypted conversations.",
"recovery": "SHiNE does not store your secret keys and cannot help you restore your conversations."
},
"text_002": "Muted",
"text_015": "Search",
"text_020": "Clear history",
+11
View File
@@ -2348,6 +2348,17 @@
"text_039": "Кого показать"
},
"chat_view": {
"security_notice": {
"title": "Ваша переписка защищена сквозным шифрованием",
"encryption": "Все личные сообщения шифруются с использованием современных криптографических алгоритмов. Ключи шифрования хранятся ТОЛЬКО на устройствах участников переписки.",
"servers": "Сервера SHiNE не имеют ваших приватных ключей и даже технически никак не могут прочитать ваши сообщения.",
"derivation": "Ваш ключ шифрования высчитывается из вашего логина и пароля.",
"rotation": "При смене пароля перекодирование всех ваших сообщений со старого пароля на новый происходит на устройстве пользователя.",
"source": "Код наших приложений полностью открыт и вы легко можете проверить всё это сами.",
"warning_label": "Важно:",
"warning": "если вы забудете свой пароль, восстановить доступ к вашей зашифрованной переписке будет невозможно.",
"recovery": "SHiNE не хранит ваши секретные ключи и никак не сможет помочь вам восстановить вашу переписку."
},
"text_001": "Чат",
"text_002": "Без звука",
"text_003": "Показать связи",
+36
View File
@@ -1135,6 +1135,41 @@ function scrollToUnreadSeparator(list) {
return true;
}
// Постоянная справка в начале личного диалога. Это только UI: не DM, не запись в блокчейн.
function createDmEncryptionNotice() {
const notice = document.createElement('aside');
notice.className = 'dm-security-notice';
notice.setAttribute('role', 'note');
const heading = document.createElement('strong');
heading.className = 'dm-security-notice__title';
heading.textContent = `🔒 ${t('screens.chat_view.security_notice.title')}`;
notice.append(heading);
for (const text of [
t('screens.chat_view.security_notice.encryption'),
t('screens.chat_view.security_notice.servers'),
t('screens.chat_view.security_notice.derivation'),
t('screens.chat_view.security_notice.rotation'),
t('screens.chat_view.security_notice.source'),
]) {
const paragraph = document.createElement('p');
paragraph.textContent = text;
notice.append(paragraph);
}
const warning = document.createElement('p');
const warningLabel = document.createElement('strong');
warningLabel.textContent = `${t('screens.chat_view.security_notice.warning_label')} `;
warning.append(warningLabel, document.createTextNode(t('screens.chat_view.security_notice.warning')));
notice.append(warning);
const recovery = document.createElement('p');
recovery.textContent = t('screens.chat_view.security_notice.recovery');
notice.append(recovery);
return notice;
}
function renderLog(
list,
chatId,
@@ -1148,6 +1183,7 @@ function renderLog(
} = {},
) {
list.innerHTML = '';
list.append(createDmEncryptionNotice());
const messages = getChatMessages(chatId);
let unreadSeparatorInserted = false;
const separatorMessageKey = String(unreadSeparatorMessageKey || '').trim();
+1
View File
@@ -371,6 +371,7 @@ export function parseRouteFromPath(pathname = '') {
if (sub === 'language') return { pageId: 'language-view', params: {} };
if (sub === 'appearance') return { pageId: 'appearance-view', params: {} };
if (sub === 'notifications') return { pageId: 'notification-settings-view', params: {} };
if (sub === 'application') return { pageId: 'application-settings-view', params: {} };
if (sub === 'app-log') return { pageId: 'app-log-view', params: {} };
if (sub === 'pwa-diagnostics') return { pageId: 'pwa-diagnostics-view', params: {} };
if (sub === 'solana-users-init') return { pageId: 'solana-users-init-view', params: {} };