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 kernel shortcuts, add migration, fix defaults population #15639

Merged
merged 11 commits into from
Jan 16, 2024

Conversation

krassowski
Copy link
Member

References

Code changes

  • update selectors following change of focused HTML node in command mode from notebook node to cell in a PR that fixed tab traps (#14115)
  • migrate user-defined and extension-defined selectors to the new ones transparently
  • fix winKeys, linuxKeys and macKeys incorrectly popping up in defaults and leading to corruption of shortcuts, which fixes configuring shortcuts and user shortcuts being incorrectly populated
  • fix representation of defaults in the user panel
  • add a test ensuring that merely opening the keyboard shortcut settings does not mangle the user-defined settings JSON blob

User-facing changes

JSON setting editor defaults now show up correctly

Shortcuts (optional linux/mac/win keys no longer incorrectly shown as objects)

Before After
Screenshot from 2024-01-14 19-35-21 Screenshot from 2024-01-14 19-36-01

Context menu

Before After
Screenshot from 2024-01-14 19-30-39 image

HTML sanitizer

Before After
Screenshot from 2024-01-14 19-33-01 Screenshot from 2024-01-14 19-32-53

Backwards-incompatible changes

None

@krassowski krassowski added the bug label Jan 14, 2024
@krassowski krassowski added this to the 4.1.0 milestone Jan 14, 2024
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Copy link
Contributor

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @krassowski, I only have some comments below, otherwise it looks good to me.

);
}

return result;
} else if (schema.type === 'array') {
const defaultUndefined = typeof schema.default !== 'undefined';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, shouldn't it be defaultDefined ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely, good catch - thanks!

Comment on lines 1570 to 1574
console.warn(
'Deprecated shortcut selectors: ' +
[...selectorDeprecationWarnings].concat('\n') +
'\n\nThe selectors will be substituted transparently this time, but need to be updated at source before next major release.'
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be nice to have a way to warn only once, when all the plugins are loaded.
This is not for this PR, but having a way to concatenate all messages from plugin loading should be nice, to avoid duplication.
For example, if we restore only one selector from plugin.json, we receive 16 warnings in the console.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. We could use some global variable in Private to de-duplicate; let me take a look.

@brichet
Copy link
Contributor

brichet commented Jan 16, 2024

Thanks @krassowski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment