@@ -90,6 +90,9 @@ export const BranchItem = ({
9090 ? `${ statusLabel } ${ statusIndicator } `
9191 : `${ statusIndicator } ${ statusLabel } `
9292 : null
93+ const showCollapsedPreview =
94+ ( isStreaming && ! ! streamingPreview ) ||
95+ ( ! isStreaming && ! ! finishedPreview )
9396
9497 const isTextRenderable = ( value : ReactNode ) : boolean => {
9598 if ( value === null || value === undefined || typeof value === 'boolean' ) {
@@ -188,6 +191,7 @@ export const BranchItem = ({
188191 flexShrink : 0 ,
189192 marginTop : 1 ,
190193 marginBottom : 0 ,
194+ paddingBottom : 0 ,
191195 width : '100%' ,
192196 } }
193197 >
@@ -211,8 +215,8 @@ export const BranchItem = ({
211215 style = { {
212216 flexDirection : 'column' ,
213217 gap : 0 ,
214- paddingLeft : 1 ,
215- paddingRight : 1 ,
218+ paddingLeft : 0 ,
219+ paddingRight : 0 ,
216220 paddingTop : 0 ,
217221 paddingBottom : 0 ,
218222 width : '100%' ,
@@ -235,7 +239,7 @@ export const BranchItem = ({
235239 paddingLeft : 1 ,
236240 paddingRight : 1 ,
237241 paddingTop : 0 ,
238- paddingBottom : 0 ,
242+ paddingBottom : isCollapsed && ! showCollapsedPreview ? 0 : 1 ,
239243 width : '100%' ,
240244 } }
241245 onMouseDown = { onToggle }
@@ -262,13 +266,13 @@ export const BranchItem = ({
262266 </ box >
263267
264268 { isCollapsed ? (
265- ( isStreaming && streamingPreview ) || ( ! isStreaming && finishedPreview ) ? (
269+ showCollapsedPreview ? (
266270 < box
267271 style = { {
268- paddingLeft : 1 ,
269- paddingRight : 1 ,
272+ paddingLeft : 0 ,
273+ paddingRight : 0 ,
270274 paddingTop : 0 ,
271- paddingBottom : 1 ,
275+ paddingBottom : 1 ,
272276 } }
273277 >
274278 < text
@@ -286,9 +290,9 @@ export const BranchItem = ({
286290 < box
287291 style = { {
288292 flexDirection : 'column' ,
289- gap : 1 ,
290- paddingLeft : 1 ,
291- paddingRight : 1 ,
293+ gap : 0 ,
294+ paddingLeft : 0 ,
295+ paddingRight : 0 ,
292296 paddingTop : 0 ,
293297 paddingBottom : 0 ,
294298 } }
@@ -301,7 +305,9 @@ export const BranchItem = ({
301305 marginBottom : content ? 1 : 0 ,
302306 } }
303307 >
304- < text { ...( headerFg ? { fg : headerFg } : undefined ) } > Prompt</ text >
308+ < text { ...( headerFg ? { fg : headerFg } : undefined ) } >
309+ Prompt
310+ </ text >
305311 < text
306312 fg = { resolveFg ( theme . agentText ) }
307313 style = { { wrapMode : 'word' } }
@@ -320,18 +326,26 @@ export const BranchItem = ({
320326 </ box >
321327 ) }
322328 { renderExpandedContent ( content ) }
323- < box style = { { alignSelf : 'flex-end' , marginTop : content ? 0 : 1 } } >
329+ < box
330+ style = { {
331+ alignSelf : 'flex-end' ,
332+ marginTop : content ? 0 : 1 ,
333+ paddingRight : 1 ,
334+ paddingBottom : 0 ,
335+ marginBottom : 0 ,
336+ } }
337+ >
324338 < RaisedPill
325339 segments = { [ { text : 'Collapse' , fg : collapseButtonText } ] }
326340 frameColor = { collapseButtonFrame }
327341 textColor = { collapseButtonText }
328- padding = { 0 }
329342 onPress = { onToggle }
330343 />
331344 </ box >
332345 </ box >
333346 ) }
334347 </ box >
348+ { ! isCollapsed ? < box style = { { height : 1 } } /> : null }
335349 </ box >
336350 )
337351}
0 commit comments