Migrate components to ilovetui

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-05-26 16:38:09 +02:00
parent c7523e69e7
commit 9ac6040629
20 changed files with 54 additions and 154 deletions
+6 -7
View File
@@ -13,7 +13,6 @@ import (
ilovetui "github.com/anotherhadi/ilovetui"
"github.com/anotherhadi/spilltea/internal/keys"
"github.com/anotherhadi/spilltea/internal/plugins"
"github.com/anotherhadi/spilltea/internal/style"
)
type Model struct {
@@ -37,7 +36,7 @@ type Model struct {
}
func New(mgr *plugins.Manager) Model {
ta := style.NewTextarea(true)
ta := ilovetui.NewTextarea(true)
ta.Placeholder = "plugin configuration..."
ta.Blur()
@@ -46,12 +45,12 @@ func New(mgr *plugins.Manager) Model {
return Model{
manager: mgr,
listViewport: style.NewViewport(),
detailViewport: style.NewViewport(),
listViewport: ilovetui.NewViewport(),
detailViewport: ilovetui.NewViewport(),
textarea: ta,
filterInput: fi,
pager: style.NewPaginator(),
help: style.NewHelp(),
pager: ilovetui.NewPaginator(),
help: ilovetui.NewHelp(),
}
}
@@ -71,7 +70,7 @@ func (m *Model) recalcSizes() {
}
m.help.SetWidth(m.width - 2)
listH, detailH := style.SplitH(m.height, m.renderStatusBar(), 0.4)
listH, detailH := ilovetui.SplitH(m.height, m.renderStatusBar(), 0.4)
inner := m.width - 2
if inner < 0 {
+2 -3
View File
@@ -10,7 +10,6 @@ import (
ilovetui "github.com/anotherhadi/ilovetui"
"github.com/anotherhadi/spilltea/internal/icons"
"github.com/anotherhadi/spilltea/internal/keys"
"github.com/anotherhadi/spilltea/internal/style"
"github.com/anotherhadi/spilltea/internal/util"
)
@@ -19,7 +18,7 @@ func (m Model) View() tea.View {
return tea.NewView(lipgloss.Place(m.width, m.height, lipgloss.Center, lipgloss.Center, ilovetui.S.Faint.Render(util.CenterLines("(._.)~*.'", "no plugins loaded"))))
}
listH, detailH := style.SplitH(m.height, m.renderStatusBar(), 0.4)
listH, detailH := ilovetui.SplitH(m.height, m.renderStatusBar(), 0.4)
content := lipgloss.JoinVertical(lipgloss.Left,
m.renderListPanel(m.width, listH),
@@ -71,7 +70,7 @@ func (m *Model) renderDetailPanel(h int) string {
ilovetui.S.Faint.Render(filepath.Base(info.FilePath)),
)
parts := []string{header, style.ViewportView(&m.detailViewport)}
parts := []string{header, ilovetui.ViewportView(&m.detailViewport)}
if m.hasConfig() {
var configLabel string