SHA256
Channels UI surgical cleanup and create description save fix
This commit is contained in:
@@ -132,8 +132,8 @@ export function render({ navigate }) {
|
||||
});
|
||||
|
||||
const baseMessage = `Канал "${normalizeChannelDisplayName(check.name)}" создан.`;
|
||||
const successMessage = created?.usedLegacyDescriptionFallback
|
||||
? `${baseMessage} Описание не сохранено: на текущем сервере включен legacy-формат create-channel.`
|
||||
const successMessage = created?.usedLegacyDescriptionFallback && created?.savedDescriptionViaUserParam
|
||||
? `${baseMessage} Описание сохранено через блок параметра.`
|
||||
: baseMessage;
|
||||
persistCreateSuccessFlash(successMessage);
|
||||
navigate('channels-list');
|
||||
|
||||
@@ -363,6 +363,8 @@ export function render({ navigate, route }) {
|
||||
|
||||
const screen = document.createElement('section');
|
||||
screen.className = 'stack channels-screen channels-screen--thread';
|
||||
const appScreen = document.getElementById('app-screen');
|
||||
appScreen?.classList.add('channels-scroll-clean');
|
||||
|
||||
const userIndicator = document.createElement('div');
|
||||
userIndicator.className = 'card channels-user-chip';
|
||||
@@ -538,5 +540,9 @@ export function render({ navigate, route }) {
|
||||
}
|
||||
})();
|
||||
|
||||
screen.cleanup = () => {
|
||||
appScreen?.classList.remove('channels-scroll-clean');
|
||||
};
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
||||
@@ -605,21 +605,12 @@ function renderBody(screen, navigate, routeKey, channelData, handlers) {
|
||||
title.className = 'channel-head-title';
|
||||
title.textContent = channelData.channel.displayName || channelData.channel.name;
|
||||
|
||||
const description = document.createElement('p');
|
||||
description.className = 'channel-head-description';
|
||||
const hasDescription = !!String(channelData.channel.description || '').trim();
|
||||
if (hasDescription) {
|
||||
description.textContent = channelData.channel.description;
|
||||
} else if (channelData.isOwnChannel) {
|
||||
description.textContent = 'Описание пока не задано.';
|
||||
}
|
||||
|
||||
const owner = document.createElement('p');
|
||||
owner.className = 'channel-head-meta';
|
||||
owner.textContent = `Владелец: ${channelData.channel.ownerName}`;
|
||||
|
||||
const headActions = document.createElement('div');
|
||||
headActions.className = 'row';
|
||||
headActions.className = 'channel-head-actions';
|
||||
const aboutButton = document.createElement('button');
|
||||
aboutButton.type = 'button';
|
||||
aboutButton.className = 'secondary-btn small-btn';
|
||||
@@ -646,20 +637,7 @@ function renderBody(screen, navigate, routeKey, channelData, handlers) {
|
||||
headActions.append(editButton);
|
||||
}
|
||||
|
||||
if (hasDescription) {
|
||||
const moreButton = document.createElement('button');
|
||||
moreButton.type = 'button';
|
||||
moreButton.className = 'channel-head-more';
|
||||
moreButton.textContent = 'ещё';
|
||||
moreButton.addEventListener('click', () => {
|
||||
description.classList.toggle('is-expanded');
|
||||
moreButton.textContent = description.classList.contains('is-expanded') ? 'скрыть' : 'ещё';
|
||||
});
|
||||
headActions.append(moreButton);
|
||||
}
|
||||
|
||||
head.append(title);
|
||||
if (hasDescription || channelData.isOwnChannel) head.append(description);
|
||||
head.append(owner, headActions);
|
||||
|
||||
const actionButton = document.createElement('button');
|
||||
@@ -723,16 +701,8 @@ export function render({ navigate, route }) {
|
||||
|
||||
const screen = document.createElement('section');
|
||||
screen.className = 'stack channels-screen channels-screen--channel';
|
||||
|
||||
const titleFromIndex = state.channelsIndex[channelId]?.channel?.channelName;
|
||||
const ownerFromIndex = state.channelsIndex[channelId]?.channel?.ownerLogin;
|
||||
const titleFromIndexDisplay = (ownerFromIndex && titleFromIndex) ? `${ownerFromIndex}/${titleFromIndex}` : titleFromIndex;
|
||||
const titleFromRoute = route.params.ownerBlockchainName ? String(route.params.ownerBlockchainName) : '';
|
||||
const headerTitle = `Канал: ${titleFromIndexDisplay || titleFromRoute || 'Канал'}`;
|
||||
|
||||
const userIndicator = document.createElement('div');
|
||||
userIndicator.className = 'card channels-user-chip';
|
||||
userIndicator.textContent = `Вы вошли как @${state.session.login || 'неизвестно'}`;
|
||||
const appScreen = document.getElementById('app-screen');
|
||||
appScreen?.classList.add('channels-scroll-clean');
|
||||
|
||||
const statusBox = document.createElement('div');
|
||||
statusBox.className = 'card status-line is-unavailable channels-status';
|
||||
@@ -846,11 +816,11 @@ export function render({ navigate, route }) {
|
||||
|
||||
screen.append(
|
||||
renderHeader({
|
||||
title: headerTitle,
|
||||
title: '',
|
||||
leftAction: { label: '<', onClick: () => navigate('channels-list') },
|
||||
}),
|
||||
);
|
||||
screen.append(userIndicator, statusBox);
|
||||
screen.append(statusBox);
|
||||
|
||||
const skeleton = renderSkeleton(screen);
|
||||
|
||||
@@ -924,5 +894,9 @@ export function render({ navigate, route }) {
|
||||
}
|
||||
})();
|
||||
|
||||
screen.cleanup = () => {
|
||||
appScreen?.classList.remove('channels-scroll-clean');
|
||||
};
|
||||
|
||||
return screen;
|
||||
}
|
||||
|
||||
@@ -39,20 +39,6 @@ export function render({ navigate }) {
|
||||
const card = document.createElement('div');
|
||||
card.className = 'card stack';
|
||||
|
||||
const nextStepCard = document.createElement('div');
|
||||
nextStepCard.className = 'card stack';
|
||||
nextStepCard.innerHTML = `
|
||||
<strong>Вы вошли как @${login}</strong>
|
||||
<p class="meta-muted">Следующий шаг для ручной проверки: откройте вкладку «Каналы» в нижнем меню.</p>
|
||||
`;
|
||||
|
||||
const openChannelsButton = document.createElement('button');
|
||||
openChannelsButton.className = 'primary-btn';
|
||||
openChannelsButton.type = 'button';
|
||||
openChannelsButton.textContent = 'Открыть каналы';
|
||||
openChannelsButton.addEventListener('click', () => navigate('channels-list'));
|
||||
nextStepCard.append(openChannelsButton);
|
||||
|
||||
const topRow = document.createElement('div');
|
||||
topRow.className = 'row';
|
||||
topRow.innerHTML = `
|
||||
@@ -215,7 +201,7 @@ export function render({ navigate }) {
|
||||
shineBtn.addEventListener('click', () => onToggleClick('shine'));
|
||||
|
||||
card.append(topRow, badgesRow, status, listWrap);
|
||||
screen.append(nextStepCard, card);
|
||||
screen.append(card);
|
||||
|
||||
refreshProfileSnapshot();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user