Skip to content

Commit eebf235

Browse files
authored
Merge pull request microsoft#183124 from microsoft/aiday/interactiveEditorIssue4164
Fixing the incorrect pointing of the collapse/expand arrows
2 parents 5d9a937 + e3074e4 commit eebf235

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorController.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ export class InteractiveEditorController implements IEditorContribution {
526526
this._zone.widget.updateStatus('');
527527
this._zone.widget.updateMarkdownMessage(renderedMarkdown.element);
528528
this._zone.widget.updateToolbar(true);
529+
this._zone.widget.updateMarkdownMessageExpansionState(this._activeSession.lastExpansionState);
529530

530531
} else if (response instanceof EditResponse) {
531532
// edit response -> complex...
@@ -625,7 +626,10 @@ export class InteractiveEditorController implements IEditorContribution {
625626
}
626627

627628
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+
}
629633
}
630634

631635
feedbackLast(helpful: boolean) {

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorSession.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type TelemetryDataClassification = {
5959
export class Session {
6060

6161
private _lastInput: string | undefined;
62+
private _lastExpansionState: boolean | undefined;
6263
private _lastTextModelChanges: LineRangeMapping[] | undefined;
6364
private _lastSnapshot: ITextSnapshot | undefined;
6465
private readonly _exchange: SessionExchange[] = [];
@@ -92,6 +93,14 @@ export class Session {
9293
return this._lastInput;
9394
}
9495

96+
get lastExpansionState() {
97+
return this._lastExpansionState ?? false;
98+
}
99+
100+
set lastExpansionState(state: boolean) {
101+
this._lastExpansionState = state;
102+
}
103+
95104
get lastSnapshot(): ITextSnapshot | undefined {
96105
return this._lastSnapshot;
97106
}

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export class InteractiveEditorWidget {
444444
this._inputEditor.focus();
445445
}
446446

447-
updateToggleState(expand: boolean) {
447+
updateMarkdownMessageExpansionState(expand: boolean) {
448448
this._ctxMessageCropState.set(expand ? 'expanded' : 'cropped');
449449
this._elements.message.style.webkitLineClamp = expand ? '10' : '3';
450450
this._onDidChangeHeight.fire();

0 commit comments

Comments
 (0)