These add a bunch of keyboard-centric new abilities. You can navigate cells with j & k, select cells with x, delete multiple cells at the same time with Option-Delete, move cells with Shift Up/Down, pin or unpin multiple cells with Ctrl-Shift-P, and more. All of the commands that work with one cell in this mode work with multiple cells, making it pretty nifty for bigger notebooks.
These commands are a bit like vimâs normal & visual modes, and a bit like Jupyterâs command mode.
This is awesome! One minor annoyance: the nav bar at the top of the editor that becomes âstickyâ when a notebook has to be reshared / republished can cover up the selected cell (it also frequently obscures the target cell when clicking on anchor links).
Another thing: the cell shortcuts stop working if the notebook iframe becomes focused, e.g. if you click the notebook and start pressing tab / shift+tab to go between links or input elements in the notebook. Maybe there isnât a good way to have Observableâs shortcuts work in this situation, but the âX cells selectedâ footer can get in the way of the focused elements when navigating with the keyboard like that. Perhaps it can be hidden when the main editor frame loses focus?
Neat, Iâm looking around to exploring these! The multi-cell actions are a great addition. It seems that moving a cell down with cmd+shift+down causes it to lose focus, so you canât move a cell down more than one step at a time, or edit it after moving it. Moving a cell up works: https://observablehq.com/d/561325582057ae64
Interesting, the unfocusing seems to happen for me only in Chrome. I can move down multiple steps with the keyboard shortcut (for me cmd+alt+down) in both Firefox and Safari.
Sorry for posting so many times in this thread, but I noticed another change which is bothering me. I used to be able to open an unpinned cell for editing and it would stay open temporarily when I pressed cmd+F to search on the page. Since this update, unpinned cells now immediately close when I try to search.
Another nitpick â hope you donât mind! â I noticed a few weeks ago that the scroll position tracks a cell as it is moved up and down. It would be great if this put the cell-in-motion in the center of the screen, rather than at the edge of the screen. That way gives you some context to know where itâs moved to. As is, the edge behavior prevents you from seeing whatâs directly above the cell.
And right now, another consequence of this is that the cell itself can disappear behind the header banner when youâre working in a shared notebook. (That banner also reduces the effective screen size, and I always unshare a notebook when doing serious editing because it makes it harder to work.)
Edit: I figured out another reason why the cell-following behavior was bothering me so â often I just want to move a cell out of the way, e.g. a definition like log10 = Math.log10. Iâm in the middle of something, so I type it in and then move the cell down⌠But now the whole viewport shifts, and I lose my thought. If there was something like a âsend to bottomâ shortcut, or a way to move a cell down without following itâŚ
Thanks for the feedback, folks! Weâve working on a fix to the focus management around J & K and Iâve swapped the accidentally-swapped J & K documentation.
Iâve noticed myself clicking on the output for a cell and then hitting âJâ to initiate a multiple selection that includes that cell, but right now this doesnât work. It seems to me that the only way to select a cell using cell shortcuts is to first click into a cell, then press Esc. Is there some other way to start off a selection?
(Use case: I scrolled to a part of my notebook with a bunch of old cells that I want to remove)
Edit: I just noticed that if you select a cell and then shift+J a bunch, the selection expands upwards but the scroll doesnât follow, so you canât tell which cells youâre selecting.
Edit 2: It seems the currently active cell is also implicitly part of the selection; I ran into a case where I selected a bunch of cells, then moved the bright blue outline to the cell below them (which I didnât want to delete), and then pressed Option+Backspace, which deleted all of the cells with the light blue outline but also the one with the dark blue (but not light blue) outline.
Edit 3: Aha, I see the difficulty with having the viewport follow the latest action â it might cause really large discontinuous jumps, if you e.g. start adding to both the top and bottom of the selection.
Are you sure that that problem is still around? We shipped a fix yesterday that should maintain the behavior where open cells stay open unless theyâre closed explicitly or by hitting Escape. Maybe try refreshing the page?
Ctrl-Shift-P opens an incognito window in Firefox and doesnât unpin/pin cells when Iâm in the Cell Select Mode. In Chrome it pins/unpins, but opens the print dialog also.
Weâre considering switching the pin shortcut to just âpâ and the delete shortcut to just âdâ when youâre in this mode, so that thereâs no chance of overlapping with Windows/macOS/Firefox/Chrome built-in keybindings, because there sure are a lot of them
It might be time that web apps took on the same approach that many desktop applications have been following for years: Make hotkeys configurable. Not only are key combinations a rare commodity, but often the easy ones are already blocked by browser extensions or system-wide utilities.
Of course thereâs the added complexity that a single user may access observable from a variety of systems and browsers (I know I do), so that configuration should probably be stored per browser (i.e. localStorage).
What is the difficulty with deletion? I am interested in understand the rationale for not implementing something like in Jupyter. Click the top cell, shift click the bottom cell, and type X or something like that. I am sure it was considered, but what are the issues? You have a very powerful system at your disposal. It seems that there should be powerful tools to let keyboard wizards operate efficiently on their cells.
Another thing Iâd like to do is copy/paste: select 10 cells near the bottom of my notebook, and paste them at the beginning. Again, that appers to be difficult.