summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/components/dialog/session.go
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-04-28 08:46:09 -0500
committeradamdottv <[email protected]>2025-04-30 07:46:34 -0500
commit61b605e724eb4cc50ab831534fcdd18e031d68eb (patch)
treeb15b074a8fed1931e179a8d3df08d05b753c7aa3 /internal/tui/components/dialog/session.go
parent61d9dc95111d2645a49816f6d9d6cc1014be1a22 (diff)
downloadopencode-61b605e724eb4cc50ab831534fcdd18e031d68eb.tar.gz
opencode-61b605e724eb4cc50ab831534fcdd18e031d68eb.zip
feat: themes
Diffstat (limited to 'internal/tui/components/dialog/session.go')
-rw-r--r--internal/tui/components/dialog/session.go32
1 files changed, 18 insertions, 14 deletions
diff --git a/internal/tui/components/dialog/session.go b/internal/tui/components/dialog/session.go
index 90a07358f..a29fa7131 100644
--- a/internal/tui/components/dialog/session.go
+++ b/internal/tui/components/dialog/session.go
@@ -7,6 +7,7 @@ import (
"github.com/opencode-ai/opencode/internal/session"
"github.com/opencode-ai/opencode/internal/tui/layout"
"github.com/opencode-ai/opencode/internal/tui/styles"
+ "github.com/opencode-ai/opencode/internal/tui/theme"
"github.com/opencode-ai/opencode/internal/tui/util"
)
@@ -105,11 +106,14 @@ func (s *sessionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
func (s *sessionDialogCmp) View() string {
+ t := theme.CurrentTheme()
+ baseStyle := styles.BaseStyle()
+
if len(s.sessions) == 0 {
- return styles.BaseStyle.Padding(1, 2).
+ return baseStyle.Padding(1, 2).
Border(lipgloss.RoundedBorder()).
- BorderBackground(styles.Background).
- BorderForeground(styles.ForgroundDim).
+ BorderBackground(t.Background()).
+ BorderForeground(t.TextMuted()).
Width(40).
Render("No sessions available")
}
@@ -146,20 +150,20 @@ func (s *sessionDialogCmp) View() string {
for i := startIdx; i < endIdx; i++ {
sess := s.sessions[i]
- itemStyle := styles.BaseStyle.Width(maxWidth)
+ itemStyle := baseStyle.Width(maxWidth)
if i == s.selectedIdx {
itemStyle = itemStyle.
- Background(styles.PrimaryColor).
- Foreground(styles.Background).
+ Background(t.Primary()).
+ Foreground(t.Background()).
Bold(true)
}
sessionItems = append(sessionItems, itemStyle.Padding(0, 1).Render(sess.Title))
}
- title := styles.BaseStyle.
- Foreground(styles.PrimaryColor).
+ title := baseStyle.
+ Foreground(t.Primary()).
Bold(true).
Width(maxWidth).
Padding(0, 1).
@@ -168,15 +172,15 @@ func (s *sessionDialogCmp) View() string {
content := lipgloss.JoinVertical(
lipgloss.Left,
title,
- styles.BaseStyle.Width(maxWidth).Render(""),
- styles.BaseStyle.Width(maxWidth).Render(lipgloss.JoinVertical(lipgloss.Left, sessionItems...)),
- styles.BaseStyle.Width(maxWidth).Render(""),
+ baseStyle.Width(maxWidth).Render(""),
+ baseStyle.Width(maxWidth).Render(lipgloss.JoinVertical(lipgloss.Left, sessionItems...)),
+ baseStyle.Width(maxWidth).Render(""),
)
- return styles.BaseStyle.Padding(1, 2).
+ return baseStyle.Padding(1, 2).
Border(lipgloss.RoundedBorder()).
- BorderBackground(styles.Background).
- BorderForeground(styles.ForgroundDim).
+ BorderBackground(t.Background()).
+ BorderForeground(t.TextMuted()).
Width(lipgloss.Width(content) + 4).
Render(content)
}