SHA256
UI: обсуждения по ТЗ – открытие записи, общий редактор ответа, нижняя панель
Нижняя панель снова видна в канале, обсуждении и личном чате. Нажатие на запись в ленте открывает её вместе с обсуждением; «Обсуждение» и «Ответить» открывают обсуждение и сразу редактор ответа. Нажатие на ответ в обсуждении открывает его как отдельное обсуждение. Ответ пишется в том же редакторе, что и запись канала (с вложениями): над полем – цепочка от исходной записи до той, на которую отвечаем, с аватарами и линией, как в Threads. Строка внизу обсуждения «Ответить …» открывает этот редактор; простое поле ввода убрано.
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
client.version=1.18.1
|
||||
client.version=1.18.2
|
||||
server.version=1.14.0
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
}());
|
||||
</script>
|
||||
<script>
|
||||
window.__SHINE_BUILD_HASH__ = '20261011201500';
|
||||
window.__SHINE_BUILD_HASH__ = '20261011213000';
|
||||
window.__SHINE_CLIENT_VERSION__ = '1.2.10';
|
||||
</script>
|
||||
<script>
|
||||
|
||||
+1
-1
@@ -1455,7 +1455,7 @@ function renderApp() {
|
||||
try {
|
||||
const chrome = createChromeController(showAppChrome, page.pageMeta?.shellMode);
|
||||
currentChromeCleanup = () => chrome.dispose();
|
||||
// В переписке нижняя панель прячется (pageMeta.hideToolbar), чтобы не отнимать место у сообщений.
|
||||
// Нижняя панель видна везде, кроме экранов с pageMeta.hideToolbar (например, смена ключей).
|
||||
if (showAppChrome && !page.pageMeta?.hideToolbar) {
|
||||
mountSlot(toolbarEl, '--toolbar-height', renderToolbar(page.pageMeta.id, navigate));
|
||||
toolbarHeightObserver?.sync?.();
|
||||
|
||||
@@ -92,7 +92,38 @@ export function openChannelEditor({
|
||||
const body = document.createElement('div');
|
||||
body.className = 'channel-editor__body';
|
||||
|
||||
if (context && (context.author || context.text || context.attachmentLabel)) {
|
||||
// Цепочка как в Threads: исходная запись и ответы до той, на которую отвечаем, сверху вниз, соединены линией.
|
||||
// Поле ввода – последним звеном; к началу цепочки – прокруткой вверх.
|
||||
const chain = Array.isArray(context?.chain) ? context.chain.filter(Boolean) : [];
|
||||
if (chain.length) {
|
||||
const chainBox = document.createElement('ol');
|
||||
chainBox.className = 'channel-editor__chain';
|
||||
chainBox.setAttribute('aria-label', 'На что вы отвечаете');
|
||||
chain.forEach((item) => {
|
||||
const row = document.createElement('li');
|
||||
row.className = 'channel-editor__chain-item';
|
||||
const avatar = item.avatar instanceof Node ? item.avatar : renderUserAvatar({ login: item.author || 'unknown', className: 'avatar-plain', size: 'sm' });
|
||||
avatar.classList.add('channel-editor__chain-avatar');
|
||||
const main = document.createElement('div');
|
||||
main.className = 'channel-editor__chain-main';
|
||||
const head = document.createElement('div');
|
||||
head.className = 'channel-editor__chain-head';
|
||||
const name = document.createElement('strong');
|
||||
name.textContent = String(item.title || item.author || '');
|
||||
head.append(name);
|
||||
if (item.time) {
|
||||
const time = document.createElement('span');
|
||||
time.textContent = item.time;
|
||||
head.append(time);
|
||||
}
|
||||
const text = document.createElement('p');
|
||||
text.textContent = String(item.text || item.attachmentLabel || 'Запись без текста');
|
||||
main.append(head, text);
|
||||
row.append(avatar, main);
|
||||
chainBox.append(row);
|
||||
});
|
||||
body.append(chainBox);
|
||||
} else if (context && (context.author || context.text || context.attachmentLabel)) {
|
||||
const contextBox = document.createElement('div');
|
||||
contextBox.className = 'channel-editor__context';
|
||||
const contextTitle = document.createElement('strong');
|
||||
@@ -147,6 +178,7 @@ export function openChannelEditor({
|
||||
authorText.append(where);
|
||||
}
|
||||
author.append(authorText);
|
||||
if (chain.length) author.classList.add('is-chained');
|
||||
body.append(author);
|
||||
body.append(textarea, attachmentsBox, error, clearButton);
|
||||
|
||||
@@ -375,7 +407,8 @@ export function openChannelEditor({
|
||||
const expand = overlay.querySelector('.channel-editor__context-toggle');
|
||||
if (quote && expand && quote.clientHeight > 0) expand.hidden = quote.scrollHeight <= quote.clientHeight;
|
||||
sync();
|
||||
textarea.focus();
|
||||
if (chain.length) body.scrollTop = author.offsetTop - body.offsetTop - 120;
|
||||
textarea.focus({ preventScroll: chain.length > 0 });
|
||||
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
|
||||
});
|
||||
return { close };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { appendShineMessageLinks } from '../services/shine-message-links.js';
|
||||
import { confirmDialog } from '../components/confirm-dialog.js';
|
||||
import { iconHtml } from '../components/ui-icon.js';
|
||||
import { rememberChannelPosition, readChannelPosition, restoreChannelPosition } from '../services/channel-view-state.js';
|
||||
import { consumeReplyEditorOnOpen, rememberChannelPosition, readChannelPosition, restoreChannelPosition } from '../services/channel-view-state.js';
|
||||
import { attachMessageMenu } from '../components/message-menu.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
import { authService, getMessageReactionState, setMessageReactionState, state } from '../state.js';
|
||||
@@ -22,7 +22,6 @@ import { getPreviousTrackedPath, parseRouteFromPath } from '../router.js';
|
||||
import { renderAvatar, renderUserAvatar } from '../components/avatar-image.js';
|
||||
import { openChannelEditor } from '../components/channel-editor.js';
|
||||
import { createDropdownMenu } from '../components/dropdown-menu.js';
|
||||
import { createEmojiPicker } from '../components/emoji-picker.js';
|
||||
import { openShareSheet } from '../components/share-sheet.js';
|
||||
import {
|
||||
composeMessageWithAttachments,
|
||||
@@ -34,7 +33,7 @@ import { loadProfileSnapshot } from '../services/user-profile-params.js';
|
||||
import { extractLoginFromBlockchainName, makeProfileRoute, makeShineChannelRoute, makeShineMessageRoute } from '../services/shine-routes.js';
|
||||
import { parsePublicationOrdinal, publicationAtOrdinal, ordinalForPublication } from '../services/channel-message-ordinals.js';
|
||||
|
||||
export const pageMeta = { id: 'channel-thread-view', title: 'Обсуждение', hideToolbar: true, shellMode: { scrollbar: 'hidden', topFade: false, contentUnderTopbar: false, contentWidth: 'wide' } };
|
||||
export const pageMeta = { id: 'channel-thread-view', title: 'Обсуждение', shellMode: { scrollbar: 'hidden', topFade: false, contentUnderTopbar: false, contentWidth: 'wide' } };
|
||||
const MSG_SUBTYPE_TEXT_POST = 10;
|
||||
const MSG_SUBTYPE_TEXT_RATING = 30;
|
||||
const MSG_SUBTYPE_TEXT_ENTRYPOINT = 100;
|
||||
@@ -883,6 +882,7 @@ function renderNodeCard(node, heading, handlers, localNumber, { focusPost = fals
|
||||
handlers.navigate('login-view');
|
||||
return;
|
||||
}
|
||||
if (focusPost && handlers.openReplyEditor) { handlers.openReplyEditor(node); return; }
|
||||
openReplyModal({
|
||||
onSubmit: async (textValue) => handlers.onReply(target, textValue),
|
||||
isActive: handlers.isActive,
|
||||
@@ -925,7 +925,7 @@ function renderNodeCard(node, heading, handlers, localNumber, { focusPost = fals
|
||||
discussionButton.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
animatePress(event.currentTarget);
|
||||
if (focusPost) card.closest('.channels-screen')?.querySelector('.thread-block--replies')?.scrollIntoView({ block: 'start', behavior: 'smooth' });
|
||||
if (focusPost) handlers.openReplyEditor?.(node);
|
||||
else handlers.onOpenThread(target);
|
||||
});
|
||||
// Тот же вид и порядок кнопок, что в ленте канала.
|
||||
@@ -1219,6 +1219,12 @@ function renderComment({ node, parent, focus, channelOwner, handlers, nested = f
|
||||
actions.append(like, reply);
|
||||
main.append(actions);
|
||||
item.append(who, main);
|
||||
// Как в Threads: нажатие на ответ открывает его обсуждение (кнопки, ссылки и вложения работают сами по себе).
|
||||
item.addEventListener('click', (event) => {
|
||||
if (event.target.closest('button, a, .message-attachment-carousel')) return;
|
||||
if (String(window.getSelection?.() || '').trim()) return;
|
||||
handlers.onOpenThread(target);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -1365,114 +1371,6 @@ function setThreadMuted(key, muted) {
|
||||
// Глубина дерева ответов за один запрос; что глубже – открывается обсуждением конкретного ответа.
|
||||
const THREAD_LOAD_DEPTH = 8;
|
||||
|
||||
// Черновик и адресат ответа принадлежат конкретному обсуждению
|
||||
const threadDrafts = new Map();
|
||||
|
||||
function createThreadComposer({ draftKey, isAuthorized, onLogin, onSend }) {
|
||||
const root = document.createElement('div');
|
||||
root.className = 'channel-composer thread-composer';
|
||||
if (!isAuthorized) {
|
||||
const login = document.createElement('button');
|
||||
login.type = 'button';
|
||||
login.className = 'primary-btn channel-main-action';
|
||||
login.textContent = 'Войти / зарегистрироваться';
|
||||
login.addEventListener('click', onLogin);
|
||||
root.append(login);
|
||||
return { root, setReplyTo() {} };
|
||||
}
|
||||
const draft = threadDrafts.get(draftKey) || { text: '', replyTo: null };
|
||||
threadDrafts.set(draftKey, draft);
|
||||
|
||||
const replying = document.createElement('div');
|
||||
replying.className = 'thread-replying';
|
||||
const row = document.createElement('div');
|
||||
row.className = 'compose-row';
|
||||
const field = document.createElement('div');
|
||||
field.className = 'compose-field';
|
||||
const input = document.createElement('textarea');
|
||||
input.rows = 1;
|
||||
input.className = 'compose-field__input';
|
||||
input.value = draft.text;
|
||||
const emojiBtn = document.createElement('button');
|
||||
emojiBtn.type = 'button';
|
||||
emojiBtn.className = 'compose-field__emoji';
|
||||
emojiBtn.setAttribute('aria-label', 'Эмодзи');
|
||||
emojiBtn.innerHTML = iconHtml('emoji');
|
||||
field.append(input, emojiBtn);
|
||||
const send = document.createElement('button');
|
||||
send.type = 'button';
|
||||
send.className = 'compose-send';
|
||||
send.setAttribute('aria-label', 'Отправить');
|
||||
send.innerHTML = iconHtml('send');
|
||||
row.append(field, send);
|
||||
const emojiSlot = document.createElement('div');
|
||||
emojiSlot.className = 'thread-composer__emoji';
|
||||
emojiSlot.hidden = true;
|
||||
root.append(replying, row, emojiSlot);
|
||||
|
||||
const sync = () => {
|
||||
draft.text = input.value;
|
||||
send.disabled = !input.value.trim();
|
||||
input.placeholder = draft.replyTo ? `Ответить ${draft.replyTo.authorLogin || ''}…` : 'Написать комментарий…';
|
||||
replying.replaceChildren();
|
||||
replying.hidden = !draft.replyTo;
|
||||
if (draft.replyTo) {
|
||||
const quote = document.createElement('div');
|
||||
quote.className = 'thread-quote';
|
||||
const a = document.createElement('strong');
|
||||
a.textContent = String(draft.replyTo.authorLogin || '');
|
||||
const t = document.createElement('span');
|
||||
t.textContent = parseMessageAttachments(resolveNodeText(draft.replyTo)).text;
|
||||
quote.append(a, t);
|
||||
const cancel = document.createElement('button');
|
||||
cancel.type = 'button';
|
||||
cancel.className = 'thread-replying__cancel';
|
||||
cancel.setAttribute('aria-label', 'Не отвечать на комментарий');
|
||||
cancel.innerHTML = iconHtml('close');
|
||||
cancel.addEventListener('click', () => { draft.replyTo = null; sync(); });
|
||||
replying.append(quote, cancel);
|
||||
}
|
||||
};
|
||||
input.addEventListener('input', sync);
|
||||
emojiBtn.addEventListener('click', () => {
|
||||
if (!emojiSlot.childElementCount) {
|
||||
emojiSlot.append(createEmojiPicker({ onSelect: (emoji) => {
|
||||
const at = input.selectionStart ?? input.value.length;
|
||||
input.value = `${input.value.slice(0, at)}${emoji}${input.value.slice(at)}`;
|
||||
sync();
|
||||
} }));
|
||||
}
|
||||
emojiSlot.hidden = !emojiSlot.hidden;
|
||||
});
|
||||
const submit = async () => {
|
||||
const text = input.value.trim();
|
||||
if (!text) return;
|
||||
send.disabled = true;
|
||||
try {
|
||||
await onSend(text, draft.replyTo);
|
||||
draft.text = '';
|
||||
draft.replyTo = null;
|
||||
input.value = '';
|
||||
emojiSlot.hidden = true;
|
||||
} catch (error) {
|
||||
showToast(toUserMessage(error, 'Комментарий не отправлен. Текст сохранён.'), { kind: 'error' });
|
||||
} finally {
|
||||
sync();
|
||||
}
|
||||
};
|
||||
send.addEventListener('click', submit);
|
||||
bindSubmitOnPlainEnter(input, submit);
|
||||
sync();
|
||||
return {
|
||||
root,
|
||||
setReplyTo(node) {
|
||||
draft.replyTo = node;
|
||||
sync();
|
||||
input.focus();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function render({ navigate, route, chrome }) {
|
||||
let selector = parseThreadSelector(route);
|
||||
const channelDisplayName = resolveChannelDisplayName(selector?.channel);
|
||||
@@ -1552,9 +1450,13 @@ export function render({ navigate, route, chrome }) {
|
||||
return { login, storagePwd };
|
||||
};
|
||||
|
||||
let replyEditorOpener = null;
|
||||
// Пришли по «Обсуждение» из ленты – после первой загрузки сразу открыть редактор ответа.
|
||||
let openEditorOnLoad = consumeReplyEditorOnOpen(window.location.pathname);
|
||||
const handlers = {
|
||||
navigate,
|
||||
isActive: () => !disposed,
|
||||
openReplyEditor: (node) => replyEditorOpener?.(node),
|
||||
onToggleLike: async (target, action) => {
|
||||
if (!state.session.isAuthorized) {
|
||||
state.authReturnHash = window.location.pathname || '/channels';
|
||||
@@ -2025,7 +1927,6 @@ export function render({ navigate, route, chrome }) {
|
||||
returnKey = fromKey;
|
||||
returnBtn.hidden = false;
|
||||
},
|
||||
setReplyTo: (node) => composerApi?.setReplyTo(node),
|
||||
shareComment: (node) => openShareSheet({
|
||||
title: 'Поделиться комментарием',
|
||||
kicker: `${node.authorLogin} · комментарий`,
|
||||
@@ -2048,15 +1949,82 @@ export function render({ navigate, route, chrome }) {
|
||||
}
|
||||
screen.append(listWrap, returnBtn);
|
||||
|
||||
let composerApi = null;
|
||||
if (focus) {
|
||||
composerApi = createThreadComposer({
|
||||
draftKey: routeKey,
|
||||
isAuthorized: state.session.isAuthorized,
|
||||
onLogin: () => { state.authReturnHash = window.location.pathname || '/channels'; navigate('login-view'); },
|
||||
onSend: async (text, replyTo) => handlers.onReply(replyTo ? buildTargetFromNode(replyTo) : focusTarget, text),
|
||||
// Ответ пишется в том же редакторе, что и запись канала; над полем – цепочка до исходной записи.
|
||||
const parentByKey = new Map();
|
||||
const indexParents = (items, parent) => (Array.isArray(items) ? items : []).forEach((branch) => {
|
||||
if (!branch?.node) return;
|
||||
parentByKey.set(nodeKey(branch.node), parent);
|
||||
indexParents(branch.children, branch.node);
|
||||
});
|
||||
indexParents(descendants, focus);
|
||||
const chainItem = (node) => {
|
||||
const parsedNode = parseMessageAttachments(resolveNodeText(node));
|
||||
// Начало цепочки – запись канала: показываем её от имени канала, как в ленте.
|
||||
const isRoot = ancestors.length ? node === ancestors[0] : node === focus;
|
||||
const isChannelPost = isRoot && Boolean(selector?.channel?.ownerBlockchainName)
|
||||
&& String(node?.authorBlockchainName || '').toLowerCase() === String(selector.channel.ownerBlockchainName).toLowerCase();
|
||||
const item = {
|
||||
author: String(node?.authorLogin || ''),
|
||||
time: formatShortAge(node?.createdAtMs),
|
||||
text: parsedNode.text,
|
||||
attachmentLabel: parsedNode.attachments.length ? 'Вложение' : '',
|
||||
};
|
||||
if (isChannelPost) {
|
||||
item.title = title;
|
||||
item.avatar = renderAvatar({
|
||||
initials: (title[0] || 'К').toUpperCase(),
|
||||
avatar: (avatarAr || avatarSha256) ? { ar: avatarAr, sha256Hex: avatarSha256 } : null,
|
||||
authorLogin: item.author,
|
||||
size: 'xl',
|
||||
className: 'channel-profile-avatar',
|
||||
title,
|
||||
alt: 'Аватар канала',
|
||||
});
|
||||
item.avatar.style.setProperty('--channel-avatar-size', '40px');
|
||||
}
|
||||
return item;
|
||||
};
|
||||
replyEditorOpener = (node) => {
|
||||
if (!node || disposed) return;
|
||||
const path = [];
|
||||
for (let cur = node; cur && cur !== focus; cur = parentByKey.get(nodeKey(cur))) path.unshift(cur);
|
||||
const chain = [...ancestors, focus, ...path].filter(Boolean).map(chainItem);
|
||||
openChannelEditor({
|
||||
id: 'thread-reply-modal',
|
||||
title: 'Ответ',
|
||||
submitLabel: 'Ответить',
|
||||
placeholder: `Ответить ${node.authorLogin || ''}…`,
|
||||
context: { chain },
|
||||
key: `thread-reply:${nodeKey(node)}`,
|
||||
isActive: () => !disposed,
|
||||
onSubmit: ({ text }) => handlers.onReply(buildTargetFromNode(node), text),
|
||||
});
|
||||
chrome?.setComposer(composerApi.root);
|
||||
};
|
||||
commentHandlers.setReplyTo = (node) => {
|
||||
if (!state.session.isAuthorized) { state.authReturnHash = window.location.pathname || '/channels'; navigate('login-view'); return; }
|
||||
replyEditorOpener(node);
|
||||
};
|
||||
if (focus) {
|
||||
const bar = document.createElement('div');
|
||||
bar.className = 'channel-composer thread-composer';
|
||||
const open = document.createElement('button');
|
||||
open.type = 'button';
|
||||
if (state.session.isAuthorized) {
|
||||
open.className = 'channel-compose-bar';
|
||||
open.innerHTML = `<span class="channel-compose-bar__text"></span><span class="channel-compose-bar__icon" aria-hidden="true">${iconHtml('send')}</span>`;
|
||||
open.querySelector('.channel-compose-bar__text').textContent = `Ответить ${focus.authorLogin || ''}…`;
|
||||
open.addEventListener('click', () => replyEditorOpener(focus));
|
||||
} else {
|
||||
open.className = 'primary-btn channel-main-action';
|
||||
open.textContent = 'Войти, чтобы ответить';
|
||||
open.addEventListener('click', () => { state.authReturnHash = window.location.pathname || '/channels'; navigate('login-view'); });
|
||||
}
|
||||
bar.append(open);
|
||||
chrome?.setComposer(bar);
|
||||
if (openEditorOnLoad && state.session.isAuthorized) {
|
||||
openEditorOnLoad = false;
|
||||
trackTimer(window.setTimeout(() => { if (!disposed) replyEditorOpener?.(focus); }, 60));
|
||||
}
|
||||
}
|
||||
const focusWrap = screen.querySelector('.thread-block--focus');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { appendShineMessageLinks } from '../services/shine-message-links.js';
|
||||
import { confirmDialog } from '../components/confirm-dialog.js';
|
||||
import { iconHtml } from '../components/ui-icon.js';
|
||||
import { rememberChannelPosition, readChannelPosition, restoreChannelPosition } from '../services/channel-view-state.js';
|
||||
import { rememberChannelPosition, readChannelPosition, requestReplyEditorOnOpen, restoreChannelPosition } from '../services/channel-view-state.js';
|
||||
import { getPreviousTrackedPath } from '../router.js';
|
||||
import { attachMessageMenu } from '../components/message-menu.js';
|
||||
import { createTopBar } from '../components/topbar.js';
|
||||
@@ -50,7 +50,7 @@ import {
|
||||
import { parseDmTechBlocks } from '../services/dm-tech-blocks.js';
|
||||
import { sortedChannelPublications } from '../services/channel-message-ordinals.js';
|
||||
|
||||
export const pageMeta = { id: 'channel-view', title: 'Канал', hideToolbar: true, shellMode: { scrollbar: 'hidden', topFade: false, contentUnderTopbar: false, contentWidth: 'wide' } };
|
||||
export const pageMeta = { id: 'channel-view', title: 'Канал', shellMode: { scrollbar: 'hidden', topFade: false, contentUnderTopbar: false, contentWidth: 'wide' } };
|
||||
const CHANNEL_TYPE_STORIES = 0;
|
||||
const CHANNEL_TYPE_PERSONAL = 100;
|
||||
const MSG_SUBTYPE_TEXT_RATING = 30;
|
||||
@@ -2102,11 +2102,24 @@ function renderPostCard(post, {
|
||||
discussionButton.append(faces);
|
||||
}
|
||||
setActionTitle(discussionButton, `Открыть обсуждение, ответов: ${post.repliesCount || 0}`);
|
||||
// По ТЗ: «Обсуждение» открывает запись с обсуждением и сразу редактор ответа (гостю – только обсуждение).
|
||||
const openDiscussion = ({ withEditor = false } = {}) => {
|
||||
const route = buildThreadRoute(post, selector);
|
||||
if (!route) return;
|
||||
if (withEditor && state.session.isAuthorized) requestReplyEditorOnOpen(route);
|
||||
navigate(route);
|
||||
};
|
||||
discussionButton.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
const route = buildThreadRoute(post, selector);
|
||||
if (route) navigate(route);
|
||||
openDiscussion({ withEditor: true });
|
||||
});
|
||||
// Нажатие на саму запись открывает её вместе с обсуждением.
|
||||
card.addEventListener('click', (event) => {
|
||||
if (event.target.closest('button, a, input, textarea, .message-attachment-carousel')) return;
|
||||
if (String(window.getSelection?.() || '').trim()) return;
|
||||
openDiscussion();
|
||||
});
|
||||
card.classList.add('is-openable');
|
||||
|
||||
const replyButton = document.createElement('button');
|
||||
replyButton.type = 'button';
|
||||
@@ -2120,6 +2133,7 @@ function renderPostCard(post, {
|
||||
replyButton.addEventListener('click', (event) => {
|
||||
event.stopPropagation();
|
||||
animatePress(event.currentTarget);
|
||||
if (state.session.isAuthorized) { openDiscussion({ withEditor: true }); return; }
|
||||
openReplyModal({
|
||||
onSubmit: async (text) => onReply(post.messageRef, text),
|
||||
isActive,
|
||||
|
||||
@@ -46,7 +46,6 @@ import { makeProfileLinksRoute, makeProfileRoute } from '../services/shine-route
|
||||
export const pageMeta = {
|
||||
id: 'chat-view',
|
||||
title: 'Чат',
|
||||
hideToolbar: true,
|
||||
shellMode: {
|
||||
topFade: true,
|
||||
bottomFade: true,
|
||||
|
||||
@@ -8,3 +8,18 @@ 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;
|
||||
}
|
||||
|
||||
@@ -123,6 +123,17 @@
|
||||
.channel-editor__author { display: flex; align-items: center; gap: 12px; font-size: .875rem; }
|
||||
.channel-editor__author .avatar { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
|
||||
.channel-editor__context-toggle[hidden] { display: none; }
|
||||
.channel-editor__chain { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
|
||||
.channel-editor__chain-item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; padding-bottom: 16px; }
|
||||
/* Линия от аватара вниз – к следующему звену и к автору ответа. */
|
||||
.channel-editor__chain-item::after { content: ''; position: absolute; top: 44px; bottom: -2px; left: 19px; border-left: 2px solid var(--border-control); }
|
||||
.channel-editor__chain-item .avatar.channel-editor__chain-avatar { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
|
||||
.channel-editor__chain-main { min-width: 0; }
|
||||
.channel-editor__chain-head { display: flex; align-items: baseline; gap: 6px; min-height: 22px; }
|
||||
.channel-editor__chain-head strong { font-size: .9375rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.channel-editor__chain-head span { flex-shrink: 0; color: var(--text-secondary); font-size: .875rem; }
|
||||
.channel-editor__chain-main p { margin: 2px 0 0; color: var(--text-primary); font-size: .9375rem; line-height: 1.4375rem; white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.channel-editor__author.is-chained { margin-top: -4px; }
|
||||
.channel-editor__attach[hidden], .channel-editor__clear[hidden] { display: none; }
|
||||
|
||||
.channel-editor__attachment {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.thread-section-title { margin: 12px 0 4px; font-size: .8125rem; font-weight: 600; color: var(--text-primary); }
|
||||
.thread-group { position: relative; padding: 12px 0 6px; }
|
||||
.thread-group + .thread-group { border-top: 1px solid var(--border-subtle); }
|
||||
.channels-screen .thread-comment { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; scroll-margin: 16px; }
|
||||
.channels-screen .thread-comment { cursor: pointer; position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; scroll-margin: 16px; }
|
||||
.channels-screen .thread-comment--nested { grid-template-columns: 28px minmax(0, 1fr); margin-top: 10px; }
|
||||
.thread-comment.is-highlight { background: var(--surface-selected); box-shadow: 0 0 0 6px var(--surface-selected); border-radius: 4px; }
|
||||
.thread-comment__who { align-self: start; padding: 0; border: 0; background: transparent; cursor: pointer; }
|
||||
@@ -52,13 +52,6 @@ button.thread-quote:hover { background: var(--surface); }
|
||||
.thread-return { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; padding: 9px 12px; border: 1px solid var(--border-subtle); border-radius: 20px; background: var(--surface-raised); color: var(--text-primary); font: inherit; font-size: .75rem; white-space: nowrap; cursor: pointer; }
|
||||
.thread-empty { padding: 36px 20px; text-align: center; }
|
||||
|
||||
.thread-composer { display: grid; gap: 8px; }
|
||||
.thread-replying { display: flex; gap: 8px; align-items: flex-start; }
|
||||
.thread-replying[hidden] { display: none; }
|
||||
.thread-replying .thread-quote { margin: 0; min-width: 0; cursor: default; }
|
||||
.thread-replying__cancel { width: 32px; height: 32px; flex-shrink: 0; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; }
|
||||
.thread-replying__cancel svg { width: 20px; height: 20px; }
|
||||
.thread-composer__emoji { max-height: 260px; overflow: auto; }
|
||||
|
||||
/* Отдельная публикация в обсуждении использует карточку и действия из ленты. */
|
||||
.thread-block--focus > .channel-message-card { margin-bottom: 8px; }
|
||||
|
||||
@@ -112,6 +112,8 @@
|
||||
.channels-screen--channel, .channels-screen--thread { padding-bottom: 8px; }
|
||||
.channel-message-card--owner .message-attachment-media { height: auto; max-height: 70vh; object-fit: cover; }
|
||||
|
||||
/* Запись открывается нажатием – курсор как у ссылки. */
|
||||
.channels-screen .channel-message-card.is-openable { cursor: pointer; }
|
||||
/* Запись канала в раскладке Threads: аватар канала слева, название и возраст сверху, текст и действия – колонкой под названием. */
|
||||
.channels-screen .channel-message-card.channel-message-card--threads { padding: 14px 0 4px 48px; }
|
||||
.channel-message-card--threads .channel-message-head-row { flex-wrap: nowrap; min-height: 22px; }
|
||||
|
||||
Reference in New Issue
Block a user