Fix #3734 Notebook cells are shown empty some times even when there is content (#3878)

- Editor layout gets called sometimes when other events happen (and Notebook isn't visible)
- Add in a layout call on re-setting input so the cell is updated. This fixes the problem by laying out once the UI is visible again.

Note: long term, should really be destroying the UI (while preserving the model), then restoring it including scroll selection etc. and hooking back up to the model. That is... much more work, but something we'll need long term to avoid issues where we have many Notebooks open at once. Not in scope for this PR
This commit is contained in:
Kevin Cunnane
2019-02-01 10:11:45 -08:00
committed by GitHub
parent 9504ede1f3
commit 5132e62045
8 changed files with 43 additions and 11 deletions

View File

@@ -276,6 +276,11 @@ export interface INotebookModel {
*/
readonly kernelChanged: Event<nb.IKernelChangedArgs>;
/**
* Fired on notifications that notebook components should be re-laid out.
*/
readonly layoutChanged: Event<void>;
/**
* Event fired on first initialization of the kernels and
* on subsequent change events
@@ -443,6 +448,8 @@ export interface INotebookModelOptions {
standardKernels: IStandardKernelWithProvider[];
defaultKernel: nb.IKernelSpec;
layoutChanged: Event<void>;
notificationService: INotificationService;
connectionService: IConnectionManagementService;
capabilitiesService: ICapabilitiesService;