stencila/designa

CodeChunk: Use presence of session provider url for showing/hiding `Run` button

Opened this issue · 0 comments

Currently we check for presence of executeHandler function prop on the CodeChunk component to determine whether the code can be executed or not.

The executeHandler is usually attached on page load, currently by the <stencila-executable-toolbar> or the Web Client in the future.

Doing so after page load can lead to a needless re-render and incurs a performance penalty.
Instead we should explore using alternate indicators in the componentWillLoad lifecycle, and avoid a repaint.
We could use the presence of session provider url, or the stencilaWebClient being present in the global scope.