SHA256
UI: обсуждения по ТЗ – открытие записи, общий редактор ответа, нижняя панель
Нижняя панель снова видна в канале, обсуждении и личном чате. Нажатие на запись в ленте открывает её вместе с обсуждением; «Обсуждение» и «Ответить» открывают обсуждение и сразу редактор ответа. Нажатие на ответ в обсуждении открывает его как отдельное обсуждение. Ответ пишется в том же редакторе, что и запись канала (с вложениями): над полем – цепочка от исходной записи до той, на которую отвечаем, с аватарами и линией, как в Threads. Строка внизу обсуждения «Ответить …» открывает этот редактор; простое поле ввода убрано.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user