Skip to content

Commit 1fd8ba6

Browse files
committed
Added an icon to partially read threads
This wasn't too clearly visible before, and this is probably the most important type of thread - one where the user read some messages, but not all of them.
1 parent da0d3ca commit 1fd8ba6

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

app/assets/stylesheets/components/topics.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@
158158
}
159159
}
160160

161+
.topic-icon-reading {
162+
background-color: var(--color-bg-activity-team);
163+
164+
.topic-icon-badge {
165+
background-color: var(--color-bg-activity-team);
166+
}
167+
}
168+
161169
.activity-team {
162170
background-color: var(--color-bg-activity-team);
163171

app/views/topics/_topics.html.slim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- other_team_readers = filtered_readers.reject { |r| r[:user].id == current_user&.id }.uniq { |r| r[:user].id }
88
tr class="topic-row topic-#{state[:status]}" data-topic-id=topic.id data-last-message-id=topic.messages.maximum(:id)
99
td class="topic-title status-border status-#{state[:status] || 'new'}" data-label="Topic"
10+
- if state[:status] == :reading
11+
.topic-icon.topic-icon-reading
12+
i.fa-solid.fa-message
13+
- unread_count = topic.messages.count - state[:read_count]
14+
span.topic-icon-badge = unread_count < 10 ? unread_count : "9+"
1015
- if user_signed_in? && other_team_readers.any?
1116
- reader_count = other_team_readers.size
1217
div class="topic-icon activity-team-read" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide"

0 commit comments

Comments
 (0)