fix: auto-save project after layer and text operations#33
fix: auto-save project after layer and text operations#33JerryZ01 wants to merge 4 commits intoHKUDS:mainfrom
Conversation
- Add auto-save logic to layer_new() function - Add auto-save logic to draw_text() function - Ensure project state is persisted to JSON file after modifications - Fixes issue where layers and text were not saved to disk
|
seems the relevant issue is discussed also in another PR. The current design for auto-saving and project file maintaining is via the "-s" or "--save" flags. Do they work for layer and text operations? |
|
@yuh-yang Good catch! Let me clarify: What PR #33 doesThis PR implements unconditional auto-save: whenever # Auto-save if project path is set
if sess.project_path:
sess.save_session()How it differs from PR #29PR #29 added a
Why I went with unconditional for GIMP CLIFor one-shot CLI usage, I think users expect "run command → changes saved". Having to remember We could always add |
Description
This PR fixes a critical bug where project state was not being saved to disk after modification operations.
Bug Description
When using commands like
layer newordraw text, the changes were only stored in memory (undo stack) but not persisted to the JSON project file. This caused data loss when running commands in one-shot mode.Changes
layer_new()functiondraw_text()functionsess.save_session()ifsess.project_pathis setTesting
Tested with the following workflow:
Impact