From 011fee5ca5ae70e729df66c77cffaaf59f70cefb Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Tue, 6 Jan 2026 13:00:39 +0100 Subject: [PATCH] Update Tooltip/Hover information so icons are clearer and easier to work with the Topics Signed-off-by: Kai Wagner --- app/views/topics/_avatar_list.slim | 3 ++- app/views/topics/_commitfest_icon.html.slim | 3 ++- app/views/topics/_note_icon.html.slim | 3 ++- app/views/topics/_participant_row.html.slim | 4 +++- app/views/topics/_participation_icon.html.slim | 7 +++++-- app/views/topics/_status_cell.html.slim | 4 ++-- app/views/topics/_team_readers_icon.html.slim | 6 ++++-- app/views/topics/_topic_row_user.html.slim | 3 ++- app/views/topics/_topics.html.slim | 3 ++- app/views/topics/_topics_page.html.slim | 3 ++- 10 files changed, 26 insertions(+), 13 deletions(-) diff --git a/app/views/topics/_avatar_list.slim b/app/views/topics/_avatar_list.slim index 6dbef91..bd814ee 100644 --- a/app/views/topics/_avatar_list.slim +++ b/app/views/topics/_avatar_list.slim @@ -7,7 +7,8 @@ - css_classes << "is-major-contributor" if !participant.core_team? && !participant.committer? && participant.major_contributor? - css_classes << "is-significant-contributor" if !participant.core_team? && !participant.committer? && !participant.major_contributor? && participant.significant_contributor? - css_classes << "is-past-contributor" if participant.past_contributor? - - badge_text = participant.contributor_badge ? "#{participant.name} (#{participant.contributor_badge})" : participant.name + - role_label = participant.contributor_badge || "User" + - badge_text = "#{participant.name} (#{role_label})" = link_to person_path(participant.email), class: "participant-avatar-link" do = image_tag participant.display_gravatar_url(size: 32), class: css_classes.join(" "), alt: participant.name, title: badge_text - if total_participants > participants.count diff --git a/app/views/topics/_commitfest_icon.html.slim b/app/views/topics/_commitfest_icon.html.slim index 89c296d..4bdf63e 100644 --- a/app/views/topics/_commitfest_icon.html.slim +++ b/app/views/topics/_commitfest_icon.html.slim @@ -4,7 +4,8 @@ - reviewers = summary[:reviewers] || [] - tags = summary[:tags] || [] -div class="topic-icon commitfest-icon#{committed ? ' commitfest-committed' : ''}" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" +- tooltip_label = summary[:status].presence ? "Commitfest status: #{summary[:status]}" : "Commitfest patch" +div class="topic-icon commitfest-icon#{committed ? ' commitfest-committed' : ''}" title=tooltip_label data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid class=icon_class .topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" .commitfest-hover diff --git a/app/views/topics/_note_icon.html.slim b/app/views/topics/_note_icon.html.slim index fa45fb3..f9edcb6 100644 --- a/app/views/topics/_note_icon.html.slim +++ b/app/views/topics/_note_icon.html.slim @@ -1,7 +1,8 @@ - count = count.to_i - classes = ["topic-icon", "activity-note"] - classes << "is-hidden" unless count.positive? -div class=classes.join(" ") id=dom_id(topic, "notes") data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" +- tooltip_label = count.positive? ? "Notes: #{count}" : "Notes" +div class=classes.join(" ") id=dom_id(topic, "notes") title=tooltip_label data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid.fa-note-sticky - if count.positive? span.topic-icon-badge = count diff --git a/app/views/topics/_participant_row.html.slim b/app/views/topics/_participant_row.html.slim index c56c7bf..cb49d59 100644 --- a/app/views/topics/_participant_row.html.slim +++ b/app/views/topics/_participant_row.html.slim @@ -6,7 +6,9 @@ - tooltip_parts = [] - tooltip_parts << "#{message_count} messages" if message_count - tooltip_parts << "last #{smart_time_display(last_at)}" if last_at -- tooltip = local_assigns[:tooltip] || (tooltip_parts.any? ? tooltip_parts.join(", ") : alias_record.name) +- role_label = alias_record.contributor_badge || "User" +- tooltip_parts << role_label +- tooltip = local_assigns[:tooltip] || (tooltip_parts.any? ? tooltip_parts.join(", ") : "#{alias_record.name} (#{role_label})") - avatar_classes = ["participant-avatar"] - membership_icons = [] - membership_types = alias_record.contributor_membership_types diff --git a/app/views/topics/_participation_icon.html.slim b/app/views/topics/_participation_icon.html.slim index f291516..3ea7271 100644 --- a/app/views/topics/_participation_icon.html.slim +++ b/app/views/topics/_participation_icon.html.slim @@ -3,7 +3,9 @@ - classes << "is-hidden" unless participation[:mine] || participation[:team] - aliases = participation[:aliases] || [] - count = aliases.size -div class=classes.join(" ") id=dom_id(topic, "participation") data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" +- tooltip_label = participation[:mine] ? "You participated" : "Team participated" +- tooltip_label = count.positive? ? "#{tooltip_label}: #{count}" : tooltip_label +div class=classes.join(" ") id=dom_id(topic, "participation") title=tooltip_label data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid.fa-user-group - if count > 1 span.topic-icon-badge = count @@ -11,4 +13,5 @@ div class=classes.join(" ") id=dom_id(topic, "participation") data-controller="h .topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" - aliases.each do |alias_record| - participant_stub = { alias: alias_record } - = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: alias_record.name } + - role_label = alias_record.contributor_badge || "User" + = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{role_label})" } diff --git a/app/views/topics/_status_cell.html.slim b/app/views/topics/_status_cell.html.slim index c46e633..db4c936 100644 --- a/app/views/topics/_status_cell.html.slim +++ b/app/views/topics/_status_cell.html.slim @@ -5,7 +5,7 @@ td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell") - read_count = state[:read_count].to_i - total_count = topic.messages.count - unread_count = [total_count - read_count, 0].max - .topic-icon.topic-icon-reading + .topic-icon.topic-icon-reading title="Unread messages: #{unread_count}" i.fa-solid.fa-envelope - if unread_count.positive? span.topic-icon-badge.topic-icon-badge-sup = unread_count @@ -15,6 +15,6 @@ td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell") - if commitfest_summary = render partial: "topics/commitfest_icon", locals: { summary: commitfest_summary } - elsif topic.attachments.exists? - .topic-icon + .topic-icon title="Attachments" i.fa-solid.fa-paperclip = link_to topic.title, topic_path(topic), class: "topic-link" diff --git a/app/views/topics/_team_readers_icon.html.slim b/app/views/topics/_team_readers_icon.html.slim index 7f34ec5..2c98a48 100644 --- a/app/views/topics/_team_readers_icon.html.slim +++ b/app/views/topics/_team_readers_icon.html.slim @@ -1,7 +1,8 @@ - count = readers&.size.to_i - classes = ["topic-icon", "activity-team-read"] - classes << "is-hidden" if count.zero? -div class=classes.join(" ") id=dom_id(topic, "team_readers") data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" +- tooltip_label = count.positive? ? "Team readers: #{count}" : "Team readers" +div class=classes.join(" ") id=dom_id(topic, "team_readers") title=tooltip_label data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid.fa-users - if count.positive? span.topic-icon-badge = count @@ -10,4 +11,5 @@ div class=classes.join(" ") id=dom_id(topic, "team_readers") data-controller="ho - alias_record = reader[:user]&.person&.default_alias || reader[:user]&.aliases&.first - next unless alias_record - participant_stub = { alias: alias_record } - = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]})" } + - role_label = alias_record.contributor_badge || "User" + = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]}, #{role_label})" } diff --git a/app/views/topics/_topic_row_user.html.slim b/app/views/topics/_topic_row_user.html.slim index fdfd01d..467445a 100644 --- a/app/views/topics/_topic_row_user.html.slim +++ b/app/views/topics/_topic_row_user.html.slim @@ -18,7 +18,8 @@ tr id=dom_id(topic) class="topic-row topic-#{state[:status] || 'new'}" data-topi - if topic.has_contributor_activity? - contributor_participants = topic.contributor_participants - contributor_count = contributor_participants.size - div class ="topic-icon activity-#{ topic.highest_contributor_activity }" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" + - activity_label = case topic.highest_contributor_activity; when "core_team" then "Core Team activity"; when "committer" then "Committer activity"; else "Contributor activity"; end + div class ="topic-icon activity-#{ topic.highest_contributor_activity }" title="#{activity_label}: #{contributor_count}" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid.fa-users-rays - if contributor_count.positive? span.topic-icon-badge = contributor_count diff --git a/app/views/topics/_topics.html.slim b/app/views/topics/_topics.html.slim index 49525f0..a7618b5 100644 --- a/app/views/topics/_topics.html.slim +++ b/app/views/topics/_topics.html.slim @@ -14,7 +14,8 @@ - if topic.has_contributor_activity? - contributor_participants = topic.contributor_participants - contributor_count = contributor_participants.size - div class ="topic-icon activity-#{ topic.highest_contributor_activity }" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" + - activity_label = case topic.highest_contributor_activity; when "core_team" then "Core Team activity"; when "committer" then "Committer activity"; else "Contributor activity"; end + div class ="topic-icon activity-#{ topic.highest_contributor_activity }" title="#{activity_label}: #{contributor_count}" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid.fa-users-rays - if contributor_count.positive? span.topic-icon-badge = contributor_count diff --git a/app/views/topics/_topics_page.html.slim b/app/views/topics/_topics_page.html.slim index 99c3979..ccf8252 100644 --- a/app/views/topics/_topics_page.html.slim +++ b/app/views/topics/_topics_page.html.slim @@ -22,7 +22,8 @@ - css_classes << "is-major-contributor" if !participant.core_team? && !participant.committer? && participant.major_contributor? - css_classes << "is-significant-contributor" if !participant.core_team? && !participant.committer? && !participant.major_contributor? && participant.significant_contributor? - css_classes << "is-past-contributor" if participant.past_contributor? - - badge_text = participant.contributor_badge ? "#{participant.name} (#{participant.contributor_badge})" : participant.name + - role_label = participant.contributor_badge || "User" + - badge_text = "#{participant.name} (#{role_label})" = link_to person_path(participant.email), class: "participant-avatar-link" do = image_tag participant.display_gravatar_url(size: 32), class: css_classes.join(" "), alt: participant.name, title: badge_text - total_participants = topic.messages.select(:sender_id).distinct.count