From 1dc1378f9cc5fe9745cbffbe7385ff64efe67988 Mon Sep 17 00:00:00 2001 From: "Evgeny @ SimpleX Chat" <259188159+evgeny-simplex@users.noreply.github.com> Date: Tue, 2 Jun 2026 21:30:37 +0000 Subject: [PATCH] welcome message --- website/src/js/channel-preview.jsc | 53 ++++++++---------------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/website/src/js/channel-preview.jsc b/website/src/js/channel-preview.jsc index 7c0536ca81..4ae0cd8bdc 100644 --- a/website/src/js/channel-preview.jsc +++ b/website/src/js/channel-preview.jsc @@ -506,37 +506,6 @@ const STYLE = ` margin: 0 0 16px; } -.simplex-preview-info-section { - font-size: 14px; - line-height: 1.5; - margin-bottom: 12px; - word-wrap: break-word; - overflow-wrap: break-word; -} - -.simplex-preview-info-section a { - color: var(--sp-link); - text-decoration: none; -} - -.simplex-preview-info-section a:hover { - text-decoration: underline; -} - -.simplex-preview-info-section .secret { - background: var(--sp-text-secondary); - color: transparent; - border-radius: 4px; - cursor: pointer; - user-select: none; - transition: all 0.2s; -} - -.simplex-preview-info-section .secret.visible { - background: transparent; - color: inherit; -} - .simplex-preview-info .simplex-preview-join-btn { display: block; text-align: center; @@ -802,7 +771,19 @@ function render(container, data, channelLink, showAppBadges) { const messagesDiv = document.createElement('div'); messagesDiv.className = 'simplex-preview-messages'; - renderMessages(messagesDiv, messages, membersMap, channel); + const welcome = data.welcomeMessage || channel.description; + var allMessages = messages; + if (welcome) { + var welcomeMsg = { + sender: null, + ts: messages.length > 0 ? messages[0].ts : new Date().toISOString(), + content: { type: 'text', text: typeof welcome === 'string' ? welcome : '' }, + formattedText: Array.isArray(welcome) ? welcome : null, + reactions: [] + }; + allMessages = [welcomeMsg].concat(messages); + } + renderMessages(messagesDiv, allMessages, membersMap, channel); main.appendChild(messagesDiv); container.appendChild(main); @@ -906,14 +887,6 @@ function renderInfoContent(container, data, channelLink, subscriberCount, showAp container.appendChild(subs); } - const welcome = data.welcomeMessage || channel.description; - if (welcome) { - const section = document.createElement('div'); - section.className = 'simplex-preview-info-section'; - section.innerHTML = Array.isArray(welcome) ? renderMarkdown(welcome) : escapeHtml(welcome); - container.appendChild(section); - } - if (channelLink) { const showJoinSection = !isMobile.any() || showAppBadges; if (showJoinSection) {