Change summary
tui/bubbles/repo/bubble.go | 4 ++++
tui/commands.go | 4 ++++
tui/session.go | 2 ++
3 files changed, 10 insertions(+)
Detailed changes
@@ -3,10 +3,12 @@ package repo
import (
"bytes"
"fmt"
+ "log"
"soft-serve/git"
"soft-serve/tui/style"
"strconv"
"text/template"
+ "time"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
@@ -158,6 +160,7 @@ func (b Bubble) sshAddress() string {
}
func (b *Bubble) setupCmd() tea.Msg {
+ ct := time.Now()
r, err := b.repoSource.GetRepo(b.name)
if err == git.ErrMissingRepo {
return nil
@@ -179,6 +182,7 @@ func (b *Bubble) setupCmd() tea.Msg {
}
b.readmeViewport.Viewport.SetContent(md)
b.GotoTop()
+ log.Printf("Repo bubble loaded in %s", time.Since(ct))
return nil
}
@@ -2,8 +2,10 @@ package tui
import (
"fmt"
+ "log"
"soft-serve/tui/bubbles/repo"
"soft-serve/tui/bubbles/selection"
+ "time"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
@@ -18,6 +20,7 @@ func (e errMsg) Error() string {
}
func (b *Bubble) setupCmd() tea.Msg {
+ ct := time.Now()
lipgloss.SetColorProfile(termenv.ANSI256)
b.repos = b.repoSource.AllRepos()
mes := make([]MenuEntry, 0)
@@ -80,5 +83,6 @@ func (b *Bubble) setupCmd() tea.Msg {
b.activeBox = 1
}
b.state = loadedState
+ log.Printf("App bubble loaded in %s", time.Since(ct))
return nil
}
@@ -28,6 +28,7 @@ func SessionHandler(reposPath string, repoPoll time.Duration) func(ssh.Session)
go func() {
for {
time.Sleep(repoPoll)
+ ct := time.Now()
err := rs.LoadRepos()
if err != nil {
log.Printf("cannot load repos: %s", err)
@@ -40,6 +41,7 @@ func SessionHandler(reposPath string, repoPoll time.Duration) func(ssh.Session)
continue
}
}
+ log.Printf("Repos loaded in %s", time.Since(ct))
appCfg = cfg
}
}()