Repository navigation
Save: File > Save no longer writes over the file the document was read from through a file written beside the path - #7698
Merged
bflatastic merged 1 commit intoNov 15, 2026
Conversation
…e file read from File > Save to the document's own file planned the save with acknowledgeLoss set, so that only its own path was asked about, and then wrote that plan. With the acknowledgment in the plan, the files written beside the path (an EPS saved with Use Artboards writes one per artboard) were not checked against the file the document was read from. A document opened from one of those artboard files, with things left out when it was read, was written over by File > Save without the question. Save As and Save a Copy already plan again without the acknowledgment before writing; File > Save now does the same. Follow-up to storytold#6751.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Member
|
Merged, thanks @dotCooCoo! It passed its CI checks. |
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.
What and why
Follow-up to #6751.
File > Save to the document's own file planned the save with the loss already acknowledged, so that only its own path was asked about, and then wrote that same plan. Because the plan carried the acknowledgment, the files written beside the path were not checked against the file the document was read from. An EPS saved with Use Artboards writes one file per artboard beside the path. When the document had been opened from one of those artboard files and reading it left things out, File > Save wrote over that file without asking.
Save As and Save a Copy already plan the save again without the acknowledgment before writing (
crates/ui-egui/src/io/save.rs,save_suggesting). File > Save now does the same, so a file written beside the path that is the file the document was read from is refused, and nothing in the set is written. The question about the document's own path is unchanged.How it was tested
New test, shown failing without the change (the artboard file was rewritten):
tests::save::file_save_does_not_replace_the_file_read_from_through_a_file_written_beside_the_path.Run on Linux on
196231d233, based onmainat9ddbf25bef:cargo fmt --all -- --checkcargo clippy -p vectorcraft-ui-egui --all-targets -- -D warningscargo test -p vectorcraft-ui-egui --lib -- tests::save: 75 passedcargo check --workspace --testsThe full
cargo xtask ciruns in this pull request's CI.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.