diff --git a/internal/benchmark/benchmark.go b/internal/benchmark/benchmark.go index ad9175d..7e83c1f 100644 --- a/internal/benchmark/benchmark.go +++ b/internal/benchmark/benchmark.go @@ -200,14 +200,21 @@ func (s *Suite) RunFullSuite(ctx context.Context, availableEncoders []string) er } for _, preset := range test.presets { - current++ + // Report progress before starting test if s.Progress != nil { s.Progress(current, totalTests, test.encoder, preset) } + // Run the test result := s.TestEncoder(ctx, test.encoder, preset) s.Results = append(s.Results, result) + // Increment and report completion + current++ + if s.Progress != nil { + s.Progress(current, totalTests, test.encoder, preset) + } + // Check for context cancellation if ctx.Err() != nil { return ctx.Err() diff --git a/internal/ui/benchmarkview.go b/internal/ui/benchmarkview.go index 06eb6ff..48ba176 100644 --- a/internal/ui/benchmarkview.go +++ b/internal/ui/benchmarkview.go @@ -112,7 +112,7 @@ func (v *BenchmarkProgressView) GetContainer() *fyne.Container { // UpdateProgress updates the progress bar and labels func (v *BenchmarkProgressView) UpdateProgress(current, total int, encoder, preset string) { - pct := float64(current) / float64(total) + pct := (float64(current) / float64(total)) * 100 // Convert to 0-100 range fyne.CurrentApp().Driver().DoFromGoroutine(func() { v.progressBar.SetValue(pct) v.statusLabel.SetText(fmt.Sprintf("Testing encoder %d of %d", current, total)) @@ -174,7 +174,7 @@ func (v *BenchmarkProgressView) AddResult(result benchmark.Result) { func (v *BenchmarkProgressView) SetComplete() { fyne.CurrentApp().Driver().DoFromGoroutine(func() { v.statusLabel.SetText("Benchmark complete!") - v.progressBar.SetValue(1.0) + v.progressBar.SetValue(100.0) v.currentLabel.SetText("") v.cancelBtn.SetText("Close") v.statusLabel.Refresh()