From 50342b12a29a1baf4b0ebdf58e6c50900fc97f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Tue, 10 Feb 2026 16:01:57 +0100 Subject: [PATCH] nicolium: a likely correct implementation of vertical posts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../pl-fe/src/components/status-content.tsx | 13 +++++++------ packages/pl-fe/src/styles/markup.scss | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/pl-fe/src/components/status-content.tsx b/packages/pl-fe/src/components/status-content.tsx index 50e8c27d0..8401cd922 100644 --- a/packages/pl-fe/src/components/status-content.tsx +++ b/packages/pl-fe/src/components/status-content.tsx @@ -95,7 +95,7 @@ const StatusContent: React.FC = React.memo(({ const [onlyEmoji, setOnlyEmoji] = useState(false); const [lineClamp, setLineClamp] = useState(true); - const node = useRef(null); + const contentNode = useRef(null); const spoilerNode = useRef(null); const { collapseStatuses, expandStatuses } = useStatusMetaActions(); @@ -107,17 +107,17 @@ const StatusContent: React.FC = React.memo(({ const expanded = !withSpoiler || statusMeta.expanded || false; const maybeSetCollapsed = (): void => { - if (!node.current) return; + if (!contentNode.current) return; if (collapsable || preview) { // 20px * x lines (+ 2px padding at the top) - setCollapsed(node.current.clientHeight >= (preview ? 82 : isQuote ? 202 : 282)); + setCollapsed(contentNode.current.clientHeight >= (preview ? 82 : isQuote ? 202 : 282) || contentNode.current.scrollWidth > contentNode.current.clientWidth); } }; const maybeSetOnlyEmoji = (): void => { - if (!node.current) return; - const only = isOnlyEmoji(node.current, BIG_EMOJI_LIMIT, true); + if (!contentNode.current) return; + const only = isOnlyEmoji(contentNode.current, BIG_EMOJI_LIMIT, true); if (only !== onlyEmoji) { setOnlyEmoji(only); @@ -190,6 +190,7 @@ const StatusContent: React.FC = React.memo(({ 'max-h-[202px]': collapsable && collapsed === null && isQuote, 'max-h-[82px]': collapsed === null && preview, 'leading-normal big-emoji': onlyEmoji, + '⁂-status-content__expanded': !collapsable, }), [collapsed, onlyEmoji]); const expandable = !displaySpoilers; @@ -268,7 +269,7 @@ const StatusContent: React.FC = React.memo(({ if (status.content) { output.push(