src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts/AbstractCellRenderer/addExpandListener
class AbstractCellRenderer:	protected addExpandListener(templateData: BaseCellRenderTemplate): void {
		templateData.disposables.add(DOM.addDisposableListener(templateData.expandButton, DOM.EventType.CLICK, () => {
			if (!templateData.currentRenderedCell) {
				return;
			}

			const textModel = this.notebookEditor.textModel!;
			const index = textModel.cells.indexOf(templateData.currentRenderedCell.model);

			if (index < 0) {
				return;
			}

			if (templateData.currentRenderedCell.metadata.inputCollapsed) {
				textModel.applyEdits([
					{ editType: CellEditType.Metadata, index, metadata: { ...templateData.currentRenderedCell.metadata, inputCollapsed: false } }
				], true, undefined, () => undefined, undefined);
			} else if (templateData.currentRenderedCell.metadata.outputCollapsed) {
				textModel.applyEdits([
					{ editType: CellEditType.Metadata, index, metadata: { ...templateData.currentRenderedCell.metadata, outputCollapsed: false } }
				], true, undefined, () => undefined, undefined);
			}
		}));
	}