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
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gen2brain/beeep v0.0.0-20240516210008-9c006672e7f4
github.com/jahvon/glamour v0.8.1-patch3
github.com/jahvon/open-golang v0.0.0-20240522004812-68511c3bc9ef
github.com/jahvon/tuikit v0.0.27
github.com/jahvon/tuikit v0.1.2
github.com/mattn/go-runewidth v0.0.16
github.com/onsi/ginkgo/v2 v2.23.4
github.com/onsi/gomega v1.37.0
Expand All @@ -23,7 +23,7 @@ require (
go.etcd.io/bbolt v1.4.0
go.uber.org/mock v0.5.2
golang.org/x/crypto v0.38.0
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
golang.org/x/sync v0.14.0
gopkg.in/yaml.v3 v3.0.1
mvdan.cc/sh/v3 v3.11.0
Expand All @@ -37,11 +37,11 @@ require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/catppuccin/go v0.3.0 // indirect
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
github.com/charmbracelet/huh v0.6.0 // indirect
github.com/charmbracelet/log v0.4.0 // indirect
github.com/charmbracelet/colorprofile v0.3.1 // indirect
github.com/charmbracelet/huh v0.7.0 // indirect
github.com/charmbracelet/log v0.4.2 // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250501183327-ad3bc78c6a81 // indirect
github.com/charmbracelet/x/exp/strings v0.0.0-20250213125511-a0c32e22e4fc // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
Expand Down Expand Up @@ -82,9 +82,9 @@ require (
github.com/yuin/goldmark v1.7.8 // indirect
github.com/yuin/goldmark-emoji v1.0.4 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/tools v0.31.0 // indirect
golang.org/x/tools v0.33.0 // indirect
)
48 changes: 28 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,34 @@ github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u
github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
github.com/charmbracelet/bubbletea v1.3.5 h1:JAMNLTbqMOhSwoELIr0qyP4VidFq72/6E9j7HHmRKQc=
github.com/charmbracelet/bubbletea v1.3.5/go.mod h1:TkCnmH+aBd4LrXhXcqrKiYwRs7qyQx5rBgH5fVY3v54=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
github.com/charmbracelet/huh v0.6.0 h1:mZM8VvZGuE0hoDXq6XLxRtgfWyTI3b2jZNKh0xWmax8=
github.com/charmbracelet/huh v0.6.0/go.mod h1:GGNKeWCeNzKpEOh/OJD8WBwTQjV3prFAtQPpLv+AVwU=
github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40=
github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
github.com/charmbracelet/huh v0.7.0 h1:W8S1uyGETgj9Tuda3/JdVkc3x7DBLZYPZc4c+/rnRdc=
github.com/charmbracelet/huh v0.7.0/go.mod h1:UGC3DZHlgOKHvHC07a5vHag41zzhpPFj34U92sOmyuk=
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
github.com/charmbracelet/log v0.4.0 h1:G9bQAcx8rWA2T3pWvx7YtPTPwgqpk7D68BX21IRW8ZM=
github.com/charmbracelet/log v0.4.0/go.mod h1:63bXt/djrizTec0l11H20t8FDSvA4CRZJ1KH22MdptM=
github.com/charmbracelet/log v0.4.2 h1:hYt8Qj6a8yLnvR+h7MwsJv/XvmBJXiueUcI3cIxsyig=
github.com/charmbracelet/log v0.4.2/go.mod h1:qifHGX/tc7eluv2R6pWIpyHDDrrb/AG71Pf2ysQu5nw=
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ=
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250501183327-ad3bc78c6a81 h1:iGrflaL5jQW6crML+pZx/ulWAVZQR3CQoRGvFsr2Tyg=
github.com/charmbracelet/x/cellbuf v0.0.14-0.20250501183327-ad3bc78c6a81/go.mod h1:poPFOXFTsJsnLbkV3H2KxAAXT7pdjxxLujLocWjkyzM=
github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U=
github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ=
github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA=
github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0=
github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a h1:FsHEJ52OC4VuTzU8t+n5frMjLvpYWEznSr/u8tnkCYw=
github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/exp/strings v0.0.0-20250213125511-a0c32e22e4fc h1:k2jFXp3mIsJ1lqGzpABadj9sGInRyk7kTxXfM/Lo1d0=
github.com/charmbracelet/x/exp/strings v0.0.0-20250213125511-a0c32e22e4fc/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ=
github.com/charmbracelet/x/exp/teatest v0.0.0-20240919170804-a4978c8e603a h1:sS42HbmCab8rCehUwNO/bQEZQoJ6GavhZyO+245mBwA=
github.com/charmbracelet/x/exp/teatest v0.0.0-20240919170804-a4978c8e603a/go.mod h1:NDRRSMP6bZbCs4jyc4i1/4UG4M+0PEiQdpivQgD0Mio=
github.com/charmbracelet/x/exp/teatest v0.0.0-20250623112707-45752038d08d h1:b8GXylLbV6WaBxHjj4fyBqVzWW66vScY5bbJCwoMBOA=
github.com/charmbracelet/x/exp/teatest v0.0.0-20250623112707-45752038d08d/go.mod h1:MhV4atqUTcHvdaA7Qbkgb0Tvvr+BrH6IW7/i2XW39R8=
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI=
github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4=
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
Expand Down Expand Up @@ -96,8 +104,8 @@ github.com/jahvon/glamour v0.8.1-patch3 h1:LfyMACZavV8yxK4UsPENNQQOqafWuq4ZdLuEA
github.com/jahvon/glamour v0.8.1-patch3/go.mod h1:30MVJwG3rcEHrN277NrA4DKzndSL9lBtEmpcfOygwCQ=
github.com/jahvon/open-golang v0.0.0-20240522004812-68511c3bc9ef h1:4PS/MNVT6Rsv15x5Rtwaw971e6kFvNUAf9nvUsZ5hcc=
github.com/jahvon/open-golang v0.0.0-20240522004812-68511c3bc9ef/go.mod h1:dUmuT5CN6osIeLSRtTPJOf0Yz+qAbcyU6omnCzI+ZfQ=
github.com/jahvon/tuikit v0.0.27 h1:NV+Zzput4twGch+KTwpAOFlR+R/MKtS9DYs3p1sONwg=
github.com/jahvon/tuikit v0.0.27/go.mod h1:zUysbTPUE0tAEB5DfdWvL6AT3g8AZQ+fcwrfUhVXuwA=
github.com/jahvon/tuikit v0.1.2 h1:BGN942W8S89d+hkKxMsUUB50+63T1VgkBamsKwzXpLc=
github.com/jahvon/tuikit v0.1.2/go.mod h1:Bi6zph90IAONRweA/9eUKjVNaxCstxhwubnhFOthEFs=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -182,10 +190,10 @@ go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f h1:oFMYAjX0867ZD2jcNiLBrI9BdpmEkvPyi5YrBGXbamg=
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -196,8 +204,8 @@ golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=
golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI=
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
42 changes: 23 additions & 19 deletions internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import (
"runtime"
"strings"

"github.com/charmbracelet/lipgloss"
"github.com/jahvon/tuikit"
"github.com/jahvon/tuikit/io"
"github.com/jahvon/tuikit/styles"
"github.com/jahvon/tuikit/themes"
"github.com/pkg/errors"

"github.com/jahvon/flow/internal/cache"
Expand Down Expand Up @@ -81,9 +80,14 @@ func NewContext(ctx context.Context, stdIn, stdOut *os.File) *Context {
CurrentWorkspace: wsConfig,
WorkspacesCache: workspaceCache,
ExecutableCache: executableCache,
Logger: io.NewLogger(stdOut, flowIO.Theme(cfg.Theme.String()), logMode, filesystem.LogsDir()),
stdOut: stdOut,
stdIn: stdIn,
Logger: io.NewLogger(
io.WithOutput(stdOut),
io.WithTheme(flowIO.Theme(cfg.Theme.String())),
io.WithMode(logMode),
io.WithArchiveDirectory(filesystem.LogsDir()),
),
stdOut: stdOut,
stdIn: stdIn,
}

app := tuikit.NewApplication(
Expand Down Expand Up @@ -225,48 +229,48 @@ func currentWorkspace(cfg *config.Config) (*workspace.Workspace, error) {
return filesystem.LoadWorkspaceConfig(ws, wsPath)
}

func overrideThemeColor(theme styles.Theme, palette *config.ColorPalette) styles.Theme {
func overrideThemeColor(theme themes.Theme, palette *config.ColorPalette) themes.Theme {
if palette == nil {
return theme
}
if palette.Primary != nil {
theme.PrimaryColor = lipgloss.Color(*palette.Primary)
theme.ColorPalette().Primary = *palette.Primary
}
if palette.Secondary != nil {
theme.SecondaryColor = lipgloss.Color(*palette.Secondary)
theme.ColorPalette().Secondary = *palette.Secondary
}
if palette.Tertiary != nil {
theme.TertiaryColor = lipgloss.Color(*palette.Tertiary)
theme.ColorPalette().Tertiary = *palette.Tertiary
}
if palette.Success != nil {
theme.SuccessColor = lipgloss.Color(*palette.Success)
theme.ColorPalette().Success = *palette.Success
}
if palette.Warning != nil {
theme.WarningColor = lipgloss.Color(*palette.Warning)
theme.ColorPalette().Warning = *palette.Warning
}
if palette.Error != nil {
theme.ErrorColor = lipgloss.Color(*palette.Error)
theme.ColorPalette().Error = *palette.Error
}
if palette.Info != nil {
theme.InfoColor = lipgloss.Color(*palette.Info)
theme.ColorPalette().Info = *palette.Info
}
if palette.Body != nil {
theme.BodyColor = lipgloss.Color(*palette.Body)
theme.ColorPalette().Body = *palette.Body
}
if palette.Emphasis != nil {
theme.EmphasisColor = lipgloss.Color(*palette.Emphasis)
theme.ColorPalette().Emphasis = *palette.Emphasis
}
if palette.White != nil {
theme.White = lipgloss.Color(*palette.White)
theme.ColorPalette().White = *palette.White
}
if palette.Black != nil {
theme.Black = lipgloss.Color(*palette.Black)
theme.ColorPalette().Black = *palette.Black
}
if palette.Gray != nil {
theme.Gray = lipgloss.Color(*palette.Gray)
theme.ColorPalette().Gray = *palette.Gray
}
if palette.CodeStyle != nil {
theme.ChromaCodeStyle = *palette.CodeStyle
theme.ColorPalette().ChromaCodeStyle = *palette.CodeStyle
}
return theme
}
16 changes: 8 additions & 8 deletions internal/context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/charmbracelet/lipgloss"
"github.com/jahvon/tuikit/styles"
"github.com/jahvon/tuikit/themes"
"github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

Expand Down Expand Up @@ -69,14 +69,14 @@ var _ = ginkgo.Describe("Context", func() {
})

ginkgo.Describe("overrideThemeColor", func() {
var theme styles.Theme
var theme themes.Theme
var palette *config.ColorPalette

ginkgo.BeforeEach(func() {
theme = styles.Theme{
PrimaryColor: "#000000",
SecondaryColor: "#FFFFFF",
}
theme = themes.NewTheme("theme", themes.ColorPalette{
Primary: "#000000",
Secondary: "#FFFFFF",
})
palette = &config.ColorPalette{
Primary: strPtr("#FF0000"),
Secondary: strPtr("#00FF00"),
Expand All @@ -85,8 +85,8 @@ var _ = ginkgo.Describe("Context", func() {

ginkgo.It("should override the theme colors with the palette colors", func() {
newTheme := overrideThemeColor(theme, palette)
Expect(newTheme.PrimaryColor).To(Equal(lipgloss.Color("#FF0000")))
Expect(newTheme.SecondaryColor).To(Equal(lipgloss.Color("#00FF00")))
Expect(newTheme.ColorPalette().PrimaryColor()).To(Equal(lipgloss.Color("#FF0000")))
Expect(newTheme.ColorPalette().SecondaryColor()).To(Equal(lipgloss.Color("#00FF00")))
})

ginkgo.It("should not change the theme if the palette is nil", func() {
Expand Down
6 changes: 3 additions & 3 deletions internal/io/executable/views.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/atotto/clipboard"
"github.com/jahvon/tuikit"
"github.com/jahvon/tuikit/styles"
"github.com/jahvon/tuikit/themes"
"github.com/jahvon/tuikit/types"
"github.com/jahvon/tuikit/views"

Expand Down Expand Up @@ -40,7 +40,7 @@ func NewExecutableView(
if err := clipboard.WriteAll(exec.Ref().String()); err != nil {
container.HandleError(fmt.Errorf("unable to copy reference to clipboard: %w", err))
} else {
container.SetNotice("copied reference to clipboard", styles.OutputLevelInfo)
container.SetNotice("copied reference to clipboard", themes.OutputLevelInfo)
}
return nil
},
Expand Down Expand Up @@ -109,7 +109,7 @@ func NewTemplateView(
if err := clipboard.WriteAll(template.Location()); err != nil {
container.HandleError(fmt.Errorf("unable to copy location to clipboard: %w", err))
} else {
container.SetNotice("copied location to clipboard", styles.OutputLevelInfo)
container.SetNotice("copied location to clipboard", themes.OutputLevelInfo)
}
return nil
},
Expand Down
8 changes: 4 additions & 4 deletions internal/io/library/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/charmbracelet/bubbles/viewport"
"github.com/jahvon/tuikit"
"github.com/jahvon/tuikit/styles"
"github.com/jahvon/tuikit/themes"
"github.com/jahvon/tuikit/views"

"github.com/jahvon/flow/internal/context"
Expand All @@ -30,7 +30,7 @@ type Library struct {
allWorkspaces workspace.WorkspaceList
allExecutables executable.ExecutableList
filter Filter
theme styles.Theme
theme themes.Theme

currentPane, currentWorkspace, currentNamespace, currentExecutable uint
currentFormat, currentHelpPage uint
Expand All @@ -51,7 +51,7 @@ func NewLibrary(
workspaces workspace.WorkspaceList,
execs executable.ExecutableList,
filter Filter,
theme styles.Theme,
theme themes.Theme,
runFunc func(string) error,
) *Library {
p1 := viewport.New(0, 0)
Expand All @@ -78,7 +78,7 @@ func NewLibraryView(
workspaces workspace.WorkspaceList,
execs executable.ExecutableList,
filter Filter,
theme styles.Theme,
theme themes.Theme,
runFunc func(string) error,
) tuikit.View {
l := NewLibrary(ctx, workspaces, execs, filter, theme, runFunc)
Expand Down
26 changes: 13 additions & 13 deletions internal/io/library/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,51 @@ import (
"strings"

"github.com/charmbracelet/lipgloss"
"github.com/jahvon/tuikit/styles"
"github.com/jahvon/tuikit/themes"
"github.com/mattn/go-runewidth"

"github.com/jahvon/flow/types/executable"
)

func renderSelection(s string, theme styles.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.PrimaryColor)
func renderSelection(s string, theme themes.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().PrimaryColor())
return style.Render(s)
}

func renderSecondarySelection(s string, theme styles.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.TertiaryColor)
func renderSecondarySelection(s string, theme themes.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().SecondaryColor())
return style.Render(s)
}

func renderInactive(s string, theme styles.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.Gray)
func renderInactive(s string, theme themes.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().GrayColor())
return style.Render(s)
}

func renderDescription(s string, theme styles.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.BodyColor)
func renderDescription(s string, theme themes.Theme) string {
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().BodyColor())
return style.Render(s)
}

func renderPaneTitle(s string, count int, active bool, theme styles.Theme) string {
func renderPaneTitle(s string, count int, active bool, theme themes.Theme) string {
var title string
if count == 0 {
title = s
} else {
title = fmt.Sprintf("%s (%d)", s, count)
}
style := lipgloss.NewStyle().Foreground(theme.SecondaryColor).Padding(0, 1).Bold(true)
style := lipgloss.NewStyle().Foreground(theme.ColorPalette().SecondaryColor()).Padding(0, 1).Bold(true)
if active {
style = style.Underline(true)
}
return style.Render(title) + "\n\n"
}

func paneStyle(pos int, theme styles.Theme, splitView bool) lipgloss.Style {
func paneStyle(pos int, theme themes.Theme, splitView bool) lipgloss.Style {
style := lipgloss.NewStyle().Padding(0, 1)
if pos == 2 && splitView {
style = style.BorderStyle(lipgloss.OuterHalfBlockBorder()).
BorderForeground(theme.BorderColor).BorderLeft(true)
BorderForeground(theme.ColorPalette().BorderColor()).BorderLeft(true)
}

return style
Expand Down
Loading
Loading