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

Export user preference settings to a json file #16896

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

Darshan808
Copy link
Member

References #16895

Overview

This pull request implements the functionality to export user preference settings from the JupyterLab Settings Editor to an overrides.json file.

Changes Made

  • Introduced a new command settingeditor:export to handle the export action.
  • Added a toolbar button labeled "Export Settings" with an appropriate icon.
  • Implemented the logic to compile user-modified settings and write them to the overrides.json file.

Notes

This is not a complete PR. I want to discuss some things:

  • I wasn't clear on what we should exactly do with the file. Currently, I have implemented logic to download it. If the file needs to be saved in the Application Settings Directory, we might need to write server-side logic as well.
  • Can I get some guidance on this?

Snapshot

Screenshot from 2024-10-28 23-38-01

I'm also open to writing tests and updating docs after the feature is finalized.

Copy link

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

@Darshan808
Copy link
Member Author

@jtpio @krassowski
I’d appreciate it if you could review this. Any guidance or feedback would be very helpful!

@jtpio jtpio added this to the 4.4.0 milestone Oct 28, 2024
@jtpio
Copy link
Member

jtpio commented Oct 28, 2024

Thanks @Darshan808 for opening this PR, it looks promising!

Also cc @bollwyvl who was commenting about this in previous issues, and may be interested.

@Darshan808 Darshan808 changed the title fix-format Export user preference settings to a json file Oct 29, 2024
@jtpio
Copy link
Member

jtpio commented Oct 29, 2024

I wasn't clear on what we should exactly do with the file. Currently, I have implemented logic to download it.

The current behavior of downloading the file looks good to me 👍

This gives more flexibility to the user as to what to do with this file. For example one could export an overrides.json and then add it to a JupyterLite deployment easily: https://jupyterlite.readthedocs.io/en/stable/howto/configure/config_files.html#overrides-json

@bollwyvl
Copy link
Contributor

Yeah, there are a few places an overrides can go:

  • part of a overrides.d for an extension author
  • into a binder
  • into a jupyterlite

The other side of this would be Import Settings to accept an uploaded overrides.json and apply it locally. That one in specific might need a "preview changes" panel which would be more involved (e.g. a set of checkboxes to allow skipping a specific extension). But this is a fine first start.

@Darshan808
Copy link
Member Author

Are there any other places needing documentation for this? And are tests necessary for this ?

@jtpio
Copy link
Member

jtpio commented Oct 29, 2024

A new Galata test would be great! We could check that clicking on the button triggers a download: https://playwright.dev/docs/downloads

@Darshan808
Copy link
Member Author

@jtpio
How this test looks to you? Any feedback or suggestions would be greatly appreciated.

@jtpio
Copy link
Member

jtpio commented Oct 30, 2024

Looks good @Darshan808, and CI is also passing, thanks!

Maybe the test could check the downloaded overrides.json contains some settings, after making changes to some settings?

@krassowski
Copy link
Member

Maybe we should use Download icon instead of Save icon in the toolbar, just to avoid user thinking that they need to click on the save icon to save settings?

@Darshan808
Copy link
Member Author

Maybe we should use Download icon instead of Save icon in the toolbar, just to avoid user thinking that they need to click on the save icon to save settings?

You're right. I've updated the icon accordingly.

@krassowski
Copy link
Member

@Darshan808 I've sent an invite to the triage team so that you will be able to add the labels on PRs (and issues) :)

@Darshan808
Copy link
Member Author

@Darshan808 I've sent an invite to the triage team so that you will be able to add the labels on PRs (and issues) :)

Thank you so much for the invite! I'm super excited to contribute more and help out with the triage team!

@Darshan808
Copy link
Member Author

@krassowski
Is https://jupyterlab.readthedocs.io/en/latest/developer/contributing.html#labels-used-by-triagers the only resource I need, or are there other resources I should check out too?

@jtpio jtpio mentioned this pull request Oct 30, 2024
6 tasks
@krassowski
Copy link
Member

Yes, that's good for issues. I think we don't have a guide on how to apply labels to PRs, but basically "feature" for big new features, "enhancement" for small improvements, "bug" for bug fixes, "maintenance" for things without user impact, "documentation" for docs updates (all others are handled by the auto-labeller).

@jtpio jtpio linked an issue Nov 4, 2024 that may be closed by this pull request
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

Just tried with the latest changes and it works well 👍

Looks like we can get it in so it will be available in the first 4.4.0 pre-release. A follow-up could be look into importing settings from an overrides.json, but this can be tracked in a separate issue.

@jtpio jtpio merged commit 97ea257 into jupyterlab:main Nov 5, 2024
83 checks passed
ImpSy pushed a commit to spotinst/jupyterlab that referenced this pull request Jan 7, 2025
* fix-format

* commandlist-docs-update

* settings-exporter-test-add

* test-modification-to-match-content

* icon-changed-from-save-to-download

* fix-lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export custom settings to an overrides.json from the Settings Editor
4 participants