esync

Directory watching and remote syncing
Log | Files | Refs | README | LICENSE

commit 69670a9ac5c5f8063bb639c3fa0b23ae2d59d238
parent f1b312c573720555f8aaa74f82cb84215837a66b
Author: Erik Loualiche <[email protected]>
Date:   Sun, 22 Mar 2026 11:00:40 -0500

feat: show warning count in TUI dashboard stats bar

Renames "events" to "syncs" for clarity and appends "N warnings"
when broken symlinks are detected.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

Diffstat:
Mcmd/sync.go | 1+
Minternal/tui/app.go | 6++++++
Minternal/tui/dashboard.go | 6+++++-
3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/cmd/sync.go b/cmd/sync.go @@ -310,6 +310,7 @@ func runTUI(cfg *config.Config, s *syncer.Syncer) error { return err } reportBrokenSymlinks(ws.watcher.BrokenSymlinks, logCh) + app.SetWarnings(len(ws.watcher.BrokenSymlinks)) var wsMu sync.Mutex diff --git a/internal/tui/app.go b/internal/tui/app.go @@ -100,6 +100,12 @@ func (m *AppModel) ConfigReloadChan() <-chan *config.Config { return m.configReloadCh } +// SetWarnings sets the warning count shown in the dashboard stats bar. +// Call before Run() — no concurrency protection needed. +func (m *AppModel) SetWarnings(n int) { + m.dashboard.totalWarnings = n +} + // --------------------------------------------------------------------------- // tea.Model interface // --------------------------------------------------------------------------- diff --git a/internal/tui/dashboard.go b/internal/tui/dashboard.go @@ -42,6 +42,7 @@ type DashboardModel struct { events []SyncEvent totalSynced int totalErrors int + totalWarnings int width, height int filter string filtering bool @@ -364,7 +365,10 @@ func (m DashboardModel) View() string { // --- Stats (2 lines) --- b.WriteString(" " + titleStyle.Render("Stats") + " " + dimStyle.Render(strings.Repeat("─", max(0, m.width-10))) + "\n") - stats := fmt.Sprintf(" %d events │ %d errors", m.totalSynced, m.totalErrors) + stats := fmt.Sprintf(" %d syncs │ %d errors", m.totalSynced, m.totalErrors) + if m.totalWarnings > 0 { + stats += fmt.Sprintf(" │ %d warnings", m.totalWarnings) + } b.WriteString(stats + "\n") // --- Help (1 line) ---