From a63368e871f32107e8343384d6b8740ce19ca2eb Mon Sep 17 00:00:00 2001 From: Zed Date: Fri, 8 Nov 2019 22:53:11 +0100 Subject: [PATCH] Fix thread line gap above pinned tweet threads --- src/sass/tweet/card.scss | 1 + src/sass/tweet/thread.scss | 17 +++++++++++++++++ src/views/timeline.nim | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/sass/tweet/card.scss b/src/sass/tweet/card.scss index 1e65b74..680b379 100644 --- a/src/sass/tweet/card.scss +++ b/src/sass/tweet/card.scss @@ -24,6 +24,7 @@ } .attachments { + margin: 0; border-radius: 0; } } diff --git a/src/sass/tweet/thread.scss b/src/sass/tweet/thread.scss index 5dd3cc2..c70fe80 100644 --- a/src/sass/tweet/thread.scss +++ b/src/sass/tweet/thread.scss @@ -45,6 +45,23 @@ pointer-events: none; } + .with-header:not(:first-child)::after { + background: var(--accent_dark); + content: ''; + position: relative; + float: left; + min-width: 3px; + width: 3px; + right: calc(100% - 26px); + border-radius: 2px; + margin-left: -3px; + margin-bottom: 37px; + bottom: 10px; + height: 30px; + z-index: 1; + pointer-events: none; + } + .unavailable::before { top: 48px; margin-bottom: 28px; diff --git a/src/views/timeline.nim b/src/views/timeline.nim index 5c529e4..5e2e9c7 100644 --- a/src/views/timeline.nim +++ b/src/views/timeline.nim @@ -41,7 +41,8 @@ proc renderThread(thread: seq[Tweet]; prefs: Prefs; path: string): VNode = let sortedThread = thread.sortedByIt(it.id) for i, tweet in sortedThread: let show = i == thread.high and sortedThread[0].id != tweet.threadId - renderTweet(tweet, prefs, path, class="thread", + let header = if tweet.pinned or tweet.retweet.isSome: "with-header " else: "" + renderTweet(tweet, prefs, path, class=(header & "thread"), index=i, total=thread.high, showThread=show) proc threadFilter(it: Tweet; thread: int): bool =