From e69b513e1a2b06d31be7f87294ed2531b487c2b2 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Thu, 31 Jul 2025 10:57:31 -0300 Subject: [PATCH] fix(onboarding): fix y/n key press on model list and api key field (#402) A bug on onboarding made it impossible to press "y" and "n" on onboarding, on both the model list and the API key field. This also means that on some terminals, like the Windows Terminal, pasting an API key would supress all "y" and "n" chars present in the key, because these terminal receives an even for each character being pressed. --- internal/tui/components/chat/splash/splash.go | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/tui/components/chat/splash/splash.go b/internal/tui/components/chat/splash/splash.go index a986f07ec87e9877d929de6a6954e66c35191399..9a74e79b30bbdcc9e0049f9fea55c23607fbc00a 100644 --- a/internal/tui/components/chat/splash/splash.go +++ b/internal/tui/components/chat/splash/splash.go @@ -262,30 +262,34 @@ func (s *splashCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return s, nil } case key.Matches(msg, s.keyMap.Yes): - if s.isOnboarding { - return s, nil - } if s.needsAPIKey { u, cmd := s.apiKeyInput.Update(msg) s.apiKeyInput = u.(*models.APIKeyInput) return s, cmd } - + if s.isOnboarding { + u, cmd := s.modelList.Update(msg) + s.modelList = u + return s, cmd + } if s.needsProjectInit { return s, s.initializeProject() } case key.Matches(msg, s.keyMap.No): - if s.isOnboarding { - return s, nil - } if s.needsAPIKey { u, cmd := s.apiKeyInput.Update(msg) s.apiKeyInput = u.(*models.APIKeyInput) return s, cmd } - - s.selectedNo = true - return s, s.initializeProject() + if s.isOnboarding { + u, cmd := s.modelList.Update(msg) + s.modelList = u + return s, cmd + } + if s.needsProjectInit { + s.selectedNo = true + return s, s.initializeProject() + } default: if s.needsAPIKey { u, cmd := s.apiKeyInput.Update(msg)