From 022072ce8bac114ea0a7b94132ed3b8630de2f90 Mon Sep 17 00:00:00 2001 From: ewy Date: Fri, 17 Apr 2026 00:00:40 +0200 Subject: * fix bug which prevented multiple sources from showing up in the tui at the same time * add padding to bottom of sources * add git status panel to bottom of tui --- model/git.go | 6 ++++++ model/init.go | 2 +- model/mod.go | 4 ++-- model/source.go | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 model/git.go (limited to 'model') diff --git a/model/git.go b/model/git.go new file mode 100644 index 0000000..35d7557 --- /dev/null +++ b/model/git.go @@ -0,0 +1,6 @@ +package model + +type GitInfo struct { + Branch string + Insertions, Deletions, Changes int +} diff --git a/model/init.go b/model/init.go index 503d2b8..13158da 100644 --- a/model/init.go +++ b/model/init.go @@ -1,5 +1,5 @@ package model -type HasInit interface { +type Initializer interface { Init() error } diff --git a/model/mod.go b/model/mod.go index f6a7a94..0a680b5 100644 --- a/model/mod.go +++ b/model/mod.go @@ -1,5 +1,5 @@ package model -type Hydrator interface { - Hydrate(source *Source, result *HydratedSource) error +type Modder interface { + Mod(source *Source, result *HydratedSource) error } diff --git a/model/source.go b/model/source.go index 3a5fe10..29cff05 100644 --- a/model/source.go +++ b/model/source.go @@ -18,6 +18,7 @@ type HydratedSource struct { HydratedTargets []HydratedTarget Aliases []string Icon string + Git *GitInfo } func (s *Source) Label() string { @@ -31,13 +32,13 @@ func (s *HydratedSource) Label() string { return s.Identity.Full } -func (s *Source) Hydrate(hydrators []Hydrator) *HydratedSource { +func (s *Source) Hydrate(hydrators []Modder) *HydratedSource { hs := &HydratedSource{ Source: s, HydratedTargets: make([]HydratedTarget, 0, len(s.Targets)), } for _, h := range hydrators { - err := h.Hydrate(s, hs) + err := h.Mod(s, hs) if err != nil { spool.Warn("%v", err) } -- cgit v1.3