Skip to content

Commit 5ed6da9

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 5ed6da9

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
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
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ div class=classes.join(" ") id=dom_id(topic, "participation") data-controller="h
1111
.topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide"
1212
- aliases.each do |alias_record|
1313
- participant_stub = { alias: alias_record }
14-
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: alias_record.name }
14+
- role_label = alias_record.contributor_badge || "User"
15+
= 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"

app/views/topics/_team_readers_icon.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ div class=classes.join(" ") id=dom_id(topic, "team_readers") data-controller="ho
1010
- alias_record = reader[:user]&.person&.default_alias || reader[:user]&.aliases&.first
1111
- next unless alias_record
1212
- participant_stub = { alias: alias_record }
13-
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]})" }
13+
- role_label = alias_record.contributor_badge || "User"
14+
= render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]}, #{role_label})" }

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)