ControlCore-Project / concore-editor

The concore Editor
http://controlcore-project.github.io/concore-editor
BSD 3-Clause "New" or "Revised" License
9 stars 19 forks source link

"Save" button works erratically when clicked for pre-loaded studies in Chrome/Edge #127

Closed pradeeban closed 1 year ago

pradeeban commented 1 year ago

Please check #101. The fix for this issue is probably something similar to what is done to fix #101.

To reproduce:

Open Chrome or Edge (please note that Chrome or Edge are the only officially supported browsers for the Save feature, to overwrite an existing study/graphml). Load a study/graphml Close the browser. Reopen the browser. If your browser is configured to open the previous tabs, it will open the concore-editor with that study that you opened before. Now, make some changes, and click "Save" It says, "Switch to Edge/Chrome!"

The expected behavior:

When you click "Save" on such a study/graphml, the "Save" should function in the same way as "Save As" and let you choose the output directory and study name (as in studyname.graphml).

This issue is only for studies that are loaded like this from the previous session. (You can reproduce this issue only if your browser opens the previous session when the browser is opened).

parteekcoder commented 1 year ago

hey @pradeeban this is caused as fileHandler get vanish on reloading ,

Please assign I will try my best with the optimal possible solution

parteekcoder commented 1 year ago

One solution is to again choose the file directory if there is not fileHandle present

pradeeban commented 1 year ago

This should probably be handled similar to how # #101 was handled - making "Save" behave as a "Save As."

Can you please deploy your fix to your GitHub so I can test it?

parteekcoder commented 1 year ago

This should probably be handled similar to how # #101 was handled - making "Save" behave as a "Save As."

Can you please deploy your fix to your GitHub so I can test it?

you mean that If there is not fileHandle we should call save As in all cases(means in all browser)

parteekcoder commented 1 year ago

what I have done in my PR:

parteekcoder commented 1 year ago

or do you want that If there is not fileHandle it should proceed like SaveAs

pradeeban commented 1 year ago

what I have done in my PR:

* if there is fileHandle
  it simply saves

* if there is not fileHandle
  in chrome/edge it should again ask for the filePicker
  in firefox it says to switch to chrome and edge

I like your approach. Please deploy it in your GitHub. I will test it.

parteekcoder commented 1 year ago

yeah deployed you can test at https://parteekcoder.github.io/concore-editor/

parteekcoder commented 1 year ago

@pradeeban Also I have a suggestion that I also proposed before that in firefox

save button should be implemented like save as button

pradeeban commented 1 year ago

@pradeeban Also I have a suggestion that I also proposed before that in firefox

save button should be implemented like save as button

Thanks for the fix, @parteekcoder.

I don't understand your proposal. Will not then be a mere duplicate "Save As" button in Firefox then?

parteekcoder commented 1 year ago

@pradeeban Also I have a suggestion that I also proposed before that in firefox save button should be implemented like save as button

Thanks for the fix, @parteekcoder.

I don't understand your proposal. Will not then be a mere duplicate "Save As" button in Firefox then?

yeah in firefox it will be a duplicate , but this can also be topic of discussion in future concore-editor and firefox

pradeeban commented 1 year ago

Then there is no need to attempt at this. The current Save functionality supported by Chrome is critical, as it creates a natural integration between concore and concore editor. This feature does not exist in Firefox. For now, we can live with the "Switch to Edge/Chrome" alert.