From 161d422dabd076194bd23215256cbacacd666f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Tue, 17 Mar 2026 10:41:40 +0100 Subject: [PATCH] nicolium: add connectors to ancestors in indented tree mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../status/components/thread-status.tsx | 10 +++++-- .../src/features/status/components/thread.tsx | 28 +++++++++++-------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/packages/nicolium/src/features/status/components/thread-status.tsx b/packages/nicolium/src/features/status/components/thread-status.tsx index a4b0c42a3..56b0a8ee1 100644 --- a/packages/nicolium/src/features/status/components/thread-status.tsx +++ b/packages/nicolium/src/features/status/components/thread-status.tsx @@ -19,6 +19,7 @@ interface IThreadStatus { onMoveDown: (id: string) => void; linear?: boolean; depth?: number; + isAncestor?: boolean; } /** Status with reply-connector in threads. */ @@ -46,7 +47,7 @@ const ThreadStatus: React.FC = (props): React.JSX.Element => { } const renderTreeConnector = (): React.JSX.Element | null => { - if (props.linear || isIndentMode) return null; + if (props.linear || (isIndentMode && !props.isAncestor)) return null; const isConnectedTop = replyToId && replyToId !== focusedStatusId; const isConnectedBottom = replyCount > 0; @@ -74,9 +75,12 @@ const ThreadStatus: React.FC = (props): React.JSX.Element => { return (
- {isIndentMode && depth > 0 && } + {isIndentMode && depth > 0 && !props.isAncestor && } {renderTreeConnector()}
0 ? { marginInlineStart: `${depth}rem` } : undefined}>{status}
{props.linear && ( diff --git a/packages/nicolium/src/features/status/components/thread.tsx b/packages/nicolium/src/features/status/components/thread.tsx index 90fe28466..e6db1dcbe 100644 --- a/packages/nicolium/src/features/status/components/thread.tsx +++ b/packages/nicolium/src/features/status/components/thread.tsx @@ -218,18 +218,22 @@ const Thread = ({
); - const renderStatus = (id: string) => ( - - ); + const renderStatus = (id: string) => { + const isAncestor = treeIndent && thread.indexOf(id) < statusIndex; + return ( + + ); + }; const renderPendingStatus = (id: string) => { const idempotencyKey = id.replace(/^末pending-/, '');