Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions app/assets/stylesheets/components/topics.css
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ a.topic-icon {
gap: var(--spacing-2);
}

.topic-title-icons {
min-width: 0;
}

.topic-icon {
padding: 2px;
margin-right: 0;
Expand Down Expand Up @@ -303,6 +307,14 @@ a.topic-icon {
}
}

.topic-row.topic-reading.has-new-replies {
background: var(--color-bg-unread);

&:hover {
background: var(--color-bg-unread-hover);
}
}

.topic-row.topic-read {
color: var(--color-text-muted);
background: var(--color-bg-read);
Expand All @@ -320,6 +332,8 @@ a.topic-icon {
padding: var(--spacing-2) var(--spacing-4) var(--spacing-2) var(--spacing-2);
align-self: stretch;
height: 100%;
min-width: var(--topic-title-icons-width, 190px);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't look strange?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this look strange? Did you pull and look at it?

flex-shrink: 0;
}

.status-border.has-new-replies::before {
Expand All @@ -329,7 +343,7 @@ a.topic-icon {
top: 0;
bottom: 0;
width: var(--topic-new-replies-strip-width, 260px);
background: var(--color-bg-unread);
background: var(--color-bg-read);
clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
z-index: 0;
}
Expand Down Expand Up @@ -429,8 +443,7 @@ a.topic-icon {

.topic-title-main {
display: grid;
grid-auto-flow: column;
grid-auto-columns: max-content;
grid-template-columns: max-content minmax(0, 1fr);
align-items: stretch;
gap: var(--spacing-2);
height: 100%;
Expand Down Expand Up @@ -511,6 +524,7 @@ a.topic-icon {

.topic-title-mobile {
display: flex;
z-index: auto;
}

.topic-row-footer {
Expand All @@ -531,6 +545,9 @@ a.topic-icon {
font-size: var(--font-size-2xs);
}

.topic-icon-hover {
z-index: 200;
}
}

.topic-link {
Expand All @@ -539,6 +556,9 @@ a.topic-icon {
font-weight: var(--font-weight-semibold);
font-size: var(--font-size-lg);
line-height: var(--line-height-relaxed);
min-width: 0;
white-space: normal;
overflow-wrap: anywhere;

&:hover {
color: var(--color-text-link-hover);
Expand Down
22 changes: 7 additions & 15 deletions app/views/topics/_status_cell.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
- total_count = topic.message_count
- reading_unread_count = [total_count - read_count, 0].max
- status_class = "status-#{status}"
- status_class = "#{status_class} has-new-replies" if status.to_s == "reading" && reading_unread_count.to_i.positive?
- status_class = "#{status_class} has-new-replies" if status.to_s == "reading"
- star_data = star_data || {}
td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell") data-label="Topic"
- creator = topic.creator_display_alias
- last_sender = topic.last_sender_person&.default_alias
.topic-title-main
.topic-title-icons
- if status.to_s == "reading"
- if reading_unread_count.to_i.positive?
= link_to topic_path(topic, anchor: "first-unread"), class: "topic-icon topic-icon-reading", title: "Jump to first unread message (#{reading_unread_count} unread)" do
i.fa-solid.fa-envelope
span.topic-icon-badge.topic-icon-badge-sup = reading_unread_count
- else
.topic-icon.topic-icon-reading title="All messages read"
i.fa-solid.fa-envelope
= link_to topic_path(topic, anchor: "first-unread"), class: "topic-icon topic-icon-reading", title: "Jump to first unread message (#{reading_unread_count} unread)" do
i.fa-solid.fa-envelope
span.topic-icon-badge.topic-icon-badge-sup = reading_unread_count
= render partial: "topics/star_icon", locals: { topic: topic, star_data: star_data }
= render partial: "topics/note_icon", locals: { topic: topic, count: note_count.to_i }
= render partial: "topics/team_readers_icon", locals: { topic: topic, readers: team_readers }
Expand Down Expand Up @@ -47,13 +43,9 @@ td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell")
.topic-icons
.topic-title-icons
- if status.to_s == "reading"
- if reading_unread_count.to_i.positive?
= link_to topic_path(topic, anchor: "first-unread"), class: "topic-icon topic-icon-reading", title: "Jump to first unread message (#{reading_unread_count} unread)" do
i.fa-solid.fa-envelope
span.topic-icon-badge.topic-icon-badge-sup = reading_unread_count
- else
.topic-icon.topic-icon-reading title="All messages read"
i.fa-solid.fa-envelope
= link_to topic_path(topic, anchor: "first-unread"), class: "topic-icon topic-icon-reading", title: "Jump to first unread message (#{reading_unread_count} unread)" do
i.fa-solid.fa-envelope
span.topic-icon-badge.topic-icon-badge-sup = reading_unread_count
= render partial: "topics/star_icon", locals: { topic: topic, star_data: star_data }
= render partial: "topics/note_icon", locals: { topic: topic, count: note_count.to_i }
= render partial: "topics/team_readers_icon", locals: { topic: topic, readers: team_readers }
Expand Down
5 changes: 4 additions & 1 deletion app/views/topics/_topic_row_user.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
- participation = participation || {}
- team_readers = team_readers || []
- star_data = star_data || {}
- status = state[:status] || "new"
- row_class = ["topic-row", "topic-#{status}"]
- row_class << "has-new-replies" if status.to_s == "reading"
- topic_participants_map ||= @topic_participants_map || {}
- tp_data = topic_participants_map[topic.id] || {}
- top_participants = tp_data[:top] || []
- contributor_participants = tp_data[:contributors] || []

tr id=dom_id(topic) class="topic-row topic-#{state[:status] || 'new'}" data-topic-id=topic.id data-last-message-id=topic.last_message_id
tr id=dom_id(topic) class=row_class.join(" ") data-topic-id=topic.id data-last-message-id=topic.last_message_id
= render partial: "topics/status_cell", locals: { topic: topic, state: state, note_count: note_count, team_readers: team_readers, star_data: star_data }
td.topic-activity data-label="Activity"
- replies_count = [topic.message_count - 1, 0].max
Expand Down
2 changes: 2 additions & 0 deletions app/views/topics/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@
- if user_signed_in?
button.button.button-secondary.button-small data-action="click->thread-actions#markAllRead" Mark all messages read
= link_to "Jump to latest", "#message-#{last_message.id}", class: "button button-secondary button-small", title: "Jump to latest message", "aria-label": "Jump to latest message"
- if user_signed_in?
= link_to "Jump to unread", "#first-unread", class: "button button-secondary button-small", title: "Jump to first unread message", "aria-label": "Jump to first unread message"

- first_unread_found = false
- @messages.each do |message|
Expand Down