New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a shortcut to go to the last run or current running cell #7551
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good, but two minor points to consider.
packages/notebook/src/actions.tsx
Outdated
if ( | ||
execution && | ||
typeof execution === 'object' && | ||
'iopub.status.busy' in execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Could these two lines be replaced by execution['iopub.status.busy'] !== undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done. I will note that I had to cast it to a JSONObject before which is slightly less safe. If execution was set to 3
this will now throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I think that using @phosphor/coreutils/JSONExt.isObject()
will likely be the most robust method here (both in JS and for typings).
For reference, typeof null === 'object'
😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note: I'm not implying that the previous code was wrong, just that typeof X === 'object'
is so counter-intuitive most of the time that I've made it a rule of thumb to simply avoid it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this anyway. Sadly, isObject fails to return a falsy value with JSONExt.isObject(undefined)
@vidartf all issues have been addressed |
14960d9
to
aabb6af
Compare
@mlucool I added another comment above. Kind of nit-picky, so feel free to ignore. Will merge once I've had a look at the CI failures. |
The Integrity CI is failing cuz of a failed lint check:
@mlucool Did you disable the normal jlab lint-on-commit/push git hooks? I know they give some devs trouble. In any case, you can prob fix the issue by doing what the error says and running:
in your repo before commiting/pushing again. |
Code changes
Add a new action and shortcut. By default this shortcut has no hotkeys. I have found that
Alt L
was the best available option.User-facing changes
User can add a new hotkey in the settings editor to enable this. The notebook must have execution time toggled on.