feat(notebook): reload, journal and state panel polish
D3 (partial): reload re-parses the document while preserving kernels, marks changed cells dirty; Journal and Reload view actions; filtered Node variable names for the state panel; per-session timeout parsing before spawn.
This commit is contained in:
1 parent
3001ed7ba5
commit
9873df7099
6 files changed
+131
-6
No files matched your search
@@ -75,7 +75,30 @@ pub fn api_open(root: &Path, body: &str) -> serde_json::Value {
|
||||
};
|
||||
match get_or_open(root, &abs) {
|
||||
Ok(s) => match s.lock() {
|
||||
Ok(sess) => ok_session(&sess, serde_json::json!({})),
|
||||
Ok(mut sess) => {
|
||||
if let Err(e) = sess.reload(root) {
|
||||
return err(e);
|
||||
}
|
||||
ok_session(&sess, serde_json::json!({}))
|
||||
}
|
||||
Err(_) => err("session lock poisoned".into()),
|
||||
},
|
||||
Err(e) => err(e),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn api_reload(root: &Path, body: &str) -> serde_json::Value {
|
||||
let v = body_value(body);
|
||||
let (_rel, abs) = match path_of(root, &v) {
|
||||
Ok(p) => p,
|
||||
Err(e) => return err(e),
|
||||
};
|
||||
match get_or_open(root, &abs) {
|
||||
Ok(s) => match s.lock() {
|
||||
Ok(mut sess) => match sess.reload(root) {
|
||||
Ok(()) => ok_session(&sess, serde_json::json!({})),
|
||||
Err(e) => err(e),
|
||||
},
|
||||
Err(_) => err("session lock poisoned".into()),
|
||||
},
|
||||
Err(e) => err(e),
|
||||
|
||||
Reference in new issue
Block a user