noflo-ui icon indicating copy to clipboard operation
noflo-ui copied to clipboard

component-editor: don't autosave until linting passes

Open forresto opened this issue 10 years ago • 7 comments

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.

forresto avatar Jan 22 '15 20:01 forresto

@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?

forresto avatar Jan 22 '15 22:01 forresto

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.

jonnor avatar Jan 22 '15 23:01 jonnor

@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 avatar Jan 23 '15 14:01 forresto

@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

bergie avatar Jan 23 '15 14:01 bergie

@forresto do we have an easy way to get linting errors out from CodeMirror?

bergie avatar Aug 07 '15 17:08 bergie

Probably. I can look into it tonight.

forresto avatar Aug 07 '15 19:08 forresto

Starting point: http://stackoverflow.com/questions/17016589/codemirror-3-x-is-there-an-event-that-fires-each-time-the-linter-completes

bergie avatar Aug 09 '15 15:08 bergie