File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -429,6 +429,9 @@ export class CodeConsole extends Widget {
429429 cell . model . setMetadata ( key , metadata [ key ] ) ;
430430 }
431431 this . addCell ( cell ) ;
432+ if ( this . _config . hideCodeInput ) {
433+ cell . inputArea ?. setHidden ( true ) ;
434+ }
432435 return this . _execute ( cell ) ;
433436 }
434437
Original file line number Diff line number Diff line change @@ -219,6 +219,25 @@ describe('console/widget', () => {
219219 await widget . inject ( code ) ;
220220 expect ( widget . cells . length ) . toBeGreaterThan ( 0 ) ;
221221 } ) ;
222+
223+ it ( 'should hide code input when hideCodeInput is true' , async ( ) => {
224+ Widget . attach ( widget , document . body ) ;
225+ await widget . sessionContext . initialize ( ) ;
226+
227+ // Set config to hide input
228+ widget . setConfig ( { hideCodeInput : true } ) ;
229+
230+ // Inject some code
231+ const testCode = 'print(1 + 1)' ;
232+ await widget . inject ( testCode ) ;
233+
234+ // Check the input is not visible in the executed cells
235+ for ( const cell of widget . cells ) {
236+ expect ( cell . inputArea ! . node . classList . contains ( 'lm-mod-hidden' ) ) . toBe (
237+ true
238+ ) ;
239+ }
240+ } ) ;
222241 } ) ;
223242
224243 describe ( '#insertLinebreak()' , ( ) => {
You can’t perform that action at this time.
0 commit comments