diff --git a/internal/ui/screens/snapshot.go b/internal/ui/screens/snapshot.go index b2567d4c078651f7b68e133f23088a3e1405f2b7..053d9511c425e9de93bb89c1da4822418eae4ee2 100644 --- a/internal/ui/screens/snapshot.go +++ b/internal/ui/screens/snapshot.go @@ -90,6 +90,7 @@ func (s *Snapshot) Init() tea.Cmd { if s.loader == nil { s.phase = phaseSnapshotManual + s.entered = "" s.buildManualForm() return s.manualForm.Init() } @@ -269,8 +270,10 @@ func (s *Snapshot) rebuildSelectForm() { } // buildManualForm constructs the huh Input for manual snapshot ID entry. +// It does not reset s.entered so that callers rebuilding the form for +// theme changes preserve the user's input. Callers that start a fresh +// entry (Init, switchToManual) reset s.entered explicitly. func (s *Snapshot) buildManualForm() { - s.entered = "" input := huh.NewInput(). Title("Snapshot ID"). @@ -289,6 +292,7 @@ func (s *Snapshot) buildManualForm() { func (s *Snapshot) switchToManual(notice string) { s.phase = phaseSnapshotManual s.notice = notice + s.entered = "" s.buildManualForm() }