Skip to content
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

Fix Shift + L not working in stdin #15440

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions galata/test/jupyterlab/outputarea-stdin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

import { expect, test } from '@jupyterlab/galata';

test.use({
locale: 'en-US'
});

test.describe('Stdin for ipdb', () => {
test.beforeEach(async ({ page }) => {
await page.notebook.createNew();
Expand Down Expand Up @@ -52,4 +56,30 @@ test.describe('Stdin for ipdb', () => {
await page.keyboard.insertText('x');
await expect(page.locator('.jp-Stdin-input')).toHaveValue('foofoox');
});

test('Typing in stdin box', async ({ page }) => {
// Test to ensure that notebook shortcuts do not capture text typed into inputs.
// This may not be sufficient to ensure no conflicts with other languages but
// should catch the most severe issues.
const alphabet = 'abcdefghijklmnopqrstuvwxyz';
const digits = '0123456789';
await page.notebook.setCell(0, 'code', 'input()');
// Run the selected (only) cell without proceeding and without waiting
// for it to complete (as it should stay waiting for input).
await page.keyboard.press('Control+Enter');

await page.waitForSelector('.jp-Stdin-input');
for (const letter of alphabet) {
await page.keyboard.press(`Key${letter.toUpperCase()}`);
}
for (const letter of alphabet) {
await page.keyboard.press(`Shift+Key${letter.toUpperCase()}`);
}
for (const digit of digits) {
await page.keyboard.press(`Digit${digit}`);
}
await expect(page.locator('.jp-Stdin-input')).toHaveValue(
alphabet + alphabet.toUpperCase() + digits
);
});
});
7 changes: 1 addition & 6 deletions packages/notebook-extension/schema/tracker.json
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
{
"command": "viewmenu:line-numbering",
"keys": ["Shift L"],
"selector": ".jp-Notebook.jp-mod-commandMode"
"selector": ".jp-Notebook.jp-mod-commandMode :focus:not(:read-write)"
},
{
"command": "viewmenu:match-brackets",
Expand All @@ -628,11 +628,6 @@
"keys": ["Ctrl Shift -"],
"selector": ".jp-Notebook.jp-mod-editMode"
},
{
"command": "notebook:toggle-all-cell-line-numbers",
"keys": ["Shift L"],
"selector": ".jp-Notebook.jp-mod-commandMode :focus:not(:read-write)"
},
{
"command": "notebook:undo-cell-action",
"keys": ["Z"],
Expand Down