TeselaGen / ove-electron

Electron App for Open Vector Editor
Creative Commons Zero v1.0 Universal
46 stars 5 forks source link

save and export functions missing file extension by default #10

Closed jdmccauley closed 3 years ago

jdmccauley commented 4 years ago

OVE Release 0.1.10

OS: Windows 10 Version 1909 OS2: macOS Catalina

Hi @tnrich

I was testing OVE 0.1.10 and noticed that the 'save', 'save as' and 'export' functions do not include the desired file extension by default. When I 'save', 'save as' or 'export' a file, there is no extension included in the file by default. Because of this, when I save a file without reading, I just get a 'file'. Thankfully this 'file' can be opened in OVE and parsed back to its original format (cannot be done with 'import sequence', but that makes sense so please don't change).

Even when I choose to export as Genbank, Fasta, or json, the default extension is none so the resulting file is just a 'file'. Saving a file prompts the user to save as a new file, so the same issue is present.

Current solution is to manually add the correct extension when naming the file, but a fix for giving the correct default extension will be ideal.

Best, Josh files

tnrich commented 4 years ago

Hey @jdmccauley I'm looking at this now and think that this must be another Windows-specific bug because I am having trouble reproducing on my mac. Here's what the File>Save dialog looks like for me:

image

Do you also have a Mac, and if so, would you mind checking that the default extension is being added correctly?

Thanks!

jdmccauley commented 4 years ago

HIi @tnrich

I just got a mac loaned to me recently and I tried to reproduce. I found the issue on my end:

When saving a file, the name included .gb by default. I was giving the file a new name, and wasn't realizing that the .gb was getting dropped.

I'm new to mac, so is there normally a 'file format' option when saving files? There is when I save a text file, but not for the export function in OVE. In Windows, there is a dropdown for the file type when saving a file, like I see when saving a text file on the mac. This drop down only has an option for '*' meaning 'nonetype' in Windows when I save on Windows. In OVE for the mac, there is no option, just asks for file name, tags, and location. Attaching pictures for reference.

Best, Josh

saving_a_text_file saving_a_gb
tnrich commented 4 years ago

Hmm that is an interesting difference. Good digging! I'll need to see if Electron supports having the file type chooser in the "Save As" dialog.

jdmccauley commented 4 years ago

@tnrich Thanks! If it does, maybe that should work for both operating systems.

jdmccauley commented 4 years ago

@tnrich This looks promising https://stackoverflow.com/questions/43136567/electron-save-dialog-specify-file-type

tnrich commented 3 years ago

@jdmccauley I think I've fixed this in the latest release https://github.com/tnrich/ove-electron/releases/tag/v1.1.0. Can you try that out and let me know if it fixes it for ya?

Cheers!

jdmccauley commented 3 years ago

Hi @tnrich,

I apologize for the late reply. The change works! On my Windows machine, if I click 'Save As' under 'File', the correct extension is added! Thank you!

The extension is not added with the 'Export Sequence' buttons under 'File', but hey, the 'Save As' is honestly more intuitive to use and I'm super happy with it!

Cheers, Josh