Skip to content

Commit 011fee5

Browse files
committed
Update Tooltip/Hover information so icons are clearer and easier to work with the Topics
Signed-off-by: Kai Wagner <kai.wagner@percona.com>
1 parent cded2c9 commit 011fee5

10 files changed

+26
-13
lines changed

app/views/topics/_avatar_list.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
- css_classes << "is-major-contributor" if !participant.core_team? && !participant.committer? && participant.major_contributor?
88
- css_classes << "is-significant-contributor" if !participant.core_team? && !participant.committer? && !participant.major_contributor? && participant.significant_contributor?
99
- css_classes << "is-past-contributor" if participant.past_contributor?
10-
- badge_text = participant.contributor_badge ? "#{participant.name} (#{participant.contributor_badge})" : participant.name
10+
- role_label = participant.contributor_badge || "User"
11+
- badge_text = "#{participant.name} (#{role_label})"
1112
= link_to person_path(participant.email), class: "participant-avatar-link" do
1213
= image_tag participant.display_gravatar_url(size: 32), class: css_classes.join(" "), alt: participant.name, title: badge_text
1314
- if total_participants > participants.count

app/views/topics/_commitfest_icon.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
- reviewers = summary[:reviewers] || []
55
- tags = summary[:tags] || []
66

7-
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"
7+
- tooltip_label = summary[:status].presence ? "Commitfest status: #{summary[:status]}" : "Commitfest patch"
8+
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"
89
i.fa-solid class=icon_class
910
.topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide"
1011
.commitfest-hover
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- count = count.to_i
22
- classes = ["topic-icon", "activity-note"]
33
- classes << "is-hidden" unless count.positive?
4-
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"
4+
- tooltip_label = count.positive? ? "Notes: #{count}" : "Notes"
5+
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"
56
i.fa-solid.fa-note-sticky
67
- if count.positive?
78
span.topic-icon-badge = count

app/views/topics/_participant_row.html.slim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
- tooltip_parts = []
77
- tooltip_parts << "#{message_count} messages" if message_count
88
- tooltip_parts << "last #{smart_time_display(last_at)}" if last_at
9-
- tooltip = local_assigns[:tooltip] || (tooltip_parts.any? ? tooltip_parts.join(", ") : alias_record.name)
9+
- role_label = alias_record.contributor_badge || "User"
10+
- tooltip_parts << role_label
11+
- tooltip = local_assigns[:tooltip] || (tooltip_parts.any? ? tooltip_parts.join(", ") : "#{alias_record.name} (#{role_label})")
1012
- avatar_classes = ["participant-avatar"]
1113
- membership_icons = []
1214
- membership_types = alias_record.contributor_membership_types

app/views/topics/_participation_icon.html.slim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
- classes << "is-hidden" unless participation[:mine] || participation[:team]
44
- aliases = participation[:aliases] || []
55
- count = aliases.size
6-
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"
6+
- tooltip_label = participation[:mine] ? "You participated" : "Team participated"
7+
- tooltip_label = count.positive? ? "#{tooltip_label}: #{count}" : tooltip_label
8+
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"
79
i.fa-solid.fa-user-group
810
- if count > 1
911
span.topic-icon-badge = count
1012
- if aliases.any?
1113
.topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide"
1214
- aliases.each do |alias_record|
1315
- participant_stub = { alias: alias_record }
14-
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: alias_record.name }
16+
- role_label = alias_record.contributor_badge || "User"
17+
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{role_label})" }

app/views/topics/_status_cell.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell")
55
- read_count = state[:read_count].to_i
66
- total_count = topic.messages.count
77
- unread_count = [total_count - read_count, 0].max
8-
.topic-icon.topic-icon-reading
8+
.topic-icon.topic-icon-reading title="Unread messages: #{unread_count}"
99
i.fa-solid.fa-envelope
1010
- if unread_count.positive?
1111
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")
1515
- if commitfest_summary
1616
= render partial: "topics/commitfest_icon", locals: { summary: commitfest_summary }
1717
- elsif topic.attachments.exists?
18-
.topic-icon
18+
.topic-icon title="Attachments"
1919
i.fa-solid.fa-paperclip
2020
= link_to topic.title, topic_path(topic), class: "topic-link"
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- count = readers&.size.to_i
22
- classes = ["topic-icon", "activity-team-read"]
33
- classes << "is-hidden" if count.zero?
4-
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"
4+
- tooltip_label = count.positive? ? "Team readers: #{count}" : "Team readers"
5+
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"
56
i.fa-solid.fa-users
67
- if count.positive?
78
span.topic-icon-badge = count
@@ -10,4 +11,5 @@ div class=classes.join(" ") id=dom_id(topic, "team_readers") data-controller="ho
1011
- alias_record = reader[:user]&.person&.default_alias || reader[:user]&.aliases&.first
1112
- next unless alias_record
1213
- participant_stub = { alias: alias_record }
13-
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]})" }
14+
- role_label = alias_record.contributor_badge || "User"
15+
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]}, #{role_label})" }

app/views/topics/_topic_row_user.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ tr id=dom_id(topic) class="topic-row topic-#{state[:status] || 'new'}" data-topi
1818
- if topic.has_contributor_activity?
1919
- contributor_participants = topic.contributor_participants
2020
- contributor_count = contributor_participants.size
21-
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"
21+
- activity_label = case topic.highest_contributor_activity; when "core_team" then "Core Team activity"; when "committer" then "Committer activity"; else "Contributor activity"; end
22+
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"
2223
i.fa-solid.fa-users-rays
2324
- if contributor_count.positive?
2425
span.topic-icon-badge = contributor_count

app/views/topics/_topics.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
- if topic.has_contributor_activity?
1515
- contributor_participants = topic.contributor_participants
1616
- contributor_count = contributor_participants.size
17-
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"
17+
- activity_label = case topic.highest_contributor_activity; when "core_team" then "Core Team activity"; when "committer" then "Committer activity"; else "Contributor activity"; end
18+
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"
1819
i.fa-solid.fa-users-rays
1920
- if contributor_count.positive?
2021
span.topic-icon-badge = contributor_count

app/views/topics/_topics_page.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
- css_classes << "is-major-contributor" if !participant.core_team? && !participant.committer? && participant.major_contributor?
2323
- css_classes << "is-significant-contributor" if !participant.core_team? && !participant.committer? && !participant.major_contributor? && participant.significant_contributor?
2424
- css_classes << "is-past-contributor" if participant.past_contributor?
25-
- badge_text = participant.contributor_badge ? "#{participant.name} (#{participant.contributor_badge})" : participant.name
25+
- role_label = participant.contributor_badge || "User"
26+
- badge_text = "#{participant.name} (#{role_label})"
2627
= link_to person_path(participant.email), class: "participant-avatar-link" do
2728
= image_tag participant.display_gravatar_url(size: 32), class: css_classes.join(" "), alt: participant.name, title: badge_text
2829
- total_participants = topic.messages.select(:sender_id).distinct.count

0 commit comments

Comments
 (0)