@@ -193,17 +193,19 @@ func (m *messageCmp) renderAssistantMessage() string {
193193 return m.style().Render(joined)
194194}
195195
196−// renderUserMessage renders user messages with file attachments.
197−// Displays message content and any attached files with appropriate icons.
196+// renderUserMessage renders user messages with file attachments. It displays
197+// message content and any attached files with appropriate icons.
198198func (m *messageCmp) renderUserMessage() string {
199199 t := styles.CurrentTheme()
200200 parts := []string{
201201 m.toMarkdown(m.message.Content().String()),
202202 }
203+
203204 attachmentStyles := t.S().Text.
204205 MarginLeft(1).
205206 Background(t.BgSubtle)
206− attachments := []string{}
207+
208+ attachments := make([]string, len(m.message.BinaryContent()))
207209 for _, attachment := range m.message.BinaryContent() {
208210 file := filepath.Base(attachment.Path)
209211 var filename string
@@ -214,9 +216,11 @@ func (m *messageCmp) renderUserMessage() string {
214216 }
215217 attachments = append(attachments, attachmentStyles.Render(filename))
216218 }
219+
217220 if len(attachments) > 0 {
218221 parts = append(parts, "", strings.Join(attachments, ""))
219222 }
223+
220224 joined := lipgloss.JoinVertical(lipgloss.Left, parts...)
221225 return m.style().Render(joined)
222226}