@@ -140,99 +140,101 @@ struct BotMessage: View {
140140 }
141141
142142 var body : some View {
143- HStack {
144- VStack ( alignment: . leading, spacing: 8 ) {
145- if !references. isEmpty {
146- WithPerceptionTracking {
147- ReferenceButton (
148- references: references,
149- chat: chat,
150- isReferencesPresented: $isReferencesPresented
151- )
143+ WithPerceptionTracking {
144+ HStack {
145+ VStack ( alignment: . leading, spacing: 8 ) {
146+ if !references. isEmpty {
147+ WithPerceptionTracking {
148+ ReferenceButton (
149+ references: references,
150+ chat: chat,
151+ isReferencesPresented: $isReferencesPresented
152+ )
153+ }
152154 }
153- }
154-
155- // progress step
156- if steps. count > 0 {
157- ProgressStep ( steps: steps)
155+
156+ // progress step
157+ if steps. count > 0 {
158+ ProgressStep ( steps: steps)
158159
159- }
160-
161- if !panelMessages. isEmpty {
162- WithPerceptionTracking {
163- ForEach ( panelMessages. indices, id: \. self) { index in
164- FunctionMessage ( text: panelMessages [ index] . message, chat: chat)
160+ }
161+
162+ if !panelMessages. isEmpty {
163+ WithPerceptionTracking {
164+ ForEach ( panelMessages. indices, id: \. self) { index in
165+ FunctionMessage ( text: panelMessages [ index] . message, chat: chat)
166+ }
165167 }
166168 }
167- }
168-
169- if editAgentRounds. count > 0 {
170- ProgressAgentRound ( rounds: editAgentRounds, chat: chat)
171- }
172-
173- if !text. isEmpty {
174- Group {
175- ThemedMarkdownText ( text: text, chat: chat)
169+
170+ if editAgentRounds. count > 0 {
171+ ProgressAgentRound ( rounds: editAgentRounds, chat: chat)
176172 }
177- . scaledPadding ( . leading, 2 )
178- . scaledPadding ( . vertical, 4 )
179- }
180-
181- if let codeReviewRound = codeReviewRound {
182- CodeReviewMainView (
183- store: chat, round: codeReviewRound
184- )
185- . frame ( maxWidth: . infinity)
186- }
187-
188- if !errorMessages. isEmpty {
189- VStack ( spacing: 4 ) {
190- ForEach ( errorMessages. indices, id: \. self) { index in
191- if let attributedString = try ? AttributedString ( markdown: errorMessages [ index] ) {
192- NotificationBanner ( style: . warning) {
193- Text ( attributedString)
173+
174+ if !text. isEmpty {
175+ Group {
176+ ThemedMarkdownText ( text: text, chat: chat)
177+ }
178+ . scaledPadding ( . leading, 2 )
179+ . scaledPadding ( . vertical, 4 )
180+ }
181+
182+ if let codeReviewRound = codeReviewRound {
183+ CodeReviewMainView (
184+ store: chat, round: codeReviewRound
185+ )
186+ . frame ( maxWidth: . infinity)
187+ }
188+
189+ if !errorMessages. isEmpty {
190+ VStack ( spacing: 4 ) {
191+ ForEach ( errorMessages. indices, id: \. self) { index in
192+ if let attributedString = try ? AttributedString ( markdown: errorMessages [ index] ) {
193+ NotificationBanner ( style: . warning) {
194+ Text ( attributedString)
195+ }
194196 }
195197 }
196198 }
199+ . scaledPadding ( . vertical, 4 )
200+ }
201+
202+ HStack {
203+ if shouldShowTurnStatus ( ) {
204+ TurnStatusView ( message: message)
205+ }
206+
207+ Spacer ( )
208+
209+ ResponseToolBar ( id: id, chat: chat, text: text)
210+ . conditionalFontWeight ( . medium)
211+ . opacity ( shouldShowToolBar ( ) ? 1 : 0 )
212+ . scaledPadding ( . trailing, - 20 )
197213 }
198- . scaledPadding ( . vertical, 4 )
199214 }
200-
201- HStack {
202- if shouldShowTurnStatus ( ) {
203- TurnStatusView ( message: message)
215+ . shadow ( color: . black. opacity ( 0.05 ) , radius: 6 )
216+ . contextMenu {
217+ Button ( " Copy " ) {
218+ NSPasteboard . general. clearContents ( )
219+ NSPasteboard . general. setString ( text, forType: . string)
204220 }
221+ . scaledFont ( . body)
205222
206- Spacer ( )
223+ Button ( " Set as Extra System Prompt " ) {
224+ chat. send ( . setAsExtraPromptButtonTapped( id) )
225+ }
226+ . scaledFont ( . body)
207227
208- ResponseToolBar ( id: id, chat: chat, text: text)
209- . conditionalFontWeight ( . medium)
210- . opacity ( shouldShowToolBar ( ) ? 1 : 0 )
211- . scaledPadding ( . trailing, - 20 )
212- }
213- }
214- . shadow ( color: . black. opacity ( 0.05 ) , radius: 6 )
215- . contextMenu {
216- Button ( " Copy " ) {
217- NSPasteboard . general. clearContents ( )
218- NSPasteboard . general. setString ( text, forType: . string)
219- }
220- . scaledFont ( . body)
221-
222- Button ( " Set as Extra System Prompt " ) {
223- chat. send ( . setAsExtraPromptButtonTapped( id) )
228+ Divider ( )
229+
230+ Button ( " Delete " ) {
231+ chat. send ( . deleteMessageButtonTapped( id) )
232+ }
233+ . scaledFont ( . body)
224234 }
225- . scaledFont ( . body)
226-
227- Divider ( )
228-
229- Button ( " Delete " ) {
230- chat. send ( . deleteMessageButtonTapped( id) )
235+ . onHover {
236+ isHovering = $0
231237 }
232- . scaledFont ( . body)
233- }
234- . onHover {
235- isHovering = $0
236238 }
237239 }
238240 }
0 commit comments