src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts/NotebookCellList/updateElementHeight2
class NotebookCellList:	updateElementHeight2(element: ICellViewModel, size: number): void {
		const index = this._getViewIndexUpperBound(element);
		if (index === undefined || index < 0 || index >= this.length) {
			return;
		}

		const focused = this.getFocus();
		if (!focused.length) {
			this.view.updateElementHeight(index, size, null);
			return;
		}

		const focus = focused[0];

		if (focus <= index) {
			this.view.updateElementHeight(index, size, focus);
			return;
		}

		// the `element` is in the viewport, it's very often that the height update is triggerred by user interaction (collapse, run cell)
		// then we should make sure that the `element`'s visual view position doesn't change.

		if (this.view.elementTop(index) > this.view.scrollTop) {
			this.view.updateElementHeight(index, size, index);
			return;
		}

		this.view.updateElementHeight(index, size, focus);
	}