summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/components
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-12 10:45:03 -0500
committeradamdottv <[email protected]>2025-05-12 10:45:03 -0500
commit8cbfc581b5243aece96d32fc97c72ada5df3ae54 (patch)
treef7a6c45d6ea3f767526e37f0104f020da9481ffe /internal/tui/components
parent4bb350a09ba5c88a830f4ab07fcc99b4febda0dc (diff)
downloadopencode-8cbfc581b5243aece96d32fc97c72ada5df3ae54.tar.gz
opencode-8cbfc581b5243aece96d32fc97c72ada5df3ae54.zip
chore: cleanup
Diffstat (limited to 'internal/tui/components')
-rw-r--r--internal/tui/components/dialog/arguments.go1
-rw-r--r--internal/tui/components/dialog/commands.go2
-rw-r--r--internal/tui/components/dialog/init.go2
-rw-r--r--internal/tui/components/dialog/permission.go18
-rw-r--r--internal/tui/components/dialog/quit.go2
-rw-r--r--internal/tui/components/logs/details.go2
6 files changed, 13 insertions, 14 deletions
diff --git a/internal/tui/components/dialog/arguments.go b/internal/tui/components/dialog/arguments.go
index 7c9e0f863..9dda94e8e 100644
--- a/internal/tui/components/dialog/arguments.go
+++ b/internal/tui/components/dialog/arguments.go
@@ -170,4 +170,3 @@ type ShowArgumentsDialogMsg struct {
CommandID string
Content string
}
-
diff --git a/internal/tui/components/dialog/commands.go b/internal/tui/components/dialog/commands.go
index c725f020c..3524dfd5e 100644
--- a/internal/tui/components/dialog/commands.go
+++ b/internal/tui/components/dialog/commands.go
@@ -115,7 +115,7 @@ func (c *commandDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (c *commandDialogCmp) View() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
if len(c.commands) == 0 {
return baseStyle.Padding(1, 2).
Border(lipgloss.RoundedBorder()).
diff --git a/internal/tui/components/dialog/init.go b/internal/tui/components/dialog/init.go
index 16fb070e6..55961b733 100644
--- a/internal/tui/components/dialog/init.go
+++ b/internal/tui/components/dialog/init.go
@@ -95,7 +95,7 @@ func (m InitDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (m InitDialogCmp) View() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
// Calculate width needed for content
maxWidth := 60 // Width for explanation text
diff --git a/internal/tui/components/dialog/permission.go b/internal/tui/components/dialog/permission.go
index c8c34a570..609719941 100644
--- a/internal/tui/components/dialog/permission.go
+++ b/internal/tui/components/dialog/permission.go
@@ -150,7 +150,7 @@ func (p *permissionDialogCmp) selectCurrentOption() tea.Cmd {
func (p *permissionDialogCmp) renderButtons() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
allowStyle := baseStyle
allowSessionStyle := baseStyle
denyStyle := baseStyle
@@ -196,7 +196,7 @@ func (p *permissionDialogCmp) renderButtons() string {
func (p *permissionDialogCmp) renderHeader() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
toolKey := baseStyle.Foreground(t.TextMuted()).Bold(true).Render("Tool")
toolValue := baseStyle.
Foreground(t.Text()).
@@ -242,13 +242,13 @@ func (p *permissionDialogCmp) renderHeader() string {
func (p *permissionDialogCmp) renderBashContent() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
if pr, ok := p.permission.Params.(tools.BashPermissionsParams); ok {
content := fmt.Sprintf("```bash\n%s\n```", pr.Command)
// Use the cache for markdown rendering
renderedContent := p.GetOrSetMarkdown(p.permission.ID, func() (string, error) {
- r := styles.GetMarkdownRenderer(p.width-10)
+ r := styles.GetMarkdownRenderer(p.width - 10)
s, err := r.Render(content)
return styles.ForceReplaceBackgroundWithLipgloss(s, t.Background()), err
})
@@ -302,13 +302,13 @@ func (p *permissionDialogCmp) renderWriteContent() string {
func (p *permissionDialogCmp) renderFetchContent() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
if pr, ok := p.permission.Params.(tools.FetchPermissionsParams); ok {
content := fmt.Sprintf("```bash\n%s\n```", pr.URL)
// Use the cache for markdown rendering
renderedContent := p.GetOrSetMarkdown(p.permission.ID, func() (string, error) {
- r := styles.GetMarkdownRenderer(p.width-10)
+ r := styles.GetMarkdownRenderer(p.width - 10)
s, err := r.Render(content)
return styles.ForceReplaceBackgroundWithLipgloss(s, t.Background()), err
})
@@ -325,12 +325,12 @@ func (p *permissionDialogCmp) renderFetchContent() string {
func (p *permissionDialogCmp) renderDefaultContent() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
content := p.permission.Description
// Use the cache for markdown rendering
renderedContent := p.GetOrSetMarkdown(p.permission.ID, func() (string, error) {
- r := styles.GetMarkdownRenderer(p.width-10)
+ r := styles.GetMarkdownRenderer(p.width - 10)
s, err := r.Render(content)
return styles.ForceReplaceBackgroundWithLipgloss(s, t.Background()), err
})
@@ -358,7 +358,7 @@ func (p *permissionDialogCmp) styleViewport() string {
func (p *permissionDialogCmp) render() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
title := baseStyle.
Bold(true).
Width(p.width - 4).
diff --git a/internal/tui/components/dialog/quit.go b/internal/tui/components/dialog/quit.go
index f755fa272..bf1090060 100644
--- a/internal/tui/components/dialog/quit.go
+++ b/internal/tui/components/dialog/quit.go
@@ -84,7 +84,7 @@ func (q *quitDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (q *quitDialogCmp) View() string {
t := theme.CurrentTheme()
baseStyle := styles.BaseStyle()
-
+
yesStyle := baseStyle
noStyle := baseStyle
spacerStyle := baseStyle.Background(t.Background())
diff --git a/internal/tui/components/logs/details.go b/internal/tui/components/logs/details.go
index da6edff13..3b712fe15 100644
--- a/internal/tui/components/logs/details.go
+++ b/internal/tui/components/logs/details.go
@@ -96,7 +96,7 @@ func (i *detailCmp) updateContent() {
valueStyle := lipgloss.NewStyle().Foreground(t.Text())
for key, value := range i.currentLog.Attributes {
- attrLine := fmt.Sprintf("%s: %s",
+ attrLine := fmt.Sprintf("%s: %s",
keyStyle.Render(key),
valueStyle.Render(value),
)