refactor: remove Edit key binding, rename ExtractArchive -> Unpack

- Remove unused Edit key binding (no keys assigned, duplicated Enter)
- Rename ExtractArchive to Unpack across KeyMap struct, DefaultKeyMap(),
  ShortHelp(), FullHelp(), and Model.Update() handler
- Rename handleExtractArchive() -> handleUnpack()
- Update help text, status messages, and dialog titles to 'unpack'
This commit is contained in:
vrubelroman 2026-04-29 15:20:53 +03:00
parent 3b9eb4afa5
commit c8d6976030
3 changed files with 13 additions and 17 deletions

View file

@ -1174,8 +1174,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m.toggleVisualMode()
}
return m, nil
case key.Matches(msg, m.keys.Edit):
return m.handleEdit()
case key.Matches(msg, m.keys.Archive):
return m.handleArchive()
case key.Matches(msg, m.keys.Info):
@ -1257,8 +1255,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
case key.Matches(msg, m.keys.Delete):
return m.handleDelete()
case key.Matches(msg, m.keys.ExtractArchive):
return m.handleExtractArchive()
case key.Matches(msg, m.keys.Unpack):
return m.handleUnpack()
case key.Matches(msg, m.keys.SSH):
log.Printf("[KEY] SSH toggle — active=%s path=%s", m.active, activePane.Path)
return m.handleSSHToggle()
@ -2350,11 +2348,11 @@ func (m *Model) handleDelete() (tea.Model, tea.Cmd) {
return m, trashPlanCmd(sources)
}
func (m *Model) handleExtractArchive() (tea.Model, tea.Cmd) {
func (m *Model) handleUnpack() (tea.Model, tea.Cmd) {
selected, ok := m.activePane().Selected()
if !ok || !isArchiveEntry(selected) {
log.Printf("[SKIP] ExtractArchive: no archive selected")
m.status = "Select an archive file to extract"
log.Printf("[SKIP] Unpack: no archive selected")
m.status = "Select an archive file to unpack"
return m, nil
}
@ -2362,10 +2360,10 @@ func (m *Model) handleExtractArchive() (tea.Model, tea.Cmd) {
targetPane := m.passivePane()
targetDir := targetPane.Path
log.Printf("[ACTION] ExtractArchive: source=%s target=%s", selected.Path, targetDir)
log.Printf("[ACTION] Unpack: source=%s target=%s", selected.Path, targetDir)
// Show confirm dialog before extracting
title := fmt.Sprintf("Extract %s?", selected.DisplayName())
title := fmt.Sprintf("Unpack %s?", selected.DisplayName())
body := fmt.Sprintf("Archive: %s\nTarget: %s", selected.Path, targetDir)
note := "Enter / y to confirm, Esc / n to cancel"
pending := pendingOperation{