commit 6a3c402e3d1118507c6c312f555660d809d50db6
parent 9c6ea0f25c125d88586f684206b741db4e275ae3
Author: Erik Loualiche <[email protected]>
Date: Sun, 1 Mar 2026 16:44:58 -0600
fix: per-file size extraction and column alignment
Reorder extractFiles guards so 100% progress lines (which carry file
sizes) are matched before the progress2 skip, fixing 0B display.
Widen size column to 18 chars so grouped entries align properly.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Diffstat:
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/internal/syncer/syncer.go b/internal/syncer/syncer.go
@@ -342,11 +342,6 @@ func (s *Syncer) extractFiles(output string) []FileEntry {
continue
}
- // Skip --info=progress2 summary lines (e.g. " 1,234 56% 1.23MB/s 0:00:01 (xfr#1, to-chk=2/4)")
- if strings.Contains(trimmed, "xfr#") || strings.Contains(trimmed, "to-chk=") {
- continue
- }
-
// Stop at stats section
if strings.HasPrefix(trimmed, "Number of") ||
strings.HasPrefix(trimmed, "sent ") ||
@@ -359,7 +354,8 @@ func (s *Syncer) extractFiles(output string) []FileEntry {
continue
}
- // Check if this is a progress line (contains 100%)
+ // Check if this is a per-file 100% progress line (extract size).
+ // Must come before the progress2 guard since both contain xfr#/to-chk=.
if m := reProgressSize.FindStringSubmatch(trimmed); len(m) > 1 && pending != "" {
cleaned := strings.ReplaceAll(m[1], ",", "")
size, _ := strconv.ParseInt(cleaned, 10, 64)
@@ -368,6 +364,11 @@ func (s *Syncer) extractFiles(output string) []FileEntry {
continue
}
+ // Skip --info=progress2 summary lines (partial %, e.g. "1,234 56% 1.23MB/s 0:00:01 (xfr#1, to-chk=2/4)")
+ if strings.Contains(trimmed, "xfr#") || strings.Contains(trimmed, "to-chk=") {
+ continue
+ }
+
// Skip other progress lines (partial %, bytes/sec)
if strings.Contains(trimmed, "%") || strings.Contains(trimmed, "bytes/sec") {
continue
diff --git a/internal/tui/dashboard.go b/internal/tui/dashboard.go
@@ -259,7 +259,7 @@ func (m DashboardModel) renderEvent(evt SyncEvent) string {
name := padRight(evt.File, 30)
detail := ""
if evt.Size != "" {
- detail = dimStyle.Render(fmt.Sprintf("%8s %s", evt.Size, evt.Duration.Truncate(100*time.Millisecond)))
+ detail = dimStyle.Render(fmt.Sprintf("%18s %s", evt.Size, evt.Duration.Truncate(100*time.Millisecond)))
}
return ts + " " + statusSynced.Render("✓") + " " + name + detail
case "error":