Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not shrink cell if still executing #195283

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2949,9 +2949,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
const cell = this.viewModel?.viewCells.find(vc => vc.handle === cellInfo.cellHandle);
if (cell && cell instanceof CodeCellViewModel) {
const outputIndex = cell.outputsViewModels.indexOf(output);
if (outputHeight !== 0) {
cell.updateOutputMinHeight(0);
}
this._debug('update cell output', cell.handle, outputHeight);
cell.updateOutputHeight(outputIndex, outputHeight, source);
this.layoutNotebookCell(cell, cell.layoutInfo.totalHeight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { CellContentPart } from 'vs/workbench/contrib/notebook/browser/view/cell
import { CodeCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
import { CellUri, IOrderedMimeType, NotebookCellOutputsSplice, RENDERER_NOT_AVAILABLE, isTextStreamMime } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { CellUri, IOrderedMimeType, NotebookCellExecutionState, NotebookCellOutputsSplice, RENDERER_NOT_AVAILABLE, isTextStreamMime } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { INotebookExecutionStateService } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService';
import { INotebookKernel } from 'vs/workbench/contrib/notebook/common/notebookKernelService';
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
Expand Down Expand Up @@ -590,12 +590,14 @@ export class CellOutputContainer extends CellContentPart {
clearTimeout(this._outputHeightTimer);
}

const executionState = this._notebookExecutionStateService.getCellExecution(this.viewCell.uri);

if (synchronous) {
this.viewCell.unlockOutputHeight();
} else {
} else if (executionState?.state !== NotebookCellExecutionState.Executing) {
this._outputHeightTimer = setTimeout(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that execution state is still Executing when we finish the output update (for example, the cell is executing but there is no more outputs). We need a listener on cell execution state change to ensure that we always unlock the output height at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.viewCell.unlockOutputHeight();
}, 1000);
}, 200);
}
}

Expand Down