diff options
| author | adamdotdevin <[email protected]> | 2025-08-11 10:50:00 -0500 |
|---|---|---|
| committer | adamdotdevin <[email protected]> | 2025-08-11 10:50:00 -0500 |
| commit | c78cb57c41c5ba29ba7097528bc5441167f874a5 (patch) | |
| tree | bf6b2089113706319545cbd8844df530f6f9e2a6 | |
| parent | eb15b2ba752dc67d90f0697423f5a9ef8af621ff (diff) | |
| download | opencode-c78cb57c41c5ba29ba7097528bc5441167f874a5.tar.gz opencode-c78cb57c41c5ba29ba7097528bc5441167f874a5.zip | |
fix: assistant message footer styles
| -rw-r--r-- | packages/tui/internal/components/chat/message.go | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go index b5579883f..9a85e89e1 100644 --- a/packages/tui/internal/components/chat/message.go +++ b/packages/tui/internal/components/chat/message.go @@ -335,6 +335,10 @@ func renderText( if time.Now().Format("02 Jan 2006") == timestamp[:11] { timestamp = timestamp[12:] } + timestamp = styles.NewStyle(). + Background(backgroundColor). + Foreground(t.TextMuted()). + Render(" (" + timestamp + ")") // Check if this is an assistant message with agent information var modelAndAgentSuffix string @@ -353,17 +357,23 @@ func renderText( // Style the agent name with the same color as status bar agentName := cases.Title(language.Und).String(assistantMsg.Mode) - styledAgentName := styles.NewStyle().Foreground(agentColor).Render(agentName) - modelAndAgentSuffix = fmt.Sprintf("%s %s", styledAgentName, assistantMsg.ModelID) + styledAgentName := styles.NewStyle(). + Background(backgroundColor). + Foreground(agentColor). + Render(agentName + " ") + styledModelID := styles.NewStyle(). + Background(backgroundColor). + Foreground(t.TextMuted()). + Render(assistantMsg.ModelID) + modelAndAgentSuffix = styledAgentName + styledModelID } var info string if modelAndAgentSuffix != "" { - info = fmt.Sprintf("%s (%s)", modelAndAgentSuffix, timestamp) + info = modelAndAgentSuffix + timestamp } else { - info = fmt.Sprintf("%s (%s)", author, timestamp) + info = author + timestamp } - info = styles.NewStyle().Foreground(t.TextMuted()).Render(info) if !showToolDetails && toolCalls != nil && len(toolCalls) > 0 { content = content + "\n\n" for _, toolCall := range toolCalls { @@ -378,10 +388,11 @@ func renderText( } } - sections := []string{content, info} + sections := []string{content} if extra != "" { - sections = append(sections, "\n"+extra) + sections = append(sections, "\n"+extra+"\n") } + sections = append(sections, info) content = strings.Join(sections, "\n") switch message.(type) { |
