Skip to content
Open
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
8 changes: 8 additions & 0 deletions app/assets/stylesheets/components/topics.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@ a.topic-icon {
color: var(--color-text-muted);
}

.topics-table.unread-bold-enabled .topic-link {
font-weight: var(--font-weight-normal);
}

.topics-table.unread-bold-enabled .topic-row.topic-unread .topic-link {
font-weight: var(--font-weight-bold);
}

.topic-icon-hover {
display: none;
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/settings/preferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def update
private

def preferences_params
params.require(:user).permit(:mention_restriction)
params.require(:user).permit(:mention_restriction, :bold_unread_threads)
end
end
end
18 changes: 18 additions & 0 deletions app/views/settings/profiles/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@
strong Teammates only
span.radio-description Only users who share a team with you can @mention you
= f.submit "Save", class: "button-primary"

.settings-section
h2 Thread Overview
p.settings-hint Choose how unread threads are emphasized in topic lists.
= form_with model: current_user, url: settings_preferences_path, method: :patch, local: true do |f|
.form-group
.radio-group
label
= f.radio_button :bold_unread_threads, false
span.radio-text
strong Colored marker only
span.radio-description Use the existing left-side status marker
label
= f.radio_button :bold_unread_threads, true
span.radio-text
strong Bold unread titles
span.radio-description Unread threads appear in bold like an email inbox
= f.submit "Save", class: "button-primary"
4 changes: 3 additions & 1 deletion app/views/topics/_topic_row_user.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
- tp_data = topic_participants_map[topic.id] || {}
- top_participants = tp_data[:top] || []
- contributor_participants = tp_data[:contributors] || []
- status = (state[:status] || "new").to_s
- unread_status = %w[new reading aware].include?(status)

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=["topic-row", "topic-#{status}", ("topic-unread" if unread_status)].compact.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: 1 addition & 1 deletion app/views/topics/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
span Filtering by ##{@active_note_tag}
= link_to "Clear", topics_path, class: "clear-tag-filter"

.topics-table
.topics-table class=("unread-bold-enabled" if current_user&.bold_unread_threads?)
table
thead
tr
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/search.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- if user_signed_in?
#user-state-requests
= turbo_frame_tag "user-state-root", src: user_state_frame_topics_path(topic_ids: @topics.map(&:id), format: :turbo_stream), loading: :eager
.topics-table
.topics-table class=("unread-bold-enabled" if current_user&.bold_unread_threads?)
table
thead
tr
Expand Down
7 changes: 7 additions & 0 deletions db/migrate/20260128120000_add_bold_unread_threads_to_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddBoldUnreadThreadsToUsers < ActiveRecord::Migration[8.0]
def change
add_column :users, :bold_unread_threads, :boolean, default: false, null: false
end
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.