Skip to content

Commit 825e389

Browse files
authored
dont reveal if a change is already visible (microsoft#250336)
1 parent 1e6e3fe commit 825e389

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,18 @@ class ChatEditingNotebookEditorWidgetIntegration extends Disposable implements I
174174
&& cellChanges.read(r).some(c => c.type !== 'unchanged' && !c.diff.read(r).identical)
175175
) {
176176
lastModifyingRequestId = _entry.lastModifyingRequestId;
177-
this.reveal(true);
177+
// Check if any of the changes are visible, if not, reveal the first change.
178+
const visibleChange = this.sortedCellChanges.find(c => {
179+
if (c.type === 'unchanged') {
180+
return false;
181+
}
182+
const index = c.modifiedCellIndex ?? c.originalCellIndex;
183+
return this.notebookEditor.visibleRanges.some(range => index >= range.start && index < range.end);
184+
});
185+
186+
if (!visibleChange) {
187+
this.reveal(true);
188+
}
178189
}
179190
}));
180191

0 commit comments

Comments
 (0)