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>
@@ -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
@@ -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(@@ -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
}@@ -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))@@ -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 {79
pub fn announcement_banner(banner: &AnnouncementBanner, directory: &Directory) -> Div {79
pub 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
}@@ -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)))@@ -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),@@ -136,7 +136,7 @@ pub fn link_preview_card(
136
136
.when(close_button.is_some(), |column| column.pr(px(CLOSE_SIZE)))
137
137
.child(
138
138
div()
139
.line_clamp(2)
139
.line_clamp(2).text_ellipsis()
140
140
.text_size(px(13.))
141
141
.font_weight(FontWeight::SEMIBOLD)
142
142
.text_color(theme::text_strong())
@@ -144,7 +144,7 @@ pub fn link_preview_card(
144
144
)
145
145
.children(preview.description.clone().map(|description| {
146
146
div()
147
.line_clamp(2)
147
.line_clamp(2).text_ellipsis()
148
148
.text_size(px(12.))
149
149
.text_color(theme::text_muted())
150
150
.child(description)
@@ -136,7 +136,7 @@ pub fn link_preview_card(136
.when(close_button.is_some(), |column| column.pr(px(CLOSE_SIZE)))136
.when(close_button.is_some(), |column| column.pr(px(CLOSE_SIZE)))137
.child(137
.child(138
div()138
div()139
.line_clamp(2)139
.line_clamp(2).text_ellipsis()140
.text_size(px(13.))140
.text_size(px(13.))141
.font_weight(FontWeight::SEMIBOLD)141
.font_weight(FontWeight::SEMIBOLD)142
.text_color(theme::text_strong())142
.text_color(theme::text_strong())@@ -144,7 +144,7 @@ pub fn link_preview_card(144
)144
)145
.children(preview.description.clone().map(|description| {145
.children(preview.description.clone().map(|description| {146
div()146
div()147
.line_clamp(2)147
.line_clamp(2).text_ellipsis()148
.text_size(px(12.))148
.text_size(px(12.))149
.text_color(theme::text_muted())149
.text_color(theme::text_muted())150
.child(description)150
.child(description)@@ -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())