@@ -141,18 +141,18 @@ export const chat = (
141141 const renderMessage = ( message : ChatMessage ) : string [ ] => {
142142 const renderedContent = markdown ( {
143143 content : message . content ,
144- paddingX : 1 ,
144+ paddingX : 0 ,
145145 paddingY : 0 ,
146146 } ) ;
147147
148148 if ( message . role === 'You' ) {
149- const box = new Box ( 1 , 1 , ( text ) => pc . bgBlack ( text ) ) ;
149+ const box = new Box ( 2 , 1 , ( text ) => pc . bgBlack ( text ) ) ;
150150 box . addChild ( renderedContent ) ;
151151 return box . render ( width ) ;
152152 }
153153
154154 if ( message . role === 'Greg' ) {
155- const box = new Box ( 1 , 1 , ( text ) => text ) ;
155+ const box = new Box ( 2 , 1 , ( text ) => text ) ;
156156 box . addChild ( renderedContent ) ;
157157 return box . render ( width ) ;
158158 }
@@ -161,12 +161,12 @@ export const chat = (
161161 if ( ! showToolMessages ) {
162162 return [ ] ;
163163 }
164- const box = new Box ( 1 , 0 , ( text ) => pc . dim ( text ) ) ;
164+ const box = new Box ( 2 , 1 , ( text ) => pc . dim ( text ) ) ;
165165 box . addChild ( renderedContent ) ;
166166 return box . render ( width ) ;
167167 }
168168
169- const box = new Box ( 1 , 0 , ( text ) => text ) ;
169+ const box = new Box ( 2 , 1 , ( text ) => text ) ;
170170 box . addChild ( new Text ( pc . dim ( `System: ${ message . content } ` ) ) ) ;
171171 return box . render ( width ) ;
172172 } ;
@@ -177,7 +177,12 @@ export const chat = (
177177 renderedLines . push ( ...renderMessage ( message ) ) ;
178178 }
179179
180- if ( showSpinner ) renderedLines . push ( ...loader . render ( width ) ) ;
180+ const lastIsYou = messages [ messages . length - 1 ] ?. role === 'You' ;
181+
182+ if ( showSpinner ) {
183+ if ( lastIsYou ) renderedLines . push ( '' ) ;
184+ renderedLines . push ( ` ${ loader . render ( width - 1 ) [ 1 ] } ` ) ;
185+ }
181186 return [ ...renderedLines , ...editor . render ( width ) ] ;
182187 } ,
183188 handleInput : ( input ) => {
0 commit comments