Repository navigation
fix: respect file extension setting and validate file name in save as dialog - #3468
Conversation
tammi-23
left a comment
There was a problem hiding this comment.
I found an issue were the file Extension gets removed:
- Disable Show file extensions.
- Open file.txt .
- Verify that the filename input correctly displays file.
- Open the save as and enable Show file extensions.
- Observe that the filename input still displays file instead of file.txt.
- Click Save.
- The file is saved as file; the .txt extension is lost.
Maybe also an issue:
If you save .-Files like .env / .gitignore they are named (1).env if the file already exist.
In my opinion it should be .env(1)
|
@tammi-23 thanks for the review, both issues are fixed in 6f3c67c. Lost extension after toggling "Show file extensions"
Additionally, save as now takes the extension from the chosen name instead of the original file, so saving Tested in the browser (toggling the setting inside the save as dialog, copy/paste and save as of |
tammi-23
left a comment
There was a problem hiding this comment.
Re-reviewed the current head after the requested changes. The file extension is now preserved when toggling the setting, dot-file conflicts are resolved as .env (1), and duplicate naming uses the extension from the chosen name. The added unit tests cover the reported regressions and the full CI is green. I found no further blocking issues.
Description
The file name input of the save as dialog now hides the file extension when "Show file extensions" is turned off and validates the name with the same validator as the new file/folder dialogs. Saving is disabled for empty or invalid names.
Related Issue
How Has This Been Tested?
New file.md/New filefoo/bar.md) and empty names disable savingEmbedActions.spec.tsTypes of changes