on main help sign in
fix: fix `c` key not working in model filter (#1534)
e5639f0Beiming Zhang
internal/tui/components/dialogs/models/models.go+9−11
@@ -143,17 +143,15 @@ func (m *modelDialogCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) {
143 return m, util.CmdHandler(dialogs.CloseDialogMsg{})
143 return m, util.CmdHandler(dialogs.CloseDialogMsg{})
144 case tea.KeyPressMsg:
144 case tea.KeyPressMsg:
145 switch {
145 switch {
146− case key.Matches(msg, key.NewBinding(key.WithKeys("c", "C"))):
147− if m.showClaudeOAuth2 && m.claudeOAuth2.State == claude.OAuthStateURL {
146+ case key.Matches(msg, key.NewBinding(key.WithKeys("c", "C"))) && m.showClaudeOAuth2 && m.claudeOAuth2.State == claude.OAuthStateURL:
148− return m, tea.Sequence(
147+ return m, tea.Sequence(
149− tea.SetClipboard(m.claudeOAuth2.URL),
148+ tea.SetClipboard(m.claudeOAuth2.URL),
150− func() tea.Msg {
149+ func() tea.Msg {
151− _ = clipboard.WriteAll(m.claudeOAuth2.URL)
150+ _ = clipboard.WriteAll(m.claudeOAuth2.URL)
152− return nil
151+ return nil
153− },
152+ },
154− util.ReportInfo("URL copied to clipboard"),
153+ util.ReportInfo("URL copied to clipboard"),
155− )
154+ )
156− }
157 case key.Matches(msg, m.keyMap.Choose) && m.showClaudeAuthMethodChooser:
155 case key.Matches(msg, m.keyMap.Choose) && m.showClaudeAuthMethodChooser:
158 m.claudeAuthMethodChooser.ToggleChoice()
156 m.claudeAuthMethodChooser.ToggleChoice()
159 return m, nil
157 return m, nil