on main help sign in
fix(onboarding): address `c` key press not working on onboarding (#1663)
b945baaAndrey Nering
internal/tui/components/chat/splash/splash.go+17−19
@@ -205,25 +205,23 @@ func (s *splashCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) {
205 }
205 }
206 case tea.KeyPressMsg:
206 case tea.KeyPressMsg:
207 switch {
207 switch {
208− case key.Matches(msg, s.keyMap.Copy):
209− if s.showClaudeOAuth2 && s.claudeOAuth2.State == claude.OAuthStateURL {
208+ case key.Matches(msg, s.keyMap.Copy) && s.showClaudeOAuth2 && s.claudeOAuth2.State == claude.OAuthStateURL:
210− return s, tea.Sequence(
209+ return s, tea.Sequence(
211− tea.SetClipboard(s.claudeOAuth2.URL),
210+ tea.SetClipboard(s.claudeOAuth2.URL),
212− func() tea.Msg {
211+ func() tea.Msg {
213− _ = clipboard.WriteAll(s.claudeOAuth2.URL)
212+ _ = clipboard.WriteAll(s.claudeOAuth2.URL)
214− return nil
213+ return nil
215− },
214+ },
216− util.ReportInfo("URL copied to clipboard"),
215+ util.ReportInfo("URL copied to clipboard"),
217− )
216+ )
218− } else if s.showClaudeAuthMethodChooser {
217+ case key.Matches(msg, s.keyMap.Copy) && s.showClaudeAuthMethodChooser:
219− u, cmd := s.claudeAuthMethodChooser.Update(msg)
218+ u, cmd := s.claudeAuthMethodChooser.Update(msg)
220− s.claudeAuthMethodChooser = u.(*claude.AuthMethodChooser)
219+ s.claudeAuthMethodChooser = u.(*claude.AuthMethodChooser)
221− return s, cmd
220+ return s, cmd
222− } else if s.showClaudeOAuth2 {
221+ case key.Matches(msg, s.keyMap.Copy) && s.showClaudeOAuth2:
223− u, cmd := s.claudeOAuth2.Update(msg)
222+ u, cmd := s.claudeOAuth2.Update(msg)
224− s.claudeOAuth2 = u.(*claude.OAuth2)
223+ s.claudeOAuth2 = u.(*claude.OAuth2)
225− return s, cmd
224+ return s, cmd
226− }
227 case key.Matches(msg, s.keyMap.Back):
225 case key.Matches(msg, s.keyMap.Back):
228 if s.showClaudeAuthMethodChooser {
226 if s.showClaudeAuthMethodChooser {
229 s.claudeAuthMethodChooser.SetDefaults()
227 s.claudeAuthMethodChooser.SetDefaults()