BlueGit

ict rusty-teams

fix(ui): clamped texts end with an ellipsis instead of a cut glyph

- saved list, toasts, activity headlines, link previews, find, forward, banner, agent quote
- gpui only draws the ellipsis when text_ellipsis is set next to line_clamp

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

metis Daniel Däschle · pushed by metis

Authored 2026-11-07 · 3 weeks ago

Hash
3d1cd83be6c8f6d2d3174da2b1b455cdff870cde
Parent
e798bbed
9 files changed +10 −10
crates/app/src/agents/start_dialog.rs +1 −1
@@ -361,7 +361,7 @@ impl StartDialog {
361 361 .text_size(px(12.))
362 362 .line_height(relative(1.4))
363 363 .text_color(theme::text_soft())
364 .line_clamp(QUOTE_LINES)
364 .line_clamp(QUOTE_LINES).text_ellipsis()
365 365 .child(StyledText::new(text).with_highlights([(sender_range, sender_style)]))
366 366 }
367 367
@@ -361,7 +361,7 @@ impl StartDialog {
361 .text_size(px(12.))
361 .text_size(px(12.))
362 .line_height(relative(1.4))
362 .line_height(relative(1.4))
363 .text_color(theme::text_soft())
363 .text_color(theme::text_soft())
364 .line_clamp(QUOTE_LINES)
364 .line_clamp(QUOTE_LINES).text_ellipsis()
365 .child(StyledText::new(text).with_highlights([(sender_range, sender_style)]))
365 .child(StyledText::new(text).with_highlights([(sender_range, sender_style)]))
366 }
366 }
367
367
crates/app/src/notify/agent_toast.rs +1 −1
@@ -116,7 +116,7 @@ pub(super) fn agent_toast_content(
116 116 .text_size(px(PREVIEW_SIZE))
117 117 .line_height(px(18.))
118 118 .text_color(theme::text_soft())
119 .line_clamp(PREVIEW_MAX_LINES)
119 .line_clamp(PREVIEW_MAX_LINES).text_ellipsis()
120 120 .child(agent.body.clone()),
121 121 )
122 122 .child(
@@ -116,7 +116,7 @@ pub(super) fn agent_toast_content(
116 .text_size(px(PREVIEW_SIZE))
116 .text_size(px(PREVIEW_SIZE))
117 .line_height(px(18.))
117 .line_height(px(18.))
118 .text_color(theme::text_soft())
118 .text_color(theme::text_soft())
119 .line_clamp(PREVIEW_MAX_LINES)
119 .line_clamp(PREVIEW_MAX_LINES).text_ellipsis()
120 .child(agent.body.clone()),
120 .child(agent.body.clone()),
121 )
121 )
122 .child(
122 .child(
crates/app/src/notify/toast.rs +1 −1
@@ -176,7 +176,7 @@ fn highlighted_preview(text: &str, mention: bool) -> AnyElement {
176 176 .text_size(px(PREVIEW_SIZE))
177 177 .line_height(px(18.))
178 178 .text_color(theme::text())
179 .line_clamp(PREVIEW_MAX_LINES)
179 .line_clamp(PREVIEW_MAX_LINES).text_ellipsis()
180 180 .child(styled)
181 181 .into_any_element()
182 182 }
@@ -176,7 +176,7 @@ fn highlighted_preview(text: &str, mention: bool) -> AnyElement {
176 .text_size(px(PREVIEW_SIZE))
176 .text_size(px(PREVIEW_SIZE))
177 .line_height(px(18.))
177 .line_height(px(18.))
178 .text_color(theme::text())
178 .text_color(theme::text())
179 .line_clamp(PREVIEW_MAX_LINES)
179 .line_clamp(PREVIEW_MAX_LINES).text_ellipsis()
180 .child(styled)
180 .child(styled)
181 .into_any_element()
181 .into_any_element()
182}
182}
crates/app/src/views/activity_panel.rs +1 −1
@@ -403,7 +403,7 @@ fn row_frame(parts: RowParts) -> Stateful<Div> {
403 403 .gap(px(2.))
404 404 .child(
405 405 div()
406 .when(headline_wraps, |headline| headline.line_clamp(2))
406 .when(headline_wraps, |headline| headline.line_clamp(2).text_ellipsis())
407 407 .when(!headline_wraps, |headline| headline.truncate())
408 408 .text_size(px(13.))
409 409 .line_height(px(HEADLINE_LINE_HEIGHT))
@@ -403,7 +403,7 @@ fn row_frame(parts: RowParts) -> Stateful<Div> {
403 .gap(px(2.))
403 .gap(px(2.))
404 .child(
404 .child(
405 div()
405 div()
406 .when(headline_wraps, |headline| headline.line_clamp(2))
406 .when(headline_wraps, |headline| headline.line_clamp(2).text_ellipsis())
407 .when(!headline_wraps, |headline| headline.truncate())
407 .when(!headline_wraps, |headline| headline.truncate())
408 .text_size(px(13.))
408 .text_size(px(13.))
409 .line_height(px(HEADLINE_LINE_HEIGHT))
409 .line_height(px(HEADLINE_LINE_HEIGHT))
crates/app/src/views/announcement_banner.rs +1 −1
@@ -79,5 +79,5 @@ pub fn headline_style(text: Div) -> Div {
79 79 pub fn announcement_banner(banner: &AnnouncementBanner, directory: &Directory) -> Div {
80 80 banner_frame(&banner.background, directory)
81 81 .debug_selector(|| ANNOUNCEMENT_BANNER_TAG.into())
82 .child(headline_style(div().line_clamp(2)).child(banner.title.clone()))
82 .child(headline_style(div().line_clamp(2).text_ellipsis()).child(banner.title.clone()))
83 83 }
@@ -79,5 +79,5 @@ pub fn headline_style(text: Div) -> Div {
79pub fn announcement_banner(banner: &AnnouncementBanner, directory: &Directory) -> Div {
79pub fn announcement_banner(banner: &AnnouncementBanner, directory: &Directory) -> Div {
80 banner_frame(&banner.background, directory)
80 banner_frame(&banner.background, directory)
81 .debug_selector(|| ANNOUNCEMENT_BANNER_TAG.into())
81 .debug_selector(|| ANNOUNCEMENT_BANNER_TAG.into())
82 .child(headline_style(div().line_clamp(2)).child(banner.title.clone()))
82 .child(headline_style(div().line_clamp(2).text_ellipsis()).child(banner.title.clone()))
83}
83}
crates/app/src/views/find_panel.rs +1 −1
@@ -521,7 +521,7 @@ impl FindPanel {
521 521 div()
522 522 .text_size(px(13.))
523 523 .text_color(theme::text_soft())
524 .line_clamp(2)
524 .line_clamp(2).text_ellipsis()
525 525 .child(StyledText::new(hit.text.clone()).with_highlights(marks)),
526 526 )
527 527 .on_click(cx.listener(move |panel, _, _, cx| panel.pick(index, cx)))
@@ -521,7 +521,7 @@ impl FindPanel {
521 div()
521 div()
522 .text_size(px(13.))
522 .text_size(px(13.))
523 .text_color(theme::text_soft())
523 .text_color(theme::text_soft())
524 .line_clamp(2)
524 .line_clamp(2).text_ellipsis()
525 .child(StyledText::new(hit.text.clone()).with_highlights(marks)),
525 .child(StyledText::new(hit.text.clone()).with_highlights(marks)),
526 )
526 )
527 .on_click(cx.listener(move |panel, _, _, cx| panel.pick(index, cx)))
527 .on_click(cx.listener(move |panel, _, _, cx| panel.pick(index, cx)))
crates/app/src/views/forward_dialog.rs +1 −1
@@ -462,7 +462,7 @@ fn preview_quote(item: &ForwardItem, lines: usize) -> Div {
462 462 )
463 463 .child(
464 464 div()
465 .line_clamp(lines)
465 .line_clamp(lines).text_ellipsis()
466 466 .text_size(px(12.5))
467 467 .text_color(theme::text_muted())
468 468 .child(text),
@@ -462,7 +462,7 @@ fn preview_quote(item: &ForwardItem, lines: usize) -> Div {
462 )
462 )
463 .child(
463 .child(
464 div()
464 div()
465 .line_clamp(lines)
465 .line_clamp(lines).text_ellipsis()
466 .text_size(px(12.5))
466 .text_size(px(12.5))
467 .text_color(theme::text_muted())
467 .text_color(theme::text_muted())
468 .child(text),
468 .child(text),
crates/app/src/views/saved_panel.rs +1 −1
@@ -142,7 +142,7 @@ impl SavedPanel {
142 142 )
143 143 .child(
144 144 div()
145 .line_clamp(PREVIEW_LINES)
145 .line_clamp(PREVIEW_LINES).text_ellipsis()
146 146 .text_size(px(13.))
147 147 .line_height(relative(1.4))
148 148 .text_color(theme::text_soft())
@@ -142,7 +142,7 @@ impl SavedPanel {
142 )
142 )
143 .child(
143 .child(
144 div()
144 div()
145 .line_clamp(PREVIEW_LINES)
145 .line_clamp(PREVIEW_LINES).text_ellipsis()
146 .text_size(px(13.))
146 .text_size(px(13.))
147 .line_height(relative(1.4))
147 .line_height(relative(1.4))
148 .text_color(theme::text_soft())
148 .text_color(theme::text_soft())