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.
Hello,
This Is referencing issue #17549,
We tried to fix this issue with @demarey during sprint and here is what we understood and tried to implement :
The first error says a directory does not exist so we tried to ensure that if the fileReference passed through the code corresponds to a file, its parent directory will be returned. This is done in UITheme>>chooseForSaveFileReferenceIn:title:extensions:path:preview:
This was recently fixed in merge #17767
We then wrote a test (#testCanUseFileInChooseForSaveFileReference) to save a file as a a name already used, and check if a new file with a 'duplicated' name existed.
We figured that the widget opening when doing the 'save as' operation is linked to the machine file system although we used an artificial file system for our test, that's why we added a little snippet to ensure the widget is correctly linked to the artificial file system if we use one. This is added as a suggestion on what could be done although this might break some thing if implemented as such, comment can be seen in StDirectoryTreePresenter>>expandPath: of this PR on NewTools, also this fix is needed for the test to pass so this test might be modified later when a correct implementation is found.
After those changes, we can see the widget works fine for the test although the name suggested for the new file saved is the same as the current image so this might need to be changed by default to have something like 'a.1.image' for example.
Attention, the code suggested in this PR is required for the 'save as' widget when launching the test
Also, for now the test doesn't pass automatically as it waits for an answer from the widget, take this PR as a suggestion we can discuss