summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/page
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-02 11:34:38 -0500
committerAdam <[email protected]>2025-05-02 15:24:47 -0500
commit49037e7b28b9f76e32cef99e81ba33e2832290a5 (patch)
tree60f5cc8c08f9c405f91420698057cf7a79cf2894 /internal/tui/page
parentc66832d2992205ad226d7e3f50ee7676f3519724 (diff)
downloadopencode-49037e7b28b9f76e32cef99e81ba33e2832290a5.tar.gz
opencode-49037e7b28b9f76e32cef99e81ba33e2832290a5.zip
feat: better logs page
Diffstat (limited to 'internal/tui/page')
-rw-r--r--internal/tui/page/logs.go32
1 files changed, 23 insertions, 9 deletions
diff --git a/internal/tui/page/logs.go b/internal/tui/page/logs.go
index 9bd545287..c3de8684d 100644
--- a/internal/tui/page/logs.go
+++ b/internal/tui/page/logs.go
@@ -7,6 +7,7 @@ import (
"github.com/opencode-ai/opencode/internal/tui/components/logs"
"github.com/opencode-ai/opencode/internal/tui/layout"
"github.com/opencode-ai/opencode/internal/tui/styles"
+ "github.com/opencode-ai/opencode/internal/tui/theme"
)
var LogsPage PageID = "logs"
@@ -42,11 +43,24 @@ func (p *logsPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
func (p *logsPage) View() string {
- style := styles.BaseStyle().Width(p.width).Height(p.height)
- return style.Render(lipgloss.JoinVertical(lipgloss.Top,
- p.table.View(),
- p.details.View(),
- ))
+ t := theme.CurrentTheme()
+
+ // Add padding to the right of the table view
+ tableView := lipgloss.NewStyle().PaddingRight(3).Render(p.table.View())
+
+ return styles.ForceReplaceBackgroundWithLipgloss(
+ lipgloss.JoinVertical(
+ lipgloss.Left,
+ styles.Bold().Render(" esc")+styles.Muted().Render(" to go back"),
+ "",
+ lipgloss.JoinHorizontal(lipgloss.Top,
+ tableView,
+ p.details.View(),
+ ),
+ "",
+ ),
+ t.Background(),
+ )
}
func (p *logsPage) BindingKeys() []key.Binding {
@@ -63,8 +77,8 @@ func (p *logsPage) SetSize(width int, height int) tea.Cmd {
p.width = width
p.height = height
return tea.Batch(
- p.table.SetSize(width, height/2),
- p.details.SetSize(width, height/2),
+ p.table.SetSize(width/2, height-3),
+ p.details.SetSize(width/2, height-3),
)
}
@@ -77,7 +91,7 @@ func (p *logsPage) Init() tea.Cmd {
func NewLogsPage() LogPage {
return &logsPage{
- table: layout.NewContainer(logs.NewLogsTable(), layout.WithBorderAll()),
- details: layout.NewContainer(logs.NewLogsDetails(), layout.WithBorderAll()),
+ table: layout.NewContainer(logs.NewLogsTable()),
+ details: layout.NewContainer(logs.NewLogsDetails()),
}
}