BlueGit

ict rusty-teams

fix(channels): thread replies aligned like Teams

- Reply avatar 20 px, flush with the Reply in thread avatar
- More replies link aligned with the reply text

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

metis Daniel Däschle · pushed by metis

Authored 2026-11-08 · 3 weeks ago

Hash
465863c06d42d4079e0b50cce90acbf9d0d75f45
Parent
5c9f1bcf
1 file changed +5 −8
crates/app/src/views/post_card.rs +5 −8
@@ -27,7 +27,8 @@ use crate::rows::{Delivery, MessageRow, PostRow};
27 27 use crate::theme;
28 28
29 29 const ROOT_AVATAR: f32 = 32.;
30 const REPLY_AVATAR: f32 = 24.;
30 const REPLY_AVATAR: f32 = 20.;
31 const REPLY_AVATAR_GAP: f32 = 8.;
31 32 const AVATAR_GAP: f32 = 10.;
32 33 const CARD_PADDING: f32 = 12.;
33 34 const CARD_RADIUS: f32 = 10.;
@@ -327,7 +328,7 @@ fn message_block(
327 328 .child(message_header(row, index, author, profile_user, saved, pinned)),
328 329 )
329 330 .child(details.debug_selector(|| POST_BODY_TAG.into())),
330 Role::Reply => h_flex().items_start().gap(px(8.)).child(avatar).child(
331 Role::Reply => h_flex().items_start().gap(px(REPLY_AVATAR_GAP)).child(avatar).child(
331 332 v_flex()
332 333 .flex_1()
333 334 .min_w_0()
@@ -348,11 +349,7 @@ fn message_block(
348 349 .relative()
349 350 .w_full()
350 351 .p(px(CARD_PADDING))
351 .when(role == Role::Reply, |block| {
352 block
353 .pl(px(CARD_PADDING + ROOT_AVATAR + AVATAR_GAP))
354 .bg(theme::reply_surface())
355 })
352 .when(role == Role::Reply, |block| block.bg(theme::reply_surface()))
356 353 .when(highlighted, |block| block.bg(theme::accent().opacity(0.2)))
357 354 .when_some(hovered, |block, hovered| {
358 355 block.on_hover(move |is_hovered, _, cx| hovered(*is_hovered, cx))
@@ -380,7 +377,7 @@ fn message_block(
380 377 fn replies_link(label: String, post_index: usize, open: Option<PostAction>) -> Stateful<Div> {
381 378 div()
382 379 .id(ElementId::Name(format!("post-replies-{post_index}").into()))
383 .pl(px(CARD_PADDING + ROOT_AVATAR + AVATAR_GAP))
380 .pl(px(CARD_PADDING + REPLY_AVATAR + REPLY_AVATAR_GAP))
384 381 .pr(px(CARD_PADDING))
385 382 .pb(px(8.))
386 383 .text_size(px(13.))
@@ -27,7 +27,8 @@ use crate::rows::{Delivery, MessageRow, PostRow};
27use crate::theme;
27use crate::theme;
28
28
29const ROOT_AVATAR: f32 = 32.;
29const ROOT_AVATAR: f32 = 32.;
30const REPLY_AVATAR: f32 = 24.;
30const REPLY_AVATAR: f32 = 20.;
31const REPLY_AVATAR_GAP: f32 = 8.;
31const AVATAR_GAP: f32 = 10.;
32const AVATAR_GAP: f32 = 10.;
32const CARD_PADDING: f32 = 12.;
33const CARD_PADDING: f32 = 12.;
33const CARD_RADIUS: f32 = 10.;
34const CARD_RADIUS: f32 = 10.;
@@ -327,7 +328,7 @@ fn message_block(
327 .child(message_header(row, index, author, profile_user, saved, pinned)),
328 .child(message_header(row, index, author, profile_user, saved, pinned)),
328 )
329 )
329 .child(details.debug_selector(|| POST_BODY_TAG.into())),
330 .child(details.debug_selector(|| POST_BODY_TAG.into())),
330 Role::Reply => h_flex().items_start().gap(px(8.)).child(avatar).child(
331 Role::Reply => h_flex().items_start().gap(px(REPLY_AVATAR_GAP)).child(avatar).child(
331 v_flex()
332 v_flex()
332 .flex_1()
333 .flex_1()
333 .min_w_0()
334 .min_w_0()
@@ -348,11 +349,7 @@ fn message_block(
348 .relative()
349 .relative()
349 .w_full()
350 .w_full()
350 .p(px(CARD_PADDING))
351 .p(px(CARD_PADDING))
351 .when(role == Role::Reply, |block| {
352 .when(role == Role::Reply, |block| block.bg(theme::reply_surface()))
352 block
353 .pl(px(CARD_PADDING + ROOT_AVATAR + AVATAR_GAP))
354 .bg(theme::reply_surface())
355 })
356 .when(highlighted, |block| block.bg(theme::accent().opacity(0.2)))
353 .when(highlighted, |block| block.bg(theme::accent().opacity(0.2)))
357 .when_some(hovered, |block, hovered| {
354 .when_some(hovered, |block, hovered| {
358 block.on_hover(move |is_hovered, _, cx| hovered(*is_hovered, cx))
355 block.on_hover(move |is_hovered, _, cx| hovered(*is_hovered, cx))
@@ -380,7 +377,7 @@ fn message_block(
380fn replies_link(label: String, post_index: usize, open: Option<PostAction>) -> Stateful<Div> {
377fn replies_link(label: String, post_index: usize, open: Option<PostAction>) -> Stateful<Div> {
381 div()
378 div()
382 .id(ElementId::Name(format!("post-replies-{post_index}").into()))
379 .id(ElementId::Name(format!("post-replies-{post_index}").into()))
383 .pl(px(CARD_PADDING + ROOT_AVATAR + AVATAR_GAP))
380 .pl(px(CARD_PADDING + REPLY_AVATAR + REPLY_AVATAR_GAP))
384 .pr(px(CARD_PADDING))
381 .pr(px(CARD_PADDING))
385 .pb(px(8.))
382 .pb(px(8.))
386 .text_size(px(13.))
383 .text_size(px(13.))