forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tab trap notebook cells (jupyterlab#14115)
* WIP * tabFocusable * not sure what to do with this stuff * update keyboard shortcuts * remove data-lm-suppress-shortcuts * focus active cell when type changed * check for cell * fix onActivateRequest test * focus active cell when ready * some cleanup * use ready instead of attached * add commend about tabFocusable default being true * whitespace * comment on active cell tabindex 0 * check that descendant node has focus * ensureFocus active cell * remove console.logs * fix ctrl shift c * update comment * add shouldWait option to focusActiveCell() * lint * more lint * missed a spot: lint * consistent outline * box-shadow outline * box-shadow * Solve jupyterlab#1947 in a more specific way The keydown->ensureFocus code (jupyterlab#1958) was added to fix jupyterlab#1947. The idea was that any key event that bubbles up from within the notebook widget but causes the focus to move somewhere outside the notebook was something like when the user presses enter from within a Stdin widget, causing this widget, which had focus, to remove itself from the DOM, causing focus to get lost, meaning returned to the body node. But if we change the _ensureFocus method so that it ensures focus on the active cell rather than on the notebook as a whole it can lead to bugs like the one where the user presses tab while on the notebook footer, triggering the keydown->ensureFocus code, causing focus to go up the notebook, backwards (because all cells are above the footer), which makes it impossible to tab forward out of the notebook. Because you get into the following loop: cell -> ... -> footer (-> keydown->ensureFocus) -> cell -> ... -> footer -> * preventScroll * use brand-color for cell focus ring * use :read-write * remove schema * Remove no-longer needed traversable data attribute * Fix styling when multi-selection is active * Update Playwright Snapshots * Update Playwright Snapshots * Uses bubbling phase in keydown event in CI * Avoid triggering indentation in codemirror if completer is available * integrity * snapshots * moves the completer-enable class to the editor * Change the selector to select and delete all cells * Remove the linebreak shortcut in notebook console, since the linebreak is already handled by Enter * Remove ':focus:not(:read-write)' in selector, useless now the keydown is handled on bubbling * Remove duplicated shortcuts * Handles 'Enter' key when the completer is active * Set the focus to a child node instead of the Notebook node. * Handle the focus on Notbeook in windowed panel * Hide code cells with widget functions and CSS to avoid using checkVisibility(), and fix notebook actions tests * Do not attach/detach codecell when windowing, to avoid inconstitancy state * Restore actions sync * ui-test snapshots * Handle the expected failures in notebook actions tests * Do not allow setting the keyboard event mode in page config * Updates benchmark snapshots * Merge main in fix-tab-trap-notebook-cells, and fix conficts * Revert "Merge main in fix-tab-trap-notebook-cells, and fix conficts" This reverts commit b7f5d93. * Revert changes related to windowing (it is handle in main branch) * Remove visibility check on activeCell before focusing, since it should always be visible now * Wait for the cell to be ready before focusing * fix promises not awaited and update ui-test -> documentation -> general snapshot * Avoid focus looping in active cell --------- Co-authored-by: Michał Krassowski <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Nicolas Brichet <[email protected]>
- Loading branch information
1 parent
388fbcc
commit 4e8012e
Showing
69 changed files
with
468 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+21.1 KB
(150%)
...chmark/notebook.spec.ts-snapshots/large-code-notebook-ipynb-benchmark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+19 KB
(150%)
...enchmark/notebook.spec.ts-snapshots/large-md-notebook-ipynb-benchmark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+39 Bytes
(100%)
...entation/debugger.test.ts-snapshots/debugger-breakpoint-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+76 Bytes
(100%)
.../debugger.test.ts-snapshots/debugger-stop-on-breakpoint-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
...ger.test.ts-snapshots/debugger-stop-on-raised-exception-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
....test.ts-snapshots/debugger-stop-on-unhandled-exception-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+208 Bytes
(100%)
...mentation/general.test.ts-snapshots/file-formats-altair-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 KB
(130%)
...test/documentation/general.test.ts-snapshots/jupyterlab-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+63 Bytes
(100%)
.../general.test.ts-snapshots/notebook-heading-anchor-link-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+27.2 KB
(140%)
...documentation/general.test.ts-snapshots/terminal-layout-documentation-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+147 Bytes
(100%)
galata/test/galata/notebook.spec.ts-snapshots/code-cell-galata-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+140 Bytes
(100%)
galata/test/galata/notebook.spec.ts-snapshots/markdown-cell-galata-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+150 Bytes
(100%)
galata/test/galata/notebook.spec.ts-snapshots/raw-cell-galata-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+161 Bytes
(100%)
galata/test/galata/notebook.spec.ts-snapshots/run-cells-galata-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+148 Bytes
(100%)
...collapsible-headings.test.ts-snapshots/add-header-below-01-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+102 Bytes
(100%)
...collapsible-headings.test.ts-snapshots/add-header-below-02-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+148 Bytes
(100%)
...collapsible-headings.test.ts-snapshots/add-header-below-03-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+148 Bytes
(100%)
...psible-headings.test.ts-snapshots/collapse-previous-header-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+107 Bytes
(100%)
...sible-headings.test.ts-snapshots/collapse-previous-headers-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+146 Bytes
(100%)
...ollapsible-headings.test.ts-snapshots/jump-previous-header-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+100 Bytes
(100%)
...ble-headings.test.ts-snapshots/no-showHCB-collapse-heading-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+153 Bytes
(100%)
....test.ts-snapshots/no-showHCB-expand-heading-via-collapser-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+39 Bytes
(100%)
...ble-headings.test.ts-snapshots/no-showHCB-heading-selected-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+150 Bytes
(100%)
...collapsible-headings.test.ts-snapshots/reexpand-headers-01-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+146 Bytes
(100%)
...collapsible-headings.test.ts-snapshots/reexpand-headers-02-jupyterlab-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+107 Bytes
(100%)
...ollapsible-headings.test.ts-snapshots/reexpand-headers-03a-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+147 Bytes
(100%)
...ollapsible-headings.test.ts-snapshots/reexpand-headers-03b-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+102 Bytes
(100%)
...psible-headings.test.ts-snapshots/showHCB-collapse-heading-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+153 Bytes
(100%)
...ngs.test.ts-snapshots/showHCB-expand-heading-via-collapser-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+39 Bytes
(100%)
...psible-headings.test.ts-snapshots/showHCB-heading-selected-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+149 Bytes
(100%)
...st/jupyterlab/notebook-create.test.ts-snapshots/dark-theme-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+148 Bytes
(100%)
...est/jupyterlab/notebook-create.test.ts-snapshots/run-cells-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+184 Bytes
(100%)
...jupyterlab/notebook-edit.test.ts-snapshots/copy-paste-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+142 Bytes
(100%)
.../jupyterlab/notebook-edit.test.ts-snapshots/cut-paste-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+148 Bytes
(100%)
...est/jupyterlab/notebook-edit.test.ts-snapshots/delete-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+144 Bytes
(100%)
...yterlab/notebook-edit.test.ts-snapshots/deselect-all-cells-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+162 Bytes
(100%)
...t/jupyterlab/notebook-edit.test.ts-snapshots/execute-again-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+150 Bytes
(100%)
...est/jupyterlab/notebook-edit.test.ts-snapshots/merge-cells-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+142 Bytes
(100%)
.../jupyterlab/notebook-edit.test.ts-snapshots/move-cell-down-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+146 Bytes
(100%)
...st/jupyterlab/notebook-edit.test.ts-snapshots/move-cell-up-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+146 Bytes
(100%)
...yterlab/notebook-edit.test.ts-snapshots/paste-replace-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+162 Bytes
(100%)
...est/jupyterlab/notebook-edit.test.ts-snapshots/reedit-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+151 Bytes
(100%)
...a/test/jupyterlab/notebook-edit.test.ts-snapshots/run-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+32 Bytes
(100%)
...upyterlab/notebook-edit.test.ts-snapshots/select-all-cells-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+2.72 KB
(160%)
...jupyterlab/notebook-mobile.test.ts-snapshots/mobile-layout-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+20.3 KB
(140%)
...book-search.test.ts-snapshots/search-in-two-selected-cells-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+10.8 KB
(140%)
...b/notebook-search.test.ts-snapshots/search-on-deleted-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+10.1 KB
(140%)
...erlab/notebook-search.test.ts-snapshots/search-on-new-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+42 Bytes
(100%)
...jupyterlab/notebook-search.test.ts-snapshots/search-typing-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+145 Bytes
(100%)
...yterlab/notebook-toolbar.test.ts-snapshots/copy-paste-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+140 Bytes
(100%)
...est/jupyterlab/notebook-toolbar.test.ts-snapshots/cut-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+88 Bytes
(100%)
.../jupyterlab/notebook-toolbar.test.ts-snapshots/delete-cell-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
+143 Bytes
(100%)
...jupyterlab/notebook-toolbar.test.ts-snapshots/insert-cells-jupyterlab-linux.png
Oops, something went wrong.
Binary file modified
BIN
-5.15 KB
(68%)
...t/jupyterlab/notebook-toolbar.test.ts-snapshots/paste-cell-jupyterlab-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.