diff --git a/app/helpers/facilitator_helper.rb b/app/helpers/facilitator_helper.rb index dce10615b..0dc429964 100644 --- a/app/helpers/facilitator_helper.rb +++ b/app/helpers/facilitator_helper.rb @@ -5,6 +5,8 @@ def facilitator_profile_button(facilitator, size: 10) class: "btn btn-secondary-outline flex items-center gap-3 px-4 py-2 rounded-lg" do facilitator = facilitator.decorate + + # --- Avatar --- avatar = if facilitator.avatar_image.present? image_tag url_for(facilitator.avatar_image.file), class: "w-10 h-10 rounded-full object-cover border border-gray-300 shadow-sm" @@ -13,15 +15,27 @@ def facilitator_profile_button(facilitator, size: 10) class: "w-10 h-10 rounded-full object-cover border border-dashed border-gray-300" end - name = content_tag(:span, facilitator.name, class: "font-semibold text-gray-900") + # --- Name (forced single line) --- + name = content_tag( + :span, + facilitator.name.to_s.truncate(28), # Prevent spillover + class: "font-semibold text-gray-900 whitespace-nowrap" + ) + # --- Pronouns (small, optional, below) --- pronouns = if facilitator.pronouns_display.present? - content_tag(:span, facilitator.pronouns_display, + content_tag(:span, + facilitator.pronouns_display, class: "text-xs text-gray-500 italic") end - avatar + content_tag(:div, name + (pronouns || "").html_safe, - class: "flex flex-col leading-tight text-left") + # --- Text Block --- + text_block = content_tag(:div, + safe_join([name, pronouns].compact), + class: "flex flex-col leading-tight text-left") + + avatar + text_block end end + end