hostilefork / replpad-js

Interactive Web Console for Rebol language (Ren-C branch)
GNU Lesser General Public License v3.0
13 stars 9 forks source link

What should QUIT do? #17

Open hostilefork opened 5 years ago

hostilefork commented 5 years ago

QUIT just hangs the console at the moment, as it exits and nothing else happens.

Effects-wise, something like this TV turning off animation might be cool:

https://codepen.io/francescostella/pen/ONaWvZ

(There are probably a lot of other funny options, like taking you to what looks like an old DOS or Amiga prompt, while actually still running Rebol, but simulating some old directory items. :-P)

But the bigger question is what use quitting has in the web console. Resetting your state, perhaps. So maybe do the animation and then cycle back on?

hostilefork commented 5 years ago

One thing QUIT could do that would be arguably useful is run through a shutdown in the debug mode which could catch various kinds of leaks, or other things that shutdown checks.

There might be some point to doing something like this automatically on tab closing in the debug build:

https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing

BrianOtto commented 5 years ago

Here's one idea. Maybe it could hide the REPL and replace it with a series of community links, like ...

The links could have some nice graphics with them and be in some kind of interesting layout.

It's like the last sales pitch before they leave you :)

... and then maybe you have a few practical buttons at the bottom to "run through a shutdown" or "restart the REPL" if they quit by mistake

hostilefork commented 5 years ago

Nice! I don't know how many QUIT by mistakes there would be...

I did a little tweak just to show how to hook QUIT via HIJACK:

https://github.com/hostilefork/replpad-js/commit/be40ad6c1cc9d24d81f2e4d99da4b30d67251f2d

The hooks in replpad.reb need to get isolated into a module...because we do not want the user typing in code to be overwriting things defined there. So I'll have to figure that bit out, before putting things like LINK at top level to reuse it.

It's going to need much smarter HTML-dialecting-or-something than what I've cooked up here. I've tried to reproduce some of Ren Garden's nicer properties. But it's a pain to get it how I like it.

One non-obvious thing that the REPL does--I don't know if you've seen it--is it transforms everything upside down and then flips it again...as a means of making it "stick" to the bottom if you've stuck it, but not to disrupt your positioning otherwise:

https://stackoverflow.com/questions/54626982/

Sad that one would have to jump through such hoops to get a behavior that should just be the default. :-/ Anyway, we want to be able to reuse the CONSOLE logic but still permit HTML output...and I'm not exactly sure how to balance that. Where possible I'd rather be doing it with reusable components vs. inventing things that are "just for the ReplPad"...