BlueGit

ict rusty-teams

fix(chat): reaction pill emoji and faces centred

- Emoji line box shorter by twice the font's downward offset, so the glyph sits on the pill centre
- Face ring 1 px, the avatar stack no longer sits low

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-27 · 4 days ago

Hash
c72b046644167f06e793ec5188c9673a3b460e58
Parent
f2082bc6
1 file changed +6 −2
crates/app/src/views/reaction_pills.rs +6 −2
@@ -24,8 +24,12 @@ const TAB_EMOJI_SIZE: f32 = 12.5;
24 24 const ENTRY_EMOJI_SIZE: f32 = 17.;
25 25 const PILL_TEXT_SIZE: f32 = 12.;
26 26 const PILL_GAP: f32 = 3.;
27 // Emoji fonts draw their glyphs below the centre of the line box: measured 0.5-1 px (Noto Color
28 // Emoji) and 1-2 px (Segoe UI Emoji) at 14 px. A line box shorter by twice the lift raises the
29 // baseline by the lift.
30 const EMOJI_LIFT: f32 = 0.07;
27 31 const FACE_SIZE: f32 = 18.;
28 const FACE_RING: f32 = 1.5;
32 const FACE_RING: f32 = 1.;
29 33 const FACE_OVERLAP: f32 = 6.;
30 34 const POPOVER_WIDTH: f32 = 290.;
31 35 const POPOVER_MAX_HEIGHT: f32 = 320.;
@@ -81,7 +85,7 @@ fn reaction_emoji(glyph: &str, label: &str, size: f32, directory: &Directory) ->
81 85 .h(px(size))
82 86 .text_size(px(size))
83 87 .font_family(theme::EMOJI_FONT_FAMILY)
84 .line_height(px(size))
88 .line_height(px(size - 2. * (size * EMOJI_LIFT).round()))
85 89 .child(label.to_owned())
86 90 .into_any_element();
87 91 };
@@ -24,8 +24,12 @@ const TAB_EMOJI_SIZE: f32 = 12.5;
24const ENTRY_EMOJI_SIZE: f32 = 17.;
24const ENTRY_EMOJI_SIZE: f32 = 17.;
25const PILL_TEXT_SIZE: f32 = 12.;
25const PILL_TEXT_SIZE: f32 = 12.;
26const PILL_GAP: f32 = 3.;
26const PILL_GAP: f32 = 3.;
27// Emoji fonts draw their glyphs below the centre of the line box: measured 0.5-1 px (Noto Color
28// Emoji) and 1-2 px (Segoe UI Emoji) at 14 px. A line box shorter by twice the lift raises the
29// baseline by the lift.
30const EMOJI_LIFT: f32 = 0.07;
27const FACE_SIZE: f32 = 18.;
31const FACE_SIZE: f32 = 18.;
28const FACE_RING: f32 = 1.5;
32const FACE_RING: f32 = 1.;
29const FACE_OVERLAP: f32 = 6.;
33const FACE_OVERLAP: f32 = 6.;
30const POPOVER_WIDTH: f32 = 290.;
34const POPOVER_WIDTH: f32 = 290.;
31const POPOVER_MAX_HEIGHT: f32 = 320.;
35const POPOVER_MAX_HEIGHT: f32 = 320.;
@@ -81,7 +85,7 @@ fn reaction_emoji(glyph: &str, label: &str, size: f32, directory: &Directory) ->
81 .h(px(size))
85 .h(px(size))
82 .text_size(px(size))
86 .text_size(px(size))
83 .font_family(theme::EMOJI_FONT_FAMILY)
87 .font_family(theme::EMOJI_FONT_FAMILY)
84 .line_height(px(size))
88 .line_height(px(size - 2. * (size * EMOJI_LIFT).round()))
85 .child(label.to_owned())
89 .child(label.to_owned())
86 .into_any_element();
90 .into_any_element();
87 };
91 };