summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/internal/components/commands
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-06-26 10:16:07 -0500
committerJay V <[email protected]>2025-06-26 17:21:53 -0400
commit2e26b58d160cc7cfc5c403cd63cbb30fad9fe8d0 (patch)
tree8adf56cd142dd6426bfa93aa8ed891d326f69231 /packages/tui/internal/components/commands
parent31b56e5a05313fea9232bea4c9e90db00a2d23e7 (diff)
downloadopencode-2e26b58d160cc7cfc5c403cd63cbb30fad9fe8d0.tar.gz
opencode-2e26b58d160cc7cfc5c403cd63cbb30fad9fe8d0.zip
feat: default system theme (#419)
Co-authored-by: adamdottv <[email protected]>
Diffstat (limited to 'packages/tui/internal/components/commands')
-rw-r--r--packages/tui/internal/components/commands/commands.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/packages/tui/internal/components/commands/commands.go b/packages/tui/internal/components/commands/commands.go
index 8031e5351..d7f334c35 100644
--- a/packages/tui/internal/components/commands/commands.go
+++ b/packages/tui/internal/components/commands/commands.go
@@ -60,15 +60,9 @@ func (c *commandsComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func (c *commandsComponent) View() string {
t := theme.CurrentTheme()
- triggerStyle := lipgloss.NewStyle().
- Foreground(t.Primary()).
- Bold(true)
-
- descriptionStyle := lipgloss.NewStyle().
- Foreground(t.Text())
-
- keybindStyle := lipgloss.NewStyle().
- Foreground(t.TextMuted())
+ triggerStyle := styles.NewStyle().Foreground(t.Primary()).Bold(true)
+ descriptionStyle := styles.NewStyle().Foreground(t.Text())
+ keybindStyle := styles.NewStyle().Foreground(t.TextMuted())
if c.background != nil {
triggerStyle = triggerStyle.Background(*c.background)
@@ -99,10 +93,11 @@ func (c *commandsComponent) View() string {
}
if len(commandsToShow) == 0 {
+ muted := styles.NewStyle().Foreground(theme.CurrentTheme().TextMuted())
if c.showAll {
- return styles.Muted().Render("No commands available")
+ return muted.Render("No commands available")
}
- return styles.Muted().Render("No commands with triggers available")
+ return muted.Render("No commands with triggers available")
}
// Calculate column widths
@@ -188,7 +183,7 @@ func (c *commandsComponent) View() string {
// Remove trailing newline
result := strings.TrimSuffix(output.String(), "\n")
if c.background != nil {
- result = lipgloss.NewStyle().Background(c.background).Width(maxWidth).Render(result)
+ result = styles.NewStyle().Background(*c.background).Width(maxWidth).Render(result)
}
return result