From 2ee915558207c7f9e2a918006de38301ec457061 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 00:14:43 +0000 Subject: [PATCH] VersionHistoryPanel: a version's description shows at most three lines --- crates/review/src/ui/versions.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/review/src/ui/versions.rs b/crates/review/src/ui/versions.rs index 029710097..f7725b8d4 100644 --- a/crates/review/src/ui/versions.rs +++ b/crates/review/src/ui/versions.rs @@ -26,6 +26,9 @@ use egui::{Pos2, Rect, Response, Ui}; use super::comments::age_text; use crate::versions::{Branch, BranchId, BranchState, HistoryRow, Version, VersionId, history_rows}; +/// The most lines of a version's description a row shows. +const DESCRIPTION_LINES: u8 = 3; + #[cfg(feature = "screen-testing")] mod stories; @@ -443,7 +446,7 @@ fn history( if version.author.is_empty() { date } else { words.detail.fill(&[("date", date.as_str()), ("author", version.author.as_str())]) }; let mut row = ListRow::new(text).depth(icx.depth).icon(dot).detail(detail); if !version.description.is_empty() { - row = row.lines(version.description.clone()); + row = row.lines(version.description.clone()).line_limit(DESCRIPTION_LINES); } row.trailing_part(TrailingPart::new(0), TrailingFace::Icon(IconSpec::from(IconId::new("more"))), words.row_more.clone()) }