SHA256
Личный чат: фоны «Затмение» и «Гроза», новая справка о шифровании, плавное сворачивание «Поддержки»
- Фоны «Затмение» и «Гроза» в двух темах. Сообщения, голосовые и поле ввода подхватывают свет фона: общий материал has-dm-glow, у фона только пять цветов на тему. - Срок вложения и время — в одной строке; свечение пузырей не срезается краем ленты. - Справка о шифровании: замок-значок вместо эмодзи, шрифт Source Serif 4 из файлов приложения (OFL). - Карточка «Поддержка» сворачивается мягко и без рывка в конце: анимируется только её добавка к строке. Версия клиента 1.21.18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,29 @@ test('картинки передаются в CSS абсолютными адр
|
||||
}
|
||||
});
|
||||
|
||||
test('оттенок сообщений привязан к фону, который есть в списке', () => {
|
||||
const css = file('styles/features/dm-background.css');
|
||||
const tinted = new Set([...css.matchAll(/\[data-dm-bg='([^']+)'\]/g)].map(([, id]) => id));
|
||||
for (const id of tinted) assert.ok(findDmChatBackground(id), `в стилях остался оттенок удалённого фона «${id}»`);
|
||||
// Светящимся сообщениям нужны все пять цветов в обеих темах: без одного из них пропадёт вся заливка пузыря.
|
||||
const glowing = listDmChatBackgrounds().filter(({ glow }) => glow);
|
||||
assert.ok(glowing.length >= 2);
|
||||
for (const { id } of glowing) {
|
||||
for (const prefix of ['\n', "\n:root[data-theme='light'] "]) {
|
||||
const start = css.indexOf(`${prefix}[data-dm-bg='${id}'] {`);
|
||||
assert.notEqual(start, -1, `${id}: нет блока цветов (${prefix.trim() || 'тёмная тема'})`);
|
||||
const block = css.slice(start, css.indexOf('}', start));
|
||||
for (const name of ['light', 'spark', 'core', 'slate', 'mist']) assert.match(block, new RegExp(`--dm-tint-${name}: #[0-9a-f]{6};`), `${id}: --dm-tint-${name}`);
|
||||
}
|
||||
}
|
||||
// Картинки из стилей (отблески молний) лежат в приложении.
|
||||
for (const [, path] of css.matchAll(/url\("([^"]+)"\)/g)) assert.ok(existsSync(new URL(path, new URL('styles/features/', root))), path);
|
||||
// Оттенок нужен и ленте, и полю ввода, и плитке в шторке – все они помечаются id фона.
|
||||
assert.match(file('js/pages/chat-view.js'), /\[screen, form, backgroundLayer\]\.forEach\(\(node\) => \{ node\.dataset\.dmBg = /);
|
||||
assert.match(file('js/pages/chat-view.js'), /classList\.toggle\('has-dm-glow', Boolean\(background\?\.glow\)\)/);
|
||||
assert.match(file('js/components/dm-background-sheet.js'), /preview\.dataset\.dmBg = id/);
|
||||
});
|
||||
|
||||
test('объём сообщений: у эмодзи без пузыря нет канта, размытия на каждом пузыре нет', () => {
|
||||
const css = file('styles/features/chat.css').replace(/\r\n/g, '\n');
|
||||
assert.match(css, /\.dm-chat-screen \.bubble:not\(\.bubble--emoji-only\)::before/);
|
||||
|
||||
@@ -44,6 +44,19 @@ test('уведомление формируется только локальн
|
||||
assert.doesNotMatch(functionBody, /authService|addSignedMessageToChat|sendDirectMessage|AddBlock|fetch\(/);
|
||||
});
|
||||
|
||||
test('замок — значок приложения, шрифт справки лежит в приложении, а не грузится со стороны', () => {
|
||||
const body = chat.slice(chat.indexOf('function createDmEncryptionNotice()'), chat.indexOf('function renderLog('));
|
||||
assert.match(body, /iconHtml\('lock'\)/);
|
||||
assert.doesNotMatch(body, /🔒/u);
|
||||
const fonts = [...css.matchAll(/@font-face \{[^}]*url\("([^"]+)"\)/g)].map(([, path]) => path);
|
||||
assert.equal(fonts.length, 2, 'кириллица и латиница');
|
||||
for (const path of fonts) {
|
||||
assert.match(path, /^\.\.\/\.\.\/assets\/fonts\//);
|
||||
const data = readFileSync(new URL(path, new URL('../styles/features/', import.meta.url)));
|
||||
assert.equal(data.toString('latin1', 0, 4), 'wOF2', path);
|
||||
}
|
||||
});
|
||||
|
||||
test('уведомление имеет собственные серые стили и не оформляется как bubble', () => {
|
||||
assert.match(css, /\.dm-security-notice\s*\{[\s\S]*?color: var\(--text-secondary\)/);
|
||||
assert.doesNotMatch(chat.slice(chat.indexOf('function createDmEncryptionNotice()'), chat.indexOf('function renderLog(')), /className = ['"`]bubble/);
|
||||
|
||||
@@ -68,6 +68,10 @@ test('support card collapses as one block: layers share a cell, only the card dr
|
||||
assert.match(rule('.profile-support'), /align-items: start/);
|
||||
assert.match(rule('.profile-support__panel'), /grid-template-rows: 0fr/);
|
||||
assert.match(rule('.profile-support__panel'), /visibility: hidden/);
|
||||
// Ряд панели — только добавка карточки к строке: иначе сжатие упирается в строку на полном ходу и кончается рывком.
|
||||
assert.match(rule('.profile-support__panel'), /margin-top: var\(--ps-line\)/);
|
||||
assert.match(rule('.profile-support .profile-support-stats'), /margin-top: calc\(-1 \* var\(--ps-line\)\)/);
|
||||
assert.match(rule('.profile-support__summary'), /min-height: var\(--ps-line\)/);
|
||||
assert.match(rule(".profile-support[data-expanded='true'] .profile-support__panel"), /grid-template-rows: 1fr/);
|
||||
assert.match(rule(".profile-support[data-expanded='true'] .profile-support__line"), /visibility: hidden/);
|
||||
// Сияние ждёт конца перехода именно той панели, которая теперь анимируется.
|
||||
|
||||
Reference in New Issue
Block a user