From 9abd18ab45a1d68d61fa6184e82bc6dbb00303eb Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Wed, 1 Apr 2026 09:56:58 -0700 Subject: [PATCH] feat(claudbg-wxdt): left-truncate project path in TUI session list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass project_max directly to truncate_project instead of project_max+30, so the function (not ratatui's right-clip) controls truncation — showing the end of the path (e.g. …/foo/bar) rather than the beginning. Co-Authored-By: Claude Sonnet 4.6 --- src/tui/screens/session_list.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tui/screens/session_list.rs b/src/tui/screens/session_list.rs index 17d634b..40682fa 100644 --- a/src/tui/screens/session_list.rs +++ b/src/tui/screens/session_list.rs @@ -73,12 +73,13 @@ pub fn render_session_list(f: &mut Frame, area: Rect, state: &AppState) { // Compute the max width available for the project column so we can truncate. // Fixed widths: 8+20+20+6+7 = 61, plus 5 separators = 66, plus 2 borders = 68. - // Use 30 chars as a safe default; the Min constraint will expand it. + // Use 10 chars as a minimum; the Min constraint will expand it. + // We pass this exact value to truncate_project so it left-truncates before + // ratatui ever sees the string — ensuring the *end* of the path is shown. let project_max: usize = table_area .width .saturating_sub(68) // subtract fixed columns + separators + borders .max(10) as usize; - let project_display_max = project_max + 30; // generous — actual render clips // Apply active filter to the session rows. let active_filter = Filter::parse(&state.filter_active).ok(); @@ -96,7 +97,7 @@ pub fn render_session_list(f: &mut Frame, area: Rect, state: &AppState) { let rows: Vec = filtered_sessions .iter() .map(|s| { - let project = truncate_project(&s.project, project_display_max); + let project = truncate_project(&s.project, project_max); Row::new(vec![ s.short_id.clone(), s.date.clone(),