Skip to content

Sync settings before/after opening document#1083

Merged
martinRenou merged 10 commits intogeojupyter:mainfrom
nakul-py:fix1081
Feb 2, 2026
Merged

Sync settings before/after opening document#1083
martinRenou merged 10 commits intogeojupyter:mainfrom
nakul-py:fix1081

Conversation

@nakul-py
Copy link
Collaborator

@nakul-py nakul-py commented Jan 18, 2026

Description

Syncing settings before/after opening document and with respect to being changed from setting registry.

Screencast.From.2026-01-18.16-48-52.mp4

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--1083.org.readthedocs.build/en/1083/
💡 JupyterLite preview: https://jupytergis--1083.org.readthedocs.build/en/1083/lite

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch nakul-py/jupytergis/fix1081

@nakul-py nakul-py requested a review from arjxn-py January 18, 2026 11:26
@nakul-py nakul-py added the enhancement New feature or request label Jan 18, 2026
@nakul-py nakul-py self-assigned this Jan 18, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

Integration tests report: appsharing.space

React.useEffect(() => {
const syncFromSettingsRegistry = async () => {
const registry = await props.model.getSettings();
const composite = registry?.composite;
Copy link
Member

Choose a reason for hiding this comment

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

I need a little help understanding this pattern of merging composite with the previous value of settings. From the docs, composite is "The composite of user settings and extension defaults.", which I read to mean the current actual settings. Is that right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes you are correct. composite represents the effective settings after merging defaults, system, and user overrides, so it is the current source of truth from the settings registry.
Sure we can omit the merging of previous value into the composite.

Copy link
Member

@mfisher87 mfisher87 Jan 20, 2026

Choose a reason for hiding this comment

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

I've read some of the other code where we access settings (tools.ts) and I'm confused about why it's done the way it's done. Perhaps we could write some docs on this (different PR).

@nakul-py nakul-py requested a review from mfisher87 January 21, 2026 12:47
nakul-py and others added 3 commits January 30, 2026 14:21
Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
Copy link
Member

@mfisher87 mfisher87 left a comment

Choose a reason for hiding this comment

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

I think this looks great but I also would love to hear from @martinRenou if he has any suggestions (e.g. can the code be more idiomatic?), since there are some aspects of the settings API I'm still not 100% comfortable about :)

Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Makes sense to me! Thanks

@martinRenou martinRenou added bug Something isn't working and removed enhancement New feature or request labels Feb 2, 2026
@martinRenou martinRenou merged commit 32d29f6 into geojupyter:main Feb 2, 2026
15 checks passed
@nakul-py nakul-py deleted the fix1081 branch February 2, 2026 15:04
gjmooney pushed a commit to gjmooney/jupytergis that referenced this pull request Feb 18, 2026
* Sync settings before/after opening document

* Refactor

* Revert bugfix for zoom controls

Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>

* Un-unpack settings from props

Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>

* Lint 🔔

Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>

* lint

---------

Co-authored-by: Matt Fisher <mfisher87@gmail.com>
Co-authored-by: Nakul Verma <173621577+nakul-py@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings not respected when opening a project with non-default settings

3 participants