on main help sign in
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.

commite69b513e1a2b06d31be7f87294ed2531b487c2b2 authorAndrey Nering <andreynering@users.noreply.github.com> dateThu 31 Jul 2025, 10:57 (1 year ago) parent0174951
1 file changed+14−10
internal/tui/components/chat/splash/splash.go+14−10
internal/tui/components/chat/splash/splash.go+14−10
@@ -262,30 +262,34 @@ func (s *splashCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
262262 return s, nil
263263 }
264264 case key.Matches(msg, s.keyMap.Yes):
265− if s.isOnboarding {
266− return s, nil
267− }
268265 if s.needsAPIKey {
269266 u, cmd := s.apiKeyInput.Update(msg)
270267 s.apiKeyInput = u.(*models.APIKeyInput)
271268 return s, cmd
272269 }
273−
270+ if s.isOnboarding {
271+ u, cmd := s.modelList.Update(msg)
272+ s.modelList = u
273+ return s, cmd
274+ }
274275 if s.needsProjectInit {
275276 return s, s.initializeProject()
276277 }
277278 case key.Matches(msg, s.keyMap.No):
278− if s.isOnboarding {
279− return s, nil
280− }
281279 if s.needsAPIKey {
282280 u, cmd := s.apiKeyInput.Update(msg)
283281 s.apiKeyInput = u.(*models.APIKeyInput)
284282 return s, cmd
285283 }
286−
287− s.selectedNo = true
288− return s, s.initializeProject()
284+ if s.isOnboarding {
285+ u, cmd := s.modelList.Update(msg)
286+ s.modelList = u
287+ return s, cmd
288+ }
289+ if s.needsProjectInit {
290+ s.selectedNo = true
291+ return s, s.initializeProject()
292+ }
289293 default:
290294 if s.needsAPIKey {
291295 u, cmd := s.apiKeyInput.Update(msg)