diff --git a/internal/ui/docs/update.go b/internal/ui/docs/update.go index 29d5353..52a6320 100644 --- a/internal/ui/docs/update.go +++ b/internal/ui/docs/update.go @@ -18,12 +18,9 @@ func (e Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.KeyPressMsg: if e.searching { switch { - case key.Matches(msg, d.SearchReset): + case key.Matches(msg, g.Escape): e.searching = false e.searchInput.Blur() - e.searchInput.SetValue("") - e.matches = nil - e.matchIndex = 0 e.SetSize(e.width, e.height) case msg.String() == "enter": e.searching = false diff --git a/internal/ui/history/update.go b/internal/ui/history/update.go index ac1371b..d96e095 100644 --- a/internal/ui/history/update.go +++ b/internal/ui/history/update.go @@ -105,7 +105,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { g := keys.Keys.Global if m.searchKind != searchKindOff && !m.searchAccepted { - // Actively typing: only search navigation + accept/cancel. switch { case key.Matches(msg, g.Escape): return m, m.clearSearch() @@ -116,24 +115,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } m.acceptSearch() - case key.Matches(msg, g.Up): - if m.cursor > 0 { - m.cursor-- - m.refreshListViewport() - m.refreshBody() - m.bodyViewport.SetYOffset(0) - m.bodyViewport.SetXOffset(0) - } - - case key.Matches(msg, g.Down): - if m.cursor < len(m.entries)-1 { - m.cursor++ - m.refreshListViewport() - m.refreshBody() - m.bodyViewport.SetYOffset(0) - m.bodyViewport.SetXOffset(0) - } - default: var cmd tea.Cmd m.searchInput, cmd = m.searchInput.Update(msg) diff --git a/internal/ui/intercept/update.go b/internal/ui/intercept/update.go index 6e06379..f57b49a 100644 --- a/internal/ui/intercept/update.go +++ b/internal/ui/intercept/update.go @@ -287,8 +287,6 @@ func (m Model) updateNormalMode(msg tea.KeyPressMsg, cmds *[]tea.Cmd) (tea.Model } func (m Model) updateEditMode(msg tea.KeyPressMsg, cmds *[]tea.Cmd) (tea.Model, tea.Cmd) { - onResponses := m.captureResponse && m.focusedPanel == panelResponses - switch { case key.Matches(msg, keys.Keys.Global.Escape): m.saveCurrentEdit() @@ -296,19 +294,6 @@ func (m Model) updateEditMode(msg tea.KeyPressMsg, cmds *[]tea.Cmd) (tea.Model, m.textarea.Blur() m.refreshBodyViewport() - case key.Matches(msg, keys.Keys.Intercept.UndoEdits): - if onResponses { - if len(m.responseQueue) > 0 { - delete(m.pendingResponseEdits, m.responseQueue[m.responseCursor]) - m.textarea.SetValue(intercept.FormatRawResponse(m.responseQueue[m.responseCursor].Flow)) - } - } else { - if len(m.queue) > 0 { - delete(m.pendingEdits, m.queue[m.cursor]) - m.textarea.SetValue(intercept.FormatRawRequest(m.queue[m.cursor].Flow)) - } - } - default: var cmd tea.Cmd m.textarea, cmd = m.textarea.Update(msg)