Seen on Mozmill 1.0.2 STR: 1) Create a sample test case and save it to file as test_Foo.js 2) open Tests > New Test Template 3) File > Save Tested results: test_Foo.js is overwritten with the content of the New Test Template Expected results: New Test Template should be treated like a New File. File > Save should be greyed out, thus not for use until the New Test Template has been Saved As...
Adam, can you please check this?
Not seeing this behavior with trunk, I create a new file and save it generate a new test from boilerplate file save (nothing happens as this saves the tmp file somewhere in the ether, old file is the same) file save as the new file, now have two different files. Is there more to the repro?
Adam, no, the steps I reported will work every time. Clint thought this might be fixed on the trunk with the new UI. Though, I might then be concerned with the new behavior of "Save" sending the file off to no-mans-land. Shouldn't it open the same dialog as "Save As..." until the file is actually named by the user? That's how other text editors handle saving new, unnamed files.
Ah yeah I was working with trunk, I think you are right that save should open the save as dialog if it's a file saved in a temp location -- will fix this tomorrow in trunk. Thanks for the clarification.
Save As for a temp file now calls save(), Fixed in trunk.
What does it do for "Save" of a temp file? (or is that what you meant)
Not fixed. Here some more steps: 1. Open a test file 2. Select new template 3. Run the test With step 3 the loaded test from step 1 gets overwritten.
Followed the steps, now running the newly generated test requires that you save it as its own file first.
People didn't like that solution, but I have since re-factored this code, Henrik can you re-validate that this is still a issue.
Adam, I cannot test this because I even get no save as dialog. It looks like the test is saved in the temporary folder with the initial name. :/
The decided upon behavior on IRC last night was that you create a new temp file, running it will automatically save that temp file and run it, if you want to save it as something else, you can do that. Any changes to the contents of files should give them an edited "star", until you save them, and it should go away.
There is something broken in the file overlay. When I chose new from template a new file is created but doesn't get the star. Why the overlay doesn't close automatically? When I click on Close no star is shown. It's only visible when I hit ESC twice.
Great catch, Committed revision 391.
Ok, seems like we are getting forward step by step. :) (In reply to comment #11) > The decided upon behavior on IRC last night was that you create a new temp > file, running it will automatically save that temp file and run it, if you want > to save it as something else, you can do that. Any changes to the contents of > files should give them an edited "star", until you save them, and it should go > away. That's not true. I'm not able to save the file under a new file name. It seems like that this menu item is completely broken. Even when I select it inside the file overlay the new template is saved with the temporary file name. There is no way that I can choose another name. So IMO the save as dialog should appear in the following situations: * When a new file should be executed the first time * When I hit Cmd+S for an unnamed file * When I select Save as for an existing file
I just tested this out, it works the way I would expect it.. if I want to save a file with a different name, I goto file, 'save as' and type in a new name. When a new file is executed the first time we have decided that the correct behavior is save it to whatever file it currently is (even if its a temp file) and run it. Hitting cmd+s for a temp file, saves your current test to that temp file, sometimes people want to run and work on a file in its temp state and save it somewhere else only specifically when they are ready to. The functionality is currently working as it was described to me by clint and mikeal so that is a design conversation that you can have up with them.
This seems to be working the way I would expect.
This is working as I'd expect too. CMD + S still saves your template as a template in some undisclosed location, but that isn't too bad. I'd say the original bug here is fixed, and if there is a tweak for future optimization we can open a new bug for that. I think comment 11 is the right solution and will prevent dataloss, which is the main thrust of this issue.
Verified with r398.