noflo-ui
noflo-ui copied to clipboard
component-editor: don't autosave until linting passes
Now each keypress makes the "Loading..." alert pop up, and can crash the running network. JSBin does magic to keep you from crashing the runtime: http://jsbin.com/blog/protection
I'd argue for old-fashioned Save / Discard buttons, which would be disabled (or have a warning) if lint isn't passing. @bergie and @jonnor say Save buttons are so 90s.
Should start with waiting 1s + lint passing before autosave.
@bergie and @jonnor now it saves on every change, what about saving only on leaving the editor? What should we do if there is lint at that point?
I think when linting is done the status should show as a little non obtrusive thing (in general). When leaving editor with that we could make that thing more intrusive. Not sure exactly how much, need to test it out I think On Jan 22, 2015 5:34 PM, "Forrest Oliphant" [email protected] wrote:
@bergie https://github.com/bergie and @jonnor https://github.com/jonnor now it saves on every change https://github.com/noflo/noflo-ui/blob/776f91d64d217dfb8f8ab6a7507820f3056688f8/elements/noflo-component-editor.html#L188, what about saving only on leaving the editor? What should we do if there is lint at that point?
— Reply to this email directly or view it on GitHub https://github.com/noflo/noflo-ui/issues/427#issuecomment-71113126.
@bergie should we keep the change signal on every change and do the saving logic in noflo, or only send the change when leaving the editor?
@forresto good question. Not saving until that could mean that you lose your changes if the browser crashes, you accidentally close the tab or whatever.
Eventually we should switch component sources to operational transforms so we get full history, just like we have with Graph Journals
@forresto do we have an easy way to get linting errors out from CodeMirror?
Probably. I can look into it tonight.
Starting point: http://stackoverflow.com/questions/17016589/codemirror-3-x-is-there-an-event-that-fires-each-time-the-linter-completes