summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-17 00:00:40 +0200
committerewy <ewy0@protonmail.com>2026-04-17 00:00:40 +0200
commit022072ce8bac114ea0a7b94132ed3b8630de2f90 (patch)
tree199fb99ab9e242b6eb195c2b1180e58caa4303d6 /model
parentfbdc2b9d849913ccf8dd7a9001012ce2d28cbd2f (diff)
* 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
Diffstat (limited to 'model')
-rw-r--r--model/git.go6
-rw-r--r--model/init.go2
-rw-r--r--model/mod.go4
-rw-r--r--model/source.go5
4 files changed, 12 insertions, 5 deletions
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)
}