From ba05902883ab493d44fb24cc6ddc45170472880f Mon Sep 17 00:00:00 2001 From: vasilito Date: Tue, 7 Jul 2026 08:11:36 +0300 Subject: [PATCH] W45: Marked-file total size in panel footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Append a 'Σ ' indicator to the panel footer when files are marked, using the info colour. Sums the stat.size of every entry whose name is in the marked set (directories included). Helps users see the combined size before bulk operations like copy/move/delete. Tests: 1405 pass, zero warnings. --- .../tui/tlc/source/src/filemanager/render.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/local/recipes/tui/tlc/source/src/filemanager/render.rs b/local/recipes/tui/tlc/source/src/filemanager/render.rs index e5507a866c..6cb59f3203 100644 --- a/local/recipes/tui/tlc/source/src/filemanager/render.rs +++ b/local/recipes/tui/tlc/source/src/filemanager/render.rs @@ -559,6 +559,24 @@ impl FileManager { Style::default().fg(self.theme.accent).bg(panel_bg), )); } + // Marked-file total size: sum of stat.size for every + // entry whose name is in the marked set. Shown only when + // at least one file is marked. Directories are counted. + if panel.marked_count() > 0 { + let marked_set: std::collections::HashSet = + panel.marked_names().into_iter().collect(); + let total: u64 = panel + .entries() + .iter() + .filter(|e| marked_set.contains(&e.name)) + .map(|e| e.stat.size) + .sum(); + footer_spans.push(Span::raw(" ")); + footer_spans.push(Span::styled( + format!("Σ {}", format_utils::format_size(total)), + Style::default().fg(self.theme.info).bg(panel_bg), + )); + } let total_w = footer_spans.iter().map(|s| s.width() as u16).sum::(); if total_w < inner.width { let pad = inner.width - total_w;