Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions cmd/history.go

This file was deleted.

41 changes: 0 additions & 41 deletions internal/handlers/history.go

This file was deleted.

95 changes: 0 additions & 95 deletions internal/presenters/history_presenter.go

This file was deleted.

32 changes: 0 additions & 32 deletions internal/services/history/service.go

This file was deleted.

7 changes: 2 additions & 5 deletions internal/tui/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type keyMap struct {
Resume key.Binding
Kill key.Binding
Commit key.Binding
History key.Binding
Tree key.Binding
}

Expand All @@ -27,21 +26,19 @@ func defaultKeys() keyMap {
Resume: key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "resume VM")),
Kill: key.NewBinding(key.WithKeys("k"), key.WithHelp("k", "delete")),
Commit: key.NewBinding(key.WithKeys("c"), key.WithHelp("c", "commit VM")),
History: key.NewBinding(key.WithKeys("h"), key.WithHelp("h", "history")),
Tree: key.NewBinding(key.WithKeys("t"), key.WithHelp("t", "tree")),
}
}

// Implement help.KeyMap interface for bubbles/help
func (k keyMap) ShortHelp() []key.Binding {
return []key.Binding{k.Connect, k.Branch, k.Pause, k.Resume, k.History, k.Tree, k.Switch, k.Quit}
return []key.Binding{k.Connect, k.Branch, k.Pause, k.Resume, k.Tree, k.Switch, k.Quit}
}

func (k keyMap) FullHelp() [][]key.Binding {
return [][]key.Binding{
{k.Connect, k.Branch, k.Commit},
{k.Pause, k.Resume, k.Kill},
{k.History, k.Tree},
{k.Switch, k.Quit},
{k.Tree, k.Switch, k.Quit},
}
}
26 changes: 0 additions & 26 deletions internal/tui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/hdresearch/vers-cli/internal/app"
"github.com/hdresearch/vers-cli/internal/handlers"
delsvc "github.com/hdresearch/vers-cli/internal/services/deletion"
histSvc "github.com/hdresearch/vers-cli/internal/services/history"
svcstatus "github.com/hdresearch/vers-cli/internal/services/status"
vmSvc "github.com/hdresearch/vers-cli/internal/services/vm"
sshutil "github.com/hdresearch/vers-cli/internal/ssh"
Expand Down Expand Up @@ -46,10 +45,6 @@ type actionCompletedMsg struct {
text string
err error
}
type historyLoadedMsg struct {
lines []string
err error
}

type Model struct {
app *app.App
Expand Down Expand Up @@ -208,27 +203,6 @@ func (m Model) selectedVMID() (string, bool) {
return "", false
}

func loadHistoryCmd(m Model, vmID string) tea.Cmd {
return func() tea.Msg {
ctx, cancel := context.WithTimeout(context.Background(), m.app.Timeouts.APIMedium)
defer cancel()
commits, err := histSvc.GetCommits(ctx, m.app.Client, vmID)
if err != nil {
return historyLoadedMsg{err: err}
}
lines := make([]string, 0, len(commits))
for _, c := range commits {
line := c.ID
if c.Alias != "" {
line = c.Alias + " (" + c.ID + ")"
}
line += " | " + c.Author
lines = append(lines, line)
}
return historyLoadedMsg{lines: lines}
}
}

func doCommitCmd(m Model, vmID string, tagCSV string) tea.Cmd {
return func() tea.Msg {
// Split and trim tags
Expand Down
20 changes: 0 additions & 20 deletions internal/tui/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
m.loading = true
return m, refreshVMsCmd(m)
case historyLoadedMsg:
m.status = ""
if msg.err != nil {
m.status = "History error: " + msg.err.Error()
m.modalActive = false
return m, nil
}
m.modalText = msg.lines
m.modalActive = true
m.modalKind = "text"
m.modalPrompt = "History:"
return m, nil

case tea.KeyMsg:
switch msg.String() {
Expand Down Expand Up @@ -119,14 +107,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
return m, nil
}
case "h":
if it, ok := m.vms.SelectedItem().(vmItem); ok {
m.modalActive = true
m.modalKind = "text"
m.modalPrompt = "History:"
m.status = "Loading history..."
return m, loadHistoryCmd(m, it.ID)
}
}
var cmd tea.Cmd
m.vms, cmd = m.vms.Update(msg)
Expand Down
Loading