Skip to content

Commit ee69e28

Browse files
authored
Notebook chat editing enhancements. (microsoft#205799)
* Notebook chat editing enhancements. * hide cell chat actions from f1.
1 parent a7002f6 commit ee69e28

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ registerAction2(class extends NotebookAction {
382382
}
383383
]
384384
},
385+
f1: false,
385386
menu: [
386387
{
387388
id: MenuId.NotebookCellBetween,
@@ -454,6 +455,7 @@ registerAction2(class extends NotebookAction {
454455
original: '$(sparkle) Generate',
455456
},
456457
tooltip: localize('notebookActions.menu.insertCodeCellWithChat.tooltip', "Generate Code Cell with Chat"),
458+
f1: false,
457459
menu: [
458460
{
459461
id: MenuId.NotebookCellListTop,

src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export class NotebookChatController extends Disposable implements INotebookEdito
369369
const cellTop = this._notebookEditor.getAbsoluteTopOfElement(previousCell);
370370
const cellHeight = this._notebookEditor.getHeightOfElement(previousCell);
371371

372-
this._notebookEditor.revealOffsetInCenterIfOutsideViewport(cellTop + cellHeight);
372+
this._notebookEditor.revealOffsetInCenterIfOutsideViewport(cellTop + cellHeight + 48 /** center of the dialog */);
373373
}
374374
}
375375
}
@@ -412,6 +412,12 @@ export class NotebookChatController extends Disposable implements INotebookEdito
412412
return;
413413
}
414414

415+
if (this._widget.editingCell && this._widget.editingCell.textBuffer.getLength() > 0) {
416+
// it already contains some text, clear it
417+
const ref = await this._widget.editingCell.resolveTextModel();
418+
ref.setValue('');
419+
}
420+
415421
const editingCellIndex = this._widget.editingCell ? this._notebookEditor.getCellIndex(this._widget.editingCell) : undefined;
416422
if (editingCellIndex !== undefined) {
417423
this._notebookEditor.setSelections([{

0 commit comments

Comments
 (0)