Closed alex-ketch closed 2 years ago
@alex-ketch Can you please,
ExecutableDocumentToolbar
to DocumentToolbar
throughoutstencila-execute-cancel
event with nodeId == null
and scope == All
stencila-kernel-space-restart
(or similarly named) eventstencila/stencila
repo hook up the cancel and restart events with documents.cancel
and documents.restart
and remove the temporary functions that I added for testing:
// Temporary functions for testing in the console
// @ts-ignore
window.stencilaExecute = async (
nodeId: null | string,
ordering: 'Single' | 'Appearance' | 'Topological'
) => {
const [client, document] = await startup()
await documents.execute(client, document.id, nodeId, ordering)
}
// @ts-ignore
window.stencilaCancel = async (
nodeId: null | string,
scope: 'Single' | 'All'
) => {
const [client, document] = await startup()
await documents.cancel(client, document.id, nodeId, scope)
}
// @ts-ignore
window.stencilaRestart = async () => {
const [client, document] = await startup()
await documents.restart(client, document.id)
}
ordering
option for execute
and the scope
option for cancel
to the UX for individual CodeChunk
and CodeExpression
nodes. In the short term having a key modifier e.g. Click == cancel, Shift+Click == cancel all might be better than nothing and exposes the alternatives. If we don't make progress on this at least having it parked in an issue in this repo would be useful.
This PR adds logic for emitting code execution and cancellation events.