 	
 	@discardableResult
 	private func loadPreviewIfNecessary() -> Bool {
-		guard !initialCodeLoaded, let fileId = context.value?.currentDocument.value?.file.fileId else { return false }
+		guard !initialCodeLoaded, let fileId = editorContext.value?.currentDocument.value?.file.fileId else { return false }
 		// TODO: update this to use appStatus
 		guard !initialCodeLoaded else { return true }
 		initialCodeLoaded = true

	}

	private func requestUpdate(previewId: Int, chunkId: Int, includePrevious: Bool = false) -> SignalProducer<Void, Rc2Error> {
		guard var preview = previewData[previewId] else {
			let rerr = Rc2Error(type: .application, nested: PrecviewError.failedToUpdate, severity: .warning)
			Log.info("Failed to find preview \(previewId)", .app)
			return SignalProducer<Void, Rc2Error>(error: rerr)
		}
		let handler = SignalProducer<Void, Rc2Error> { [weak self] observer, _ in
			guard let me = self else { return }
			preview.updateObserver = observer
			// chunkIds will include previous
			let producer = me.session.updatePreviewChunks(previewId: previewId, chunkId: chunkId, includePrevious: includePrevious, updateId: "preview \(previewId)")
			producer.startWithCompleted {
				preview.updateObserver = nil
			}
			
		}

	// required by OutputController, should use at some point
	weak var contextualMenuDelegate: ContextualMenuDelegate?

	private var editorContext: MutableProperty<EditorContext?> = MutableProperty<EditorContext?>(nil)
	private var curDocDisposable: Disposable?
	private var didLoadView = false
	private var pageShellLoaded = false
