Skip to content

Conversation

@krassowski
Copy link
Member

@krassowski krassowski commented Jun 25, 2024

References

Fixes #15871

Code changes

  • removes bad code duplication between PluginList and SettingsEditor which lead to loading the settings for each plugin twice (this leads to a minimal performance improvement because the fetched plugins were already cached before)
  • adds a dedicated PluginList.Model model class which is used by both PluginList and SettingsEditor
  • deprecates PluginList.sortPlugins() - this function was only used to implement the aforementioned duplicated logic; an equivalent function is now one of the private model methods
  • deprecates toSkip option previously passed to the PluginList constructor which should now be supplied to the PluginList.Model instead
  • deprecates PluginList.registry attribute - the plugin list should not provide the settings registry as it is not its responsibility; private _registry name is to be used going forward

User-facing changes

  • When the plugin gets added after the Settings Editor was opened this plugin is now visible on the list
  • When settings schema gets populated after the Settings Editor was opened (due to the use of transform), the settings are now correctly shown in the editor

Backwards-incompatible changes

None

@krassowski krassowski added the bug label Jun 25, 2024
@krassowski krassowski added this to the 4.3.0 milestone Jun 25, 2024
@jupyterlab-probot
Copy link

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

protected to enable testing the pre-fetch behaviour
@krassowski krassowski marked this pull request as ready for review June 26, 2024 11:15
@krassowski krassowski changed the title Fix settings editor not being loaded for some plugins Fix settings editor not being loaded for plugins with transform step Jun 26, 2024
@krassowski krassowski changed the title Fix settings editor not being loaded for plugins with transform step Fix settings editor not being loaded for plugins with transform step or registered late Jun 26, 2024
@krassowski krassowski changed the title Fix settings editor not being loaded for plugins with transform step or registered late Fix settings editor missing plugins with transform step or registered late Jun 26, 2024
Copy link
Member

@fcollonval fcollonval 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 have a minor suggestion and I spotted a regression. In the settings editor, the plugin list does not update when its status changes from all default values to some custom values:

bug_default_not_default

.catch(reason => {
console.error(`Failed to load the plugin list model:\n${reason}`);
});
this._model.changed.connect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Should we connect this signal only after this._model.ready to ensure we don't trigger update when the model is not yet ready?

Copy link
Member

@fcollonval fcollonval 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

@krassowski krassowski merged commit ace1daa into jupyterlab:main Jul 3, 2024
ImpSy pushed a commit to spotinst/jupyterlab that referenced this pull request Jan 7, 2025
… late (jupyterlab#16523)

* Fix setings editor not being loaded for some plugins

* Add tests for `PluginList.Model`, expose `SettingsRegistry.ready` as

protected to enable testing the pre-fetch behaviour

* Handle hanging promises

* Connect `model.changed` signal after the model is `ready`

* Fix plugin list not updating when settings change from default

* Lint test
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings editor does not load tabs of some plugins on first open

2 participants