feat: small UI improvements (#394)

This commit is contained in:
Brendan Le Glaunec
2026-02-01 22:30:55 +01:00
committed by GitHub
parent af41fc6cb8
commit f192139cc3
11 changed files with 402 additions and 29 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
package ui
import (
"context"
"errors"
"fmt"
"io"
@@ -20,7 +21,7 @@ type Reporter interface {
}
// NewReporter creates a Reporter based on the requested mode.
func NewReporter(mode cameradar.Mode, debug bool, out io.Writer, interactive bool) (Reporter, error) {
func NewReporter(mode cameradar.Mode, debug bool, out io.Writer, interactive bool, buildInfo BuildInfo, cancel context.CancelFunc) (Reporter, error) {
if debug {
return NewPlainReporter(out, debug), nil
}
@@ -32,10 +33,10 @@ func NewReporter(mode cameradar.Mode, debug bool, out io.Writer, interactive boo
if !interactive {
return nil, errors.New("tui mode requires an interactive terminal")
}
return NewTUIReporter(debug, out)
return NewTUIReporter(debug, out, buildInfo, cancel)
case cameradar.ModeAuto:
if interactive {
return NewTUIReporter(debug, out)
return NewTUIReporter(debug, out, buildInfo, cancel)
}
return NewPlainReporter(out, debug), nil
default: