File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
src/vs/workbench/contrib/interactiveEditor/browser Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,7 @@ export class InteractiveEditorController implements IEditorContribution {
526
526
this . _zone . widget . updateStatus ( '' ) ;
527
527
this . _zone . widget . updateMarkdownMessage ( renderedMarkdown . element ) ;
528
528
this . _zone . widget . updateToolbar ( true ) ;
529
+ this . _zone . widget . updateMarkdownMessageExpansionState ( this . _activeSession . lastExpansionState ) ;
529
530
530
531
} else if ( response instanceof EditResponse ) {
531
532
// edit response -> complex...
@@ -625,7 +626,10 @@ export class InteractiveEditorController implements IEditorContribution {
625
626
}
626
627
627
628
updateExpansionState ( expand : boolean ) {
628
- this . _zone . widget . updateToggleState ( expand ) ;
629
+ if ( this . _activeSession ) {
630
+ this . _zone . widget . updateMarkdownMessageExpansionState ( expand ) ;
631
+ this . _activeSession . lastExpansionState = expand ;
632
+ }
629
633
}
630
634
631
635
feedbackLast ( helpful : boolean ) {
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ type TelemetryDataClassification = {
59
59
export class Session {
60
60
61
61
private _lastInput : string | undefined ;
62
+ private _lastExpansionState : boolean | undefined ;
62
63
private _lastTextModelChanges : LineRangeMapping [ ] | undefined ;
63
64
private _lastSnapshot : ITextSnapshot | undefined ;
64
65
private readonly _exchange : SessionExchange [ ] = [ ] ;
@@ -92,6 +93,14 @@ export class Session {
92
93
return this . _lastInput ;
93
94
}
94
95
96
+ get lastExpansionState ( ) {
97
+ return this . _lastExpansionState ?? false ;
98
+ }
99
+
100
+ set lastExpansionState ( state : boolean ) {
101
+ this . _lastExpansionState = state ;
102
+ }
103
+
95
104
get lastSnapshot ( ) : ITextSnapshot | undefined {
96
105
return this . _lastSnapshot ;
97
106
}
Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ export class InteractiveEditorWidget {
444
444
this . _inputEditor . focus ( ) ;
445
445
}
446
446
447
- updateToggleState ( expand : boolean ) {
447
+ updateMarkdownMessageExpansionState ( expand : boolean ) {
448
448
this . _ctxMessageCropState . set ( expand ? 'expanded' : 'cropped' ) ;
449
449
this . _elements . message . style . webkitLineClamp = expand ? '10' : '3' ;
450
450
this . _onDidChangeHeight . fire ( ) ;
You can’t perform that action at this time.
0 commit comments