CORE/CONTENT test5593 и адаптация UI

This commit is contained in:
AidarKC
2026-11-27 00:47:13 +03:00
parent 205b7ad971
commit 873535654e
1271 changed files with 219621 additions and 1900 deletions
@@ -0,0 +1,25 @@
// Состояние чтения живёт только в текущей вкладке и разделено по аккаунтам.
const positions = new Map();
export function rememberChannelPosition(key) {
positions.set(key, document.getElementById('app-screen')?.scrollTop || 0);
}
export function readChannelPosition(key) { return positions.get(key); }
export function restoreChannelPosition(value) {
const root = document.getElementById('app-screen');
if (root && Number.isFinite(value)) root.scrollTop = value;
}
// «Открыть обсуждение» из ленты ведёт сразу в редактор ответа: лента отмечает путь, обсуждение забирает отметку один раз.
let replyOnOpenPath = '';
const normalizePath = (path) => {
const raw = String(path || '').split(/[?#]/)[0];
let decoded = raw;
try { decoded = decodeURIComponent(raw); } catch { /* оставляем как есть */ }
return decoded.replace(/^\/+|\/+$/g, '').toLowerCase();
};
export function requestReplyEditorOnOpen(path) { replyOnOpenPath = normalizePath(path); }
export function consumeReplyEditorOnOpen(path) {
const match = Boolean(replyOnOpenPath) && replyOnOpenPath === normalizePath(path);
replyOnOpenPath = '';
return match;
}