fix: completely silent TUI - no stdout indicators

This commit is contained in:
2025-11-05 13:47:20 +00:00
parent 69aff0539d
commit d40616a7cd

View File

@@ -46,12 +46,9 @@ func NewBackupExecution(cfg *config.Config, log logger.Logger, parent tea.Model,
} }
func (m BackupExecutionModel) Init() tea.Cmd { func (m BackupExecutionModel) Init() tea.Cmd {
reporter := NewTUIProgressReporter() // TUI handles all display through View() - no progress callbacks needed
// Note: Progress updates are handled through the model's internal state
// No need for callbacks that print to screen - the View() handles all display
return tea.Batch( return tea.Batch(
executeBackupWithTUIProgress(m.config, m.logger, m.backupType, m.databaseName, m.ratio, reporter), executeBackupWithTUIProgress(m.config, m.logger, m.backupType, m.databaseName, m.ratio),
backupTickCmd(), backupTickCmd(),
) )
} }
@@ -75,7 +72,7 @@ type backupCompleteMsg struct {
err error err error
} }
func executeBackupWithTUIProgress(cfg *config.Config, log logger.Logger, backupType, dbName string, ratio int, reporter *TUIProgressReporter) tea.Cmd { func executeBackupWithTUIProgress(cfg *config.Config, log logger.Logger, backupType, dbName string, ratio int) tea.Cmd {
return func() tea.Msg { return func() tea.Msg {
// Use configurable cluster timeout (minutes) from config; default set in config.New() // Use configurable cluster timeout (minutes) from config; default set in config.New()
clusterTimeout := time.Duration(cfg.ClusterTimeoutMinutes) * time.Minute clusterTimeout := time.Duration(cfg.ClusterTimeoutMinutes) * time.Minute
@@ -100,7 +97,8 @@ func executeBackupWithTUIProgress(cfg *config.Config, log logger.Logger, backupT
} }
} }
engine := backup.NewSilent(cfg, log, dbClient, reporter) // Pass nil as indicator - TUI itself handles all display, no stdout printing
engine := backup.NewSilent(cfg, log, dbClient, nil)
var backupErr error var backupErr error
switch backupType { switch backupType {