don't move inline chat zone into selection when changes aren't far away (#216809)

* return (?) of the info icon

* don't move inline chat zone into selection when changes aren't far away
This commit is contained in:
Johannes Rieken 2024-06-21 15:41:43 +02:00 committed by GitHub
parent ce7105088c
commit a2cab7255c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View file

@ -771,7 +771,19 @@ export class InlineChatController implements IEditorContribution {
// real response -> complex...
this._ui.value.zone.widget.updateStatus('');
newPosition = await this._strategy.renderChanges(response);
const position = await this._strategy.renderChanges(response);
if (position) {
// if the selection doesn't start far off we keep the widget at its current position
// because it makes reading this nicer
const selection = this._editor.getSelection();
if (selection?.containsPosition(position)) {
if (position.lineNumber - selection.startLineNumber > 8) {
newPosition = position;
}
} else {
newPosition = position;
}
}
}
this._showWidget(false, newPosition);

View file

@ -577,7 +577,7 @@ export class LiveStrategy extends EditModeStrategy {
message = localize('change.0', "Nothing changed.");
} else if (remaining === 1) {
message = needsReview
? localize('review.1', "Accept or Discard change")
? localize('review.1', "$(info) Accept or Discard change")
: localize('change.1', "1 change");
} else {
message = needsReview