Conversation
Editor settings (scene zoom, grid, window mask...) are user specific data. They are now stored in a sidecar file next to the project file (.gdevelop/<project name>.editor-settings.json), which can be gitignored, instead of inside the project file - avoiding them being shared with collaborators (and generating git conflicts) and shipped with the game. Settings found in a project saved by an older version are migrated to the sidecar file the next time it is saved. Fixes 4ian#1983
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1983
Problem
The editor (IDE) settings of a project — scene zoom, grid settings, window mask, etc. — are stored inside the project file (as
uiSettingson each layout andeditionSettingson each external layout / custom object variant). This is user specific data, so:Solution
When a project is saved locally, its editor settings are now moved to a sidecar file stored next to the project file, in a
.gdevelopfolder:.gdevelop/(a single entry) to stop sharing/committing these settings. Projects saved in the same folder get distinct sidecar files.sceneData.uiSettings) to restore the editor state.Implementation
LocalEditorSettingsSidecar.jsinLocalFileStorageProvider: computes the sidecar path (<project folder>/.gdevelop/<project file name>.editor-settings.json),extractProjectEditorSettings(finds and removesuiSettings/editionSettingsfrom a serialized project) andapplyProjectEditorSettings(fills them back, never overriding settings already present in the project).LocalProjectWriterwrites the sidecar (and removes it when empty) during save — for both single-file and folder projects (extraction happens before splitting, so partial files stay clean too).LocalProjectOpenerre-applies the sidecar content when the project (and autosave recovery) is opened.Tests
LocalEditorSettingsSidecar.spec.js(8 tests): sidecar path mapping per project, extraction/stripping of all three settings kinds (layouts, external layouts, custom object default variant + variants), round-trip restoration, null result when nothing to store, non-destructive application (embedded settings win), robustness against malformed project/sidecar content.GDJS/tests/games/Text.json): extraction strips the settings, round-trip restores identical values, and the rest of the project JSON is untouched.