summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-06-12 06:52:59 -0500
committeradamdottv <[email protected]>2025-06-12 16:00:25 -0500
commit75dd2f75aaf3b961738494480dab821e0e4dc23a (patch)
tree229f44cf1ea6b4092c176d2797ce8cf3d4dc8bd4
parentfe86e58bbb946d3d73d2b915000f1e0863ea36b1 (diff)
downloadopencode-75dd2f75aaf3b961738494480dab821e0e4dc23a.tar.gz
opencode-75dd2f75aaf3b961738494480dab821e0e4dc23a.zip
wip: refactoring tui
-rw-r--r--packages/tui/internal/components/dialog/session.go37
-rw-r--r--packages/tui/internal/layout/overlay.go2
2 files changed, 30 insertions, 9 deletions
diff --git a/packages/tui/internal/components/dialog/session.go b/packages/tui/internal/components/dialog/session.go
index c64043709..d47e086ed 100644
--- a/packages/tui/internal/components/dialog/session.go
+++ b/packages/tui/internal/components/dialog/session.go
@@ -33,12 +33,12 @@ func (s sessionItem) Render(selected bool, width int) string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle().
Width(width - 2).
- Background(t.Background())
+ Background(t.BackgroundElement())
if selected {
baseStyle = baseStyle.
Background(t.Primary()).
- Foreground(t.Background()).
+ Foreground(t.BackgroundElement()).
Bold(true)
} else {
baseStyle = baseStyle.
@@ -112,8 +112,9 @@ func (s *sessionDialogComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (s *sessionDialogComponent) View() string {
t := theme.CurrentTheme()
- baseStyle := styles.BaseStyle().Background(t.Background())
- width := layout.Current.Container.Width - 4
+ baseStyle := styles.BaseStyle().Background(t.BackgroundElement())
+ outerWidth := layout.Current.Container.Width - 8
+ width := outerWidth - 4
if len(s.sessions) == 0 {
return baseStyle.Padding(1, 2).
@@ -144,11 +145,29 @@ func (s *sessionDialogComponent) View() string {
// baseStyle.Width(width).Render(""),
)
- return baseStyle.Padding(1, 2).
- Border(lipgloss.RoundedBorder()).
- BorderBackground(t.Background()).
- BorderForeground(t.TextMuted()).
- Width(layout.Current.Container.Width).
+ style := styles.BaseStyle().
+ PaddingTop(1).
+ PaddingBottom(1).
+ PaddingLeft(2).
+ PaddingRight(2).
+ Background(t.BackgroundElement()).
+ Foreground(t.TextMuted()).
+ BorderStyle(lipgloss.ThickBorder())
+
+ style = style.
+ BorderLeft(true).
+ BorderRight(true).
+ // AlignHorizontal(align).
+ BorderLeftForeground(t.BackgroundSubtle()).
+ BorderLeftBackground(t.Background()).
+ BorderRightForeground(t.BackgroundSubtle()).
+ BorderRightBackground(t.Background())
+
+ return style.
+ // Border(lipgloss.ThickBorder()).
+ // BorderBackground(t.BackgroundElement()).
+ // BorderForeground(t.BorderSubtle()).
+ Width(outerWidth).
Render(content)
}
diff --git a/packages/tui/internal/layout/overlay.go b/packages/tui/internal/layout/overlay.go
index c2cd54b1a..a6dd6f40a 100644
--- a/packages/tui/internal/layout/overlay.go
+++ b/packages/tui/internal/layout/overlay.go
@@ -40,6 +40,8 @@ func PlaceOverlay(
bgHeight := len(bgLines)
fgHeight := len(fgLines)
+ shadow = false
+
if shadow {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()