fix: text-input modals (mkdir/rename/SSH) confirm only on Enter, not y

This commit is contained in:
vrubelroman 2026-05-14 01:04:26 +03:00
parent 1577ee5525
commit 44db42da1e

View file

@ -1104,7 +1104,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.filterMode = false m.filterMode = false
m.status = "Filter cleared" m.status = "Filter cleared"
return m, nil return m, nil
case key.Matches(msg, m.keys.Confirm): case msg.String() == "enter":
log.Printf("[KEY] Filter: Enter — query=%s", m.filterQuery) log.Printf("[KEY] Filter: Enter — query=%s", m.filterQuery)
m.filterMode = false m.filterMode = false
m.filterInput.Blur() m.filterInput.Blur()
@ -1404,7 +1404,7 @@ func (m Model) handleModalKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.modal = modalState{} m.modal = modalState{}
m.status = "Cancelled" m.status = "Cancelled"
return m, nil return m, nil
case key.Matches(msg, m.keys.Confirm): case msg.String() == "enter":
value := strings.TrimSpace(m.modal.input.Value()) value := strings.TrimSpace(m.modal.input.Value())
if value == "" { if value == "" {
if m.modal.kind == modalMkdir { if m.modal.kind == modalMkdir {
@ -1603,7 +1603,7 @@ func (m Model) handleModalKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
} }
m.status = "Cancelled" m.status = "Cancelled"
return m, nil return m, nil
case key.Matches(msg, m.keys.Confirm): case msg.String() == "enter":
// If a test is already in progress, ignore // If a test is already in progress, ignore
if m.ssh != nil && m.ssh.testingConn { if m.ssh != nil && m.ssh.testingConn {
return m, nil return m, nil