notebooks: refactor focus and key handling
requested to merge rn/notebooks-refactor-focus-and-key-handling into rn/notebook-file-block-query-input
Created by: novoselrok
This PR refactors the focus, selection, and keybindings for notebooks.
Summary:
- Instead of individual block handling keybindings, selection, and focus changes, it is now handled in the parent NotebookComponent
- We don't manually track if an input inside a block is focused, we rely on
document.activeElement
instead - For styling focused Monaco inputs we use CSS-only
:focus
and:focus-within
This is not the "React-way" of doing things, but the "React-way" was getting way to complex to be worth it. So I decided to go old-school with a parent component coordinating everything through events.
Test plan
- Manual testing with integration tests