mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
refactor(ui): use herald Tip alert for user messages
Update RenderUserMessage to use r.ty.Tip() for consistent herald-based styling with green/success color indicator.
This commit is contained in:
@@ -169,20 +169,13 @@ func (r *MessageRenderer) SetWidth(width int) {
|
||||
r.width = width
|
||||
}
|
||||
|
||||
// RenderUserMessage renders a user's input message with "You" label
|
||||
// RenderUserMessage renders a user's input message using herald Tip alert
|
||||
func (r *MessageRenderer) RenderUserMessage(content string, timestamp time.Time) UIMessage {
|
||||
if strings.TrimSpace(content) == "" {
|
||||
content = "(empty message)"
|
||||
}
|
||||
|
||||
// Use custom styled block with "You" label instead of ty.Note()
|
||||
theme := GetTheme()
|
||||
labelStyle := lipgloss.NewStyle().Foreground(theme.Primary).Bold(true)
|
||||
contentStyle := lipgloss.NewStyle().Foreground(theme.Text)
|
||||
|
||||
label := labelStyle.Render("You")
|
||||
body := contentStyle.Render(content)
|
||||
rendered := label + "\n" + body
|
||||
rendered := r.ty.Tip(content)
|
||||
rendered = lipgloss.NewStyle().MarginBottom(1).Render(rendered)
|
||||
|
||||
return UIMessage{
|
||||
|
||||
Reference in New Issue
Block a user